@ghostspeak/sdk 2.0.7 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +145 -2
- package/dist/{GhostSpeakClient-CWmGaM9Q.d.ts → GhostSpeakClient-bnXwUPHI.d.ts} +10 -6
- package/dist/{StakingModule-C5rzuOWb.d.ts → StakingModule-DunDShLq.d.ts} +263 -343
- package/dist/{agent-5YLZ7DAC.js → agent-S42FIMR7.js} +3 -3
- package/dist/{agent-5YLZ7DAC.js.map → agent-S42FIMR7.js.map} +1 -1
- package/dist/browser-CI5_6Gzk.d.ts +234 -0
- package/dist/browser.d.ts +3 -64
- package/dist/browser.js +9 -9
- package/dist/{chunk-SFTSZ3LC.js → chunk-46QWY3MG.js} +3 -3
- package/dist/{chunk-SFTSZ3LC.js.map → chunk-46QWY3MG.js.map} +1 -1
- package/dist/{chunk-G7S6B6WB.js → chunk-5QBSC4T4.js} +7 -7
- package/dist/{chunk-G7S6B6WB.js.map → chunk-5QBSC4T4.js.map} +1 -1
- package/dist/{chunk-IHVDQ4YI.js → chunk-5QZVFUXB.js} +201 -256
- package/dist/chunk-5QZVFUXB.js.map +1 -0
- package/dist/{chunk-E3FD2CNY.js → chunk-6XCCMJ6M.js} +19 -23
- package/dist/chunk-6XCCMJ6M.js.map +1 -0
- package/dist/{chunk-JV2SWONF.js → chunk-A7ALCVUI.js} +3 -3
- package/dist/{chunk-JV2SWONF.js.map → chunk-A7ALCVUI.js.map} +1 -1
- package/dist/{chunk-AL3HQN73.js → chunk-AWMGX3OX.js} +172 -112
- package/dist/chunk-AWMGX3OX.js.map +1 -0
- package/dist/{chunk-S74EH3KD.js → chunk-IQM5RASO.js} +637 -25
- package/dist/chunk-IQM5RASO.js.map +1 -0
- package/dist/{chunk-SZGFSCNU.js → chunk-JYXSOXCP.js} +467 -299
- package/dist/chunk-JYXSOXCP.js.map +1 -0
- package/dist/{chunk-C5CDA3WX.js → chunk-OXA7MECJ.js} +476 -3
- package/dist/chunk-OXA7MECJ.js.map +1 -0
- package/dist/{chunk-KB6CKIUK.js → chunk-QLRWUHN2.js} +3 -3
- package/dist/{chunk-KB6CKIUK.js.map → chunk-QLRWUHN2.js.map} +1 -1
- package/dist/client.d.ts +2 -3
- package/dist/client.js +9 -9
- package/dist/{createAgentAuthorization-ULG47ZJI.js → createAgentAuthorization-KGZNXZBT.js} +4 -4
- package/dist/{createAgentAuthorization-ULG47ZJI.js.map → createAgentAuthorization-KGZNXZBT.js.map} +1 -1
- package/dist/generated-QJREJQ2C.js +9 -0
- package/dist/{generated-EG5USUFG.js.map → generated-QJREJQ2C.js.map} +1 -1
- package/dist/index.d.ts +209 -231
- package/dist/index.js +231 -521
- package/dist/index.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/minimal/core-minimal.d.ts +266 -184
- package/dist/minimal/core-minimal.js +6 -6
- package/dist/minimal/core-minimal.js.map +1 -1
- package/dist/{revokeAuthorization-OK7E7OK3.js → revokeAuthorization-2ZRO6GUZ.js} +4 -4
- package/dist/{revokeAuthorization-OK7E7OK3.js.map → revokeAuthorization-2ZRO6GUZ.js.map} +1 -1
- package/dist/{updateReputationWithAuth-Y4ONEVSP.js → updateReputationWithAuth-PCEUOCFV.js} +4 -4
- package/dist/{updateReputationWithAuth-Y4ONEVSP.js.map → updateReputationWithAuth-PCEUOCFV.js.map} +1 -1
- package/dist/utils.js +9 -9
- package/package.json +4 -4
- package/dist/chunk-AL3HQN73.js.map +0 -1
- package/dist/chunk-C5CDA3WX.js.map +0 -1
- package/dist/chunk-E3FD2CNY.js.map +0 -1
- package/dist/chunk-IHVDQ4YI.js.map +0 -1
- package/dist/chunk-S74EH3KD.js.map +0 -1
- package/dist/chunk-SZGFSCNU.js.map +0 -1
- package/dist/generated-EG5USUFG.js +0 -9
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU64Encoder,getI64Encoder,getU8Encoder,getOptionEncoder,addEncoderSizePrefix,getUtf8Encoder,getU32Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU64Decoder,getI64Decoder,getU8Decoder,getOptionDecoder,getBytesDecoder,addDecoderSizePrefix,getUtf8Decoder,getU32Decoder,combineCodec,getProgramDerivedAddress,AccountRole,upgradeRoleToSigner,isProgramError,containsBytes,getArrayEncoder,getBooleanEncoder,getArrayDecoder,getBooleanDecoder,getEnumEncoder,getEnumDecoder,getU16Encoder,getU16Decoder,getF64Encoder,getF64Decoder,getDiscriminatedUnionEncoder,getUnitEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getUnitDecoder,getTupleDecoder,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,decodeAccount,isTransactionSigner,pipe,createTransactionMessage,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,appendTransactionMessageInstructions,signTransactionMessageWithSigners,setTransactionMessageFeePayer,compileTransactionMessage,getBase64EncodedWireTransaction,createSolanaRpc,createSolanaRpcSubscriptions,lamports}from'@solana/kit';import {LRUCache}from'lru-cache';import {address}from'@solana/addresses';import'@solana/sysvars';import {sha256}from'@noble/hashes/sha256';import pt from'bs58';import {EventEmitter}from'events';var _u=Object.defineProperty;var M0=Object.getOwnPropertyDescriptor;var k0=Object.getOwnPropertyNames;var w0=Object.prototype.hasOwnProperty;var a=(n,e)=>()=>(n&&(e=n(n=0)),e);var ne=(n,e)=>{for(var t in e)_u(n,t,{get:e[t],enumerable:true});},U0=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of k0(e))!w0.call(n,r)&&r!==t&&_u(n,r,{get:()=>e[r],enumerable:!(o=M0(e,r))||o.enumerable});return n};var lf=n=>U0(_u({},"__esModule",{value:true}),n);function gn(){return getStructEncoder([["auditEnabled",getBooleanEncoder()],["realTimeMonitoring",getBooleanEncoder()],["retentionPeriod",getI64Encoder()]])}function An(){return getStructDecoder([["auditEnabled",getBooleanDecoder()],["realTimeMonitoring",getBooleanDecoder()],["retentionPeriod",getI64Decoder()]])}function W0(){return combineCodec(gn(),An())}var Tf=a(()=>{});function pn(){return getStructEncoder([["policyId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["policyType",En()],["rules",getArrayEncoder(Tn())],["scope",Sn()],["priority",getU8Encoder()],["status",Dn()],["effectiveDate",getI64Encoder()],["expirationDate",getOptionEncoder(getI64Encoder())],["metadata",mn()]])}function ln(){return getStructDecoder([["policyId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["policyType",hn()],["rules",getArrayDecoder(fn())],["scope",xn()],["priority",getU8Decoder()],["status",Pn()],["effectiveDate",getI64Decoder()],["expirationDate",getOptionDecoder(getI64Decoder())],["metadata",yn()]])}function J0(){return combineCodec(pn(),ln())}var xf=a(()=>{m();});function V(){return getEnumEncoder(Cn)}function L(){return getEnumDecoder(Cn)}function Y0(){return combineCodec(V(),L())}var Cn,Df=a(()=>{Cn=(c=>(c[c.None=0]="None",c[c.Basic=1]="Basic",c[c.Verified=2]="Verified",c[c.Pro=3]="Pro",c[c.Whale=4]="Whale",c))(Cn||{});});function Rn(){return getStructEncoder([["maxFailedAttempts",getU8Encoder()],["lockoutDuration",getI64Encoder()],["progressiveLockout",getBooleanEncoder()],["unlockMethods",getArrayEncoder(In())],["notificationRequirements",getArrayEncoder(Me())]])}function bn(){return getStructDecoder([["maxFailedAttempts",getU8Decoder()],["lockoutDuration",getI64Decoder()],["progressiveLockout",getBooleanDecoder()],["unlockMethods",getArrayDecoder(vn())],["notificationRequirements",getArrayDecoder(ke())]])}function dU(){return combineCodec(Rn(),bn())}var hf=a(()=>{m();});function Mn(){return getStructEncoder([["requirementType",wn()],["approvers",getArrayEncoder(getAddressEncoder())],["minApprovals",getU8Encoder()],["approvalTimeout",getI64Encoder()],["evidenceRequirements",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function kn(){return getStructDecoder([["requirementType",Un()],["approvers",getArrayDecoder(getAddressDecoder())],["minApprovals",getU8Decoder()],["approvalTimeout",getI64Decoder()],["evidenceRequirements",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function CU(){return combineCodec(Mn(),kn())}var bf=a(()=>{m();});function wn(){return getEnumEncoder(_n)}function Un(){return getEnumDecoder(_n)}function vU(){return combineCodec(wn(),Un())}var _n,If=a(()=>{_n=(s=>(s[s.ManagerApproval=0]="ManagerApproval",s[s.PeerReview=1]="PeerReview",s[s.SecurityClearance=2]="SecurityClearance",s[s.BackgroundCheck=3]="BackgroundCheck",s[s.TrainingCompletion=4]="TrainingCompletion",s[s.CertificationRequired=5]="CertificationRequired",s[s.BusinessJustification=6]="BusinessJustification",s[s.TechnicalAssessment=7]="TechnicalAssessment",s))(_n||{});});function zn(){return getStructEncoder([["name",getUtf8Encoder()],["actionType",Wn()],["parameters",getArrayEncoder(getStructEncoder([["0",getUtf8Encoder()],["1",getUtf8Encoder()]]))],["constraints",getArrayEncoder(Fn())]])}function On(){return getStructDecoder([["name",getUtf8Decoder()],["actionType",Nn()],["parameters",getArrayDecoder(getStructDecoder([["0",getUtf8Decoder()],["1",getUtf8Decoder()]]))],["constraints",getArrayDecoder(Gn())]])}function kU(){return combineCodec(zn(),On())}var Uf=a(()=>{m();});function Fn(){return getStructEncoder([["name",getUtf8Encoder()],["preConditions",getArrayEncoder(getUtf8Encoder())],["postConditions",getArrayEncoder(getUtf8Encoder())]])}function Gn(){return getStructDecoder([["name",getUtf8Decoder()],["preConditions",getArrayDecoder(getUtf8Decoder())],["postConditions",getArrayDecoder(getUtf8Decoder())]])}function zU(){return combineCodec(Fn(),Gn())}var Of=a(()=>{});function Wn(){return getU8Encoder()}function Nn(){return getU8Decoder()}function WU(){return combineCodec(Wn(),Nn())}var Ff,Gf=a(()=>{Ff=(y=>(y[y.Create=0]="Create",y[y.Read=1]="Read",y[y.Update=2]="Update",y[y.Delete=3]="Delete",y[y.Execute=4]="Execute",y[y.Approve=5]="Approve",y[y.Reject=6]="Reject",y[y.Transfer=7]="Transfer",y[y.Lock=8]="Lock",y[y.Unlock=9]="Unlock",y))(Ff||{});});function Bf(){return getStructEncoder([["agent",getAddressEncoder()],["owner",getAddressEncoder()],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["timestamp",getI64Encoder()]])}function Vf(){return getStructDecoder([["agent",getAddressDecoder()],["owner",getAddressDecoder()],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["timestamp",getI64Decoder()]])}function XU(){return combineCodec(Bf(),Vf())}var Lf=a(()=>{});function jf(){return getStructEncoder([["agent",getAddressEncoder()],["owner",getAddressEncoder()],["timestamp",getI64Encoder()],["serviceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["isActive",getBooleanEncoder()]])}function $f(){return getStructDecoder([["agent",getAddressDecoder()],["owner",getAddressDecoder()],["timestamp",getI64Decoder()],["serviceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["isActive",getBooleanDecoder()]])}function g_(){return combineCodec(jf(),$f())}var qf=a(()=>{});function Yf(){return getStructEncoder([["agent",getAddressEncoder()],["previousStatus",getBooleanEncoder()],["newStatus",getBooleanEncoder()],["timestamp",getI64Encoder()],["authority",getAddressEncoder()]])}function eS(){return getStructDecoder([["agent",getAddressDecoder()],["previousStatus",getBooleanDecoder()],["newStatus",getBooleanDecoder()],["timestamp",getI64Decoder()],["authority",getAddressDecoder()]])}function T_(){return combineCodec(Yf(),eS())}var tS=a(()=>{});function oS(){return getStructEncoder([["agent",getAddressEncoder()],["owner",getAddressEncoder()],["timestamp",getI64Encoder()]])}function iS(){return getStructDecoder([["agent",getAddressDecoder()],["owner",getAddressDecoder()],["timestamp",getI64Decoder()]])}function E_(){return combineCodec(oS(),iS())}var cS=a(()=>{});function Bn(){return getStructEncoder([["agentPubkey",getAddressEncoder()],["serviceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["supportedCapabilities",getArrayEncoder(getU64Encoder())],["verifiedAt",getI64Encoder()]])}function Vn(){return getStructDecoder([["agentPubkey",getAddressDecoder()],["serviceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["supportedCapabilities",getArrayDecoder(getU64Decoder())],["verifiedAt",getI64Decoder()]])}function B_(){return combineCodec(Bn(),Vn())}var sS=a(()=>{});function Ln(){return getStructEncoder([["biometricType",we()],["maxAge",getI64Encoder()],["refreshRequirements",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["degradationHandling",Hn()]])}function Kn(){return getStructDecoder([["biometricType",Ue()],["maxAge",getI64Decoder()],["refreshRequirements",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["degradationHandling",jn()]])}function tz(){return combineCodec(Ln(),Kn())}var aS=a(()=>{m();});function $n(){return getStructEncoder([["actionType",_e()],["requiredApprovers",getArrayEncoder(getAddressEncoder())],["minApprovals",getU8Encoder()],["approvalTimeout",getI64Encoder()]])}function qn(){return getStructDecoder([["actionType",ze()],["requiredApprovers",getArrayDecoder(getAddressDecoder())],["minApprovals",getU8Decoder()],["approvalTimeout",getI64Decoder()]])}function pz(){return combineCodec($n(),qn())}var dS=a(()=>{m();});function re(){return getDiscriminatedUnionEncoder([["FavorClient",getStructEncoder([["reason",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])],["FavorAgent",getStructEncoder([["reason",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])],["Split",getStructEncoder([["clientPercentage",getU8Encoder()],["reason",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])]])}function oe(){return getDiscriminatedUnionDecoder([["FavorClient",getStructDecoder([["reason",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])],["FavorAgent",getStructDecoder([["reason",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])],["Split",getStructDecoder([["clientPercentage",getU8Decoder()],["reason",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])]])}function Sz(){return combineCodec(re(),oe())}function xz(n,e){return Array.isArray(e)?{__kind:n,fields:e}:{__kind:n,...e??{}}}function Dz(n,e){return e.__kind===n}var uS=a(()=>{});function _e(){return getEnumEncoder(Jn)}function ze(){return getEnumDecoder(Jn)}function Cz(){return combineCodec(_e(),ze())}var Jn,gS=a(()=>{Jn=(p=>(p[p.AgentRegistered=0]="AgentRegistered",p[p.AgentUpdated=1]="AgentUpdated",p[p.AgentDeactivated=2]="AgentDeactivated",p[p.AgentVerified=3]="AgentVerified",p[p.PaymentProcessed=4]="PaymentProcessed",p[p.EscrowCreated=5]="EscrowCreated",p[p.EscrowReleased=6]="EscrowReleased",p[p.FundsWithdrawn=7]="FundsWithdrawn",p[p.ProposalCreated=8]="ProposalCreated",p[p.VoteCast=9]="VoteCast",p[p.ProposalExecuted=10]="ProposalExecuted",p[p.GovernanceUpdated=11]="GovernanceUpdated",p[p.AccessGranted=12]="AccessGranted",p[p.AccessRevoked=13]="AccessRevoked",p[p.SecurityPolicyUpdated=14]="SecurityPolicyUpdated",p[p.SuspiciousActivity=15]="SuspiciousActivity",p[p.ComplianceReportGenerated=16]="ComplianceReportGenerated",p[p.RegulatorySubmission=17]="RegulatorySubmission",p[p.AuditRequested=18]="AuditRequested",p[p.ViolationDetected=19]="ViolationDetected",p[p.SystemConfigUpdated=20]="SystemConfigUpdated",p[p.EmergencyAction=21]="EmergencyAction",p[p.MaintenancePerformed=22]="MaintenancePerformed",p[p.WorkOrderCreated=23]="WorkOrderCreated",p[p.WorkOrderCompleted=24]="WorkOrderCompleted",p[p.DisputeRaised=25]="DisputeRaised",p[p.DisputeResolved=26]="DisputeResolved",p[p.MultisigCreated=27]="MultisigCreated",p[p.MultisigSigned=28]="MultisigSigned",p[p.MultisigExecuted=29]="MultisigExecuted",p[p.RiskAssessmentPerformed=30]="RiskAssessmentPerformed",p[p.RiskThresholdExceeded=31]="RiskThresholdExceeded",p[p.RiskMitigationApplied=32]="RiskMitigationApplied",p))(Jn||{});});function Oe(){return getStructEncoder([["maxEntries",getU32Encoder()],["retentionPeriod",getI64Encoder()],["autoArchive",getBooleanEncoder()],["reportingFrequency",Zn()],["approvalLevels",getArrayEncoder($n())],["encryptionRequired",getBooleanEncoder()],["backupFrequency",Qn()]])}function Fe(){return getStructDecoder([["maxEntries",getU32Decoder()],["retentionPeriod",getI64Decoder()],["autoArchive",getBooleanDecoder()],["reportingFrequency",Yn()],["approvalLevels",getArrayDecoder(qn())],["encryptionRequired",getBooleanDecoder()],["backupFrequency",Xn()]])}function zz(){return combineCodec(Oe(),Fe())}var lS=a(()=>{m();});function er(){return getStructEncoder([["transactionSignature",getOptionEncoder(getUtf8Encoder())],["amount",getOptionEncoder(getU64Encoder())],["token",getOptionEncoder(getAddressEncoder())],["metadata",getArrayEncoder(getStructEncoder([["0",getUtf8Encoder()],["1",getUtf8Encoder()]]))],["riskScore",getOptionEncoder(getU32Encoder())],["location",getOptionEncoder(getUtf8Encoder())],["clientInfo",getOptionEncoder(getUtf8Encoder())]])}function tr(){return getStructDecoder([["transactionSignature",getOptionDecoder(getUtf8Decoder())],["amount",getOptionDecoder(getU64Decoder())],["token",getOptionDecoder(getAddressDecoder())],["metadata",getArrayDecoder(getStructDecoder([["0",getUtf8Decoder()],["1",getUtf8Decoder()]]))],["riskScore",getOptionDecoder(getU32Decoder())],["location",getOptionDecoder(getUtf8Decoder())],["clientInfo",getOptionDecoder(getUtf8Decoder())]])}function Hz(){return combineCodec(er(),tr())}var TS=a(()=>{});function nr(){return getStructEncoder([["entryId",getU64Encoder()],["timestamp",getI64Encoder()],["action",_e()],["actor",getAddressEncoder()],["target",getOptionEncoder(getAddressEncoder())],["context",er()],["complianceFlags",or()],["previousHash",fixEncoderSize(getBytesEncoder(),32)],["entryHash",fixEncoderSize(getBytesEncoder(),32)],["signature",getOptionEncoder(fixEncoderSize(getBytesEncoder(),64))]])}function rr(){return getStructDecoder([["entryId",getU64Decoder()],["timestamp",getI64Decoder()],["action",ze()],["actor",getAddressDecoder()],["target",getOptionDecoder(getAddressDecoder())],["context",tr()],["complianceFlags",ir()],["previousHash",fixDecoderSize(getBytesDecoder(),32)],["entryHash",fixDecoderSize(getBytesDecoder(),32)],["signature",getOptionDecoder(fixDecoderSize(getBytesDecoder(),64))]])}function Yz(){return combineCodec(nr(),rr())}var PS=a(()=>{m();});function ES(){return getStructEncoder([["entity",getAddressEncoder()],["entityType",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["timestamp",getI64Encoder()]])}function hS(){return getStructDecoder([["entity",getAddressDecoder()],["entityType",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["timestamp",getI64Decoder()]])}function pO(){return combineCodec(ES(),hS())}var CS=a(()=>{});function sr(){return getEnumEncoder(cr)}function ar(){return getEnumDecoder(cr)}function TO(){return combineCodec(sr(),ar())}var cr,RS=a(()=>{cr=(r=>(r[r.Low=0]="Low",r[r.Medium=1]="Medium",r[r.High=2]="High",r[r.VeryHigh=3]="VeryHigh",r))(cr||{});});function ur(){return getEnumEncoder(dr)}function gr(){return getEnumDecoder(dr)}function DO(){return combineCodec(ur(),gr())}var dr,bS=a(()=>{dr=(A=>(A[A.Password=0]="Password",A[A.DigitalSignature=1]="DigitalSignature",A[A.Biometric=2]="Biometric",A[A.Token=3]="Token",A[A.Certificate=4]="Certificate",A[A.Sms=5]="Sms",A[A.Email=6]="Email",A[A.App=7]="App",A[A.Hardware=8]="Hardware",A))(dr||{});});function Ar(){return getStructEncoder([["mfaRequired",getBooleanEncoder()],["supportedMethods",getArrayEncoder(ur())],["strengthRequirements",lr()],["lockoutPolicies",Rn()],["biometricPolicies",getOptionEncoder(yr())]])}function pr(){return getStructDecoder([["mfaRequired",getBooleanDecoder()],["supportedMethods",getArrayDecoder(gr())],["strengthRequirements",mr()],["lockoutPolicies",bn()],["biometricPolicies",getOptionDecoder(Tr())]])}function kO(){return combineCodec(Ar(),pr())}var IS=a(()=>{m();});function lr(){return getStructEncoder([["minimumLevel",sr()],["riskBased",getBooleanEncoder()],["adaptive",getBooleanEncoder()],["stepUpTriggers",getArrayEncoder(fr())]])}function mr(){return getStructDecoder([["minimumLevel",ar()],["riskBased",getBooleanDecoder()],["adaptive",getBooleanDecoder()],["stepUpTriggers",getArrayDecoder(Sr())]])}function FO(){return combineCodec(lr(),mr())}var kS=a(()=>{m();});function xr(){return getStructEncoder([["defaultDeny",getBooleanEncoder()],["explicitPermissionsRequired",getBooleanEncoder()]])}function Dr(){return getStructDecoder([["defaultDeny",getBooleanDecoder()],["explicitPermissionsRequired",getBooleanDecoder()]])}function BO(){return combineCodec(xr(),Dr())}var _S=a(()=>{});function Qn(){return getEnumEncoder(Pr)}function Xn(){return getEnumDecoder(Pr)}function HO(){return combineCodec(Qn(),Xn())}var Pr,zS=a(()=>{Pr=(r=>(r[r.Hourly=0]="Hourly",r[r.Daily=1]="Daily",r[r.Weekly=2]="Weekly",r[r.Monthly=3]="Monthly",r))(Pr||{});});function yr(){return getStructEncoder([["supportedTypes",getArrayEncoder(we())],["qualityRequirements",Cr()],["livenessDetection",getBooleanEncoder()],["templateProtection",Er()]])}function Tr(){return getStructDecoder([["supportedTypes",getArrayDecoder(Ue())],["qualityRequirements",Rr()],["livenessDetection",getBooleanDecoder()],["templateProtection",hr()]])}function YO(){return combineCodec(yr(),Tr())}var OS=a(()=>{m();});function Er(){return getStructEncoder([["encryptionRequired",getBooleanEncoder()],["storageMethod",br()],["revocationSupport",getBooleanEncoder()],["agingPolicies",getArrayEncoder(Ln())]])}function hr(){return getStructDecoder([["encryptionRequired",getBooleanDecoder()],["storageMethod",Ir()],["revocationSupport",getBooleanDecoder()],["agingPolicies",getArrayDecoder(Kn())]])}function i8(){return combineCodec(Er(),hr())}var WS=a(()=>{m();});function br(){return getEnumEncoder(vr)}function Ir(){return getEnumDecoder(vr)}function d8(){return combineCodec(br(),Ir())}var vr,NS=a(()=>{vr=(c=>(c[c.OnDevice=0]="OnDevice",c[c.Encrypted=1]="Encrypted",c[c.Hashed=2]="Hashed",c[c.Distributed=3]="Distributed",c[c.None=4]="None",c))(vr||{});});function we(){return getEnumEncoder(Mr)}function Ue(){return getEnumDecoder(Mr)}function p8(){return combineCodec(we(),Ue())}var Mr,BS=a(()=>{Mr=(d=>(d[d.Fingerprint=0]="Fingerprint",d[d.FaceRecognition=1]="FaceRecognition",d[d.IrisRecognition=2]="IrisRecognition",d[d.VoiceRecognition=3]="VoiceRecognition",d[d.Signature=4]="Signature",d[d.Gait=5]="Gait",d[d.Behavioral=6]="Behavioral",d))(Mr||{});});function Cr(){return getStructEncoder([["minimumQuality",getU8Encoder()],["assessmentMethod",getUtf8Encoder()],["multipleSamples",getBooleanEncoder()],["qualityThresholds",getArrayEncoder(getStructEncoder([["0",getUtf8Encoder()],["1",getU8Encoder()]]))]])}function Rr(){return getStructDecoder([["minimumQuality",getU8Decoder()],["assessmentMethod",getUtf8Decoder()],["multipleSamples",getBooleanDecoder()],["qualityThresholds",getArrayDecoder(getStructDecoder([["0",getUtf8Decoder()],["1",getU8Decoder()]]))]])}function S8(){return combineCodec(Cr(),Rr())}var qS=a(()=>{});function or(){return getStructEncoder([["requiresReporting",getBooleanEncoder()],["highRisk",getBooleanEncoder()],["sensitiveData",getBooleanEncoder()],["crossBorder",getBooleanEncoder()],["largeAmount",getBooleanEncoder()],["suspicious",getBooleanEncoder()],["manualReview",getBooleanEncoder()],["jurisdiction",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function ir(){return getStructDecoder([["requiresReporting",getBooleanDecoder()],["highRisk",getBooleanDecoder()],["sensitiveData",getBooleanDecoder()],["crossBorder",getBooleanDecoder()],["largeAmount",getBooleanDecoder()],["suspicious",getBooleanDecoder()],["manualReview",getBooleanDecoder()],["jurisdiction",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function k8(){return combineCodec(or(),ir())}var JS=a(()=>{});function kr(){return getStructEncoder([["complianceScore",getU8Encoder()],["policyAdherenceRate",getU8Encoder()],["avgIncidentResponseTime",getU64Encoder()],["falsePositiveRate",getU8Encoder()],["coveragePercentage",getU8Encoder()],["auditReadinessScore",getU8Encoder()]])}function wr(){return getStructDecoder([["complianceScore",getU8Decoder()],["policyAdherenceRate",getU8Decoder()],["avgIncidentResponseTime",getU64Decoder()],["falsePositiveRate",getU8Decoder()],["coveragePercentage",getU8Decoder()],["auditReadinessScore",getU8Decoder()]])}function F8(){return combineCodec(kr(),wr())}var QS=a(()=>{});function Ur(){return getStructEncoder([["frameworks",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["auditRequirements",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["reportingRequirements",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function _r(){return getStructDecoder([["frameworks",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["auditRequirements",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["reportingRequirements",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function B8(){return combineCodec(Ur(),_r())}var XS=a(()=>{});function zr(){return getStructEncoder([["complianceScore",getU8Encoder()],["lastReview",getI64Encoder()],["nextReview",getI64Encoder()],["complianceOfficers",getArrayEncoder(getAddressEncoder())]])}function Or(){return getStructDecoder([["complianceScore",getU8Decoder()],["lastReview",getI64Decoder()],["nextReview",getI64Decoder()],["complianceOfficers",getArrayDecoder(getAddressDecoder())]])}function X8(){return combineCodec(zr(),Or())}var ex=a(()=>{});function rx(){return getStructEncoder([["report",getAddressEncoder()],["reportId",getU64Encoder()],["reportType",ie()],["complianceRate",getU64Encoder()]])}function ox(){return getStructDecoder([["report",getAddressDecoder()],["reportId",getU64Decoder()],["reportType",ce()],["complianceRate",getU64Decoder()]])}function rF(){return combineCodec(rx(),ox())}var ix=a(()=>{m();});function Ax(){return getStructEncoder([["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["owner",getAddressEncoder()],["treeAuthority",getAddressEncoder()],["merkleTree",getAddressEncoder()],["dataHash",fixEncoderSize(getBytesEncoder(),32)],["index",getU64Encoder()],["metadataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["createdAt",getI64Encoder()]])}function px(){return getStructDecoder([["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["owner",getAddressDecoder()],["treeAuthority",getAddressDecoder()],["merkleTree",getAddressDecoder()],["dataHash",fixDecoderSize(getBytesDecoder(),32)],["index",getU64Decoder()],["metadataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["createdAt",getI64Decoder()]])}function mF(){return combineCodec(Ax(),px())}var lx=a(()=>{});function Ne(){return getEnumEncoder(Fr)}function Be(){return getEnumDecoder(Fr)}function SF(){return combineCodec(Ne(),Be())}var Fr,mx=a(()=>{Fr=(i=>(i[i.TimeDelay=0]="TimeDelay",i[i.TokenBalance=1]="TokenBalance",i[i.PriceThreshold=2]="PriceThreshold",i[i.VoteCount=3]="VoteCount",i[i.ExternalOracle=4]="ExternalOracle",i[i.CustomLogic=5]="CustomLogic",i))(Fr||{});});function Gr(){return getStructEncoder([["attribute",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["operator",Nr()],["value",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["valueType",Vr()]])}function Wr(){return getStructDecoder([["attribute",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["operator",Br()],["value",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["valueType",Lr()]])}function EF(){return combineCodec(Gr(),Wr())}var Px=a(()=>{m();});function Nr(){return getEnumEncoder(Kr)}function Br(){return getEnumDecoder(Kr)}function bF(){return combineCodec(Nr(),Br())}var Kr,Ex=a(()=>{Kr=(D=>(D[D.Equals=0]="Equals",D[D.NotEquals=1]="NotEquals",D[D.GreaterThan=2]="GreaterThan",D[D.LessThan=3]="LessThan",D[D.GreaterThanOrEqual=4]="GreaterThanOrEqual",D[D.LessThanOrEqual=5]="LessThanOrEqual",D[D.Contains=6]="Contains",D[D.NotContains=7]="NotContains",D[D.In=8]="In",D[D.NotIn=9]="NotIn",D[D.Matches=10]="Matches",D[D.NotMatches=11]="NotMatches",D))(Kr||{});});function Ve(){return getEnumEncoder(Hr)}function Le(){return getEnumDecoder(Hr)}function kF(){return combineCodec(Ve(),Le())}var Hr,hx=a(()=>{Hr=(c=>(c[c.AgentIdentity=0]="AgentIdentity",c[c.ReputationScore=1]="ReputationScore",c[c.JobCompletion=2]="JobCompletion",c[c.DelegatedSigner=3]="DelegatedSigner",c[c.Custom=4]="Custom",c))(Hr||{});});function $r(){return getEnumEncoder(jr)}function qr(){return getEnumDecoder(jr)}function zF(){return combineCodec($r(),qr())}var jr,Cx=a(()=>{jr=(r=>(r[r.Pending=0]="Pending",r[r.Active=1]="Active",r[r.Revoked=2]="Revoked",r[r.Expired=3]="Expired",r))(jr||{});});function Ke(){return getEnumEncoder(Jr)}function He(){return getEnumDecoder(Jr)}function WF(){return combineCodec(Ke(),He())}var Jr,Rx=a(()=>{Jr=(r=>(r[r.NotSynced=0]="NotSynced",r[r.SyncPending=1]="SyncPending",r[r.SyncedToCrossmint=2]="SyncedToCrossmint",r[r.SyncFailed=3]="SyncFailed",r))(Jr||{});});function Xr(){return getEnumEncoder(Qr)}function Zr(){return getEnumDecoder(Qr)}function LF(){return combineCodec(Xr(),Zr())}var Qr,bx=a(()=>{Qr=(c=>(c[c.Public=0]="Public",c[c.Internal=1]="Internal",c[c.Confidential=2]="Confidential",c[c.Restricted=3]="Restricted",c[c.TopSecret=4]="TopSecret",c))(Qr||{});});function Yr(){return getStructEncoder([["encryptionRequired",getBooleanEncoder()],["classificationRequired",getBooleanEncoder()],["dlpEnabled",getBooleanEncoder()]])}function eo(){return getStructDecoder([["encryptionRequired",getBooleanDecoder()],["classificationRequired",getBooleanDecoder()],["dlpEnabled",getBooleanDecoder()]])}function $F(){return combineCodec(Yr(),eo())}var Ix=a(()=>{});function Hn(){return getEnumEncoder(to)}function jn(){return getEnumDecoder(to)}function XF(){return combineCodec(Hn(),jn())}var to,vx=a(()=>{to=(r=>(r[r.RequireRefresh=0]="RequireRefresh",r[r.GradualDegradation=1]="GradualDegradation",r[r.ImmediateExpiry=2]="ImmediateExpiry",r[r.AdaptiveThreshold=3]="AdaptiveThreshold",r))(to||{});});function no(){return getStructEncoder([["delegator",getAddressEncoder()],["delegatedAt",getI64Encoder()],["scope",oo()],["expiresAt",getOptionEncoder(getI64Encoder())]])}function ro(){return getStructDecoder([["delegator",getAddressDecoder()],["delegatedAt",getI64Decoder()],["scope",io()],["expiresAt",getOptionDecoder(getI64Decoder())]])}function iG(){return combineCodec(no(),ro())}var wx=a(()=>{m();});function oo(){return getDiscriminatedUnionEncoder([["All",getUnitEncoder()],["ProposalType",getStructEncoder([["fields",getTupleEncoder([se()])]])],["SingleProposal",getUnitEncoder()],["Limited",getUnitEncoder()]])}function io(){return getDiscriminatedUnionDecoder([["All",getUnitDecoder()],["ProposalType",getStructDecoder([["fields",getTupleDecoder([ae()])]])],["SingleProposal",getUnitDecoder()],["Limited",getUnitDecoder()]])}function pG(){return combineCodec(oo(),io())}function lG(n,e){return Array.isArray(e)?{__kind:n,fields:e}:{__kind:n,...e??{}}}function mG(n,e){return e.__kind===n}var Ux=a(()=>{m();});function _x(){return getStructEncoder([["escrowId",getU64Encoder()],["agent",getAddressEncoder()],["deliveryProof",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function zx(){return getStructDecoder([["escrowId",getU64Decoder()],["agent",getAddressDecoder()],["deliveryProof",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function vG(){return combineCodec(_x(),zx())}var Ox=a(()=>{});function Fx(){return getStructEncoder([["escrowId",getU64Encoder()],["client",getAddressEncoder()],["reason",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function Gx(){return getStructDecoder([["escrowId",getU64Decoder()],["client",getAddressDecoder()],["reason",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function LG(){return combineCodec(Fx(),Gx())}var Wx=a(()=>{});function Nx(){return getStructEncoder([["escrowId",getU64Encoder()],["decision",re()],["arbitrator",getAddressEncoder()]])}function Bx(){return getStructDecoder([["escrowId",getU64Decoder()],["decision",oe()],["arbitrator",getAddressDecoder()]])}function XG(){return combineCodec(Nx(),Bx())}var Vx=a(()=>{m();});function co(){return getStructEncoder([["breakGlassEnabled",getBooleanEncoder()],["emergencyContacts",getArrayEncoder(getAddressEncoder())],["approvalRequired",getBooleanEncoder()]])}function so(){return getStructDecoder([["breakGlassEnabled",getBooleanDecoder()],["emergencyContacts",getArrayDecoder(getAddressDecoder())],["approvalRequired",getBooleanDecoder()]])}function i2(){return combineCodec(co(),so())}var Hx=a(()=>{});function ao(){return getStructEncoder([["emergencyContacts",getArrayEncoder(getAddressEncoder())],["emergencyThreshold",getU8Encoder()],["emergencyTimeout",getI64Encoder()],["emergencyTransactionTypes",getArrayEncoder(de())],["freezeEnabled",getBooleanEncoder()],["frozen",getBooleanEncoder()],["frozenAt",getOptionEncoder(getI64Encoder())],["autoUnfreezeDuration",getOptionEncoder(getI64Encoder())]])}function uo(){return getStructDecoder([["emergencyContacts",getArrayDecoder(getAddressDecoder())],["emergencyThreshold",getU8Decoder()],["emergencyTimeout",getI64Decoder()],["emergencyTransactionTypes",getArrayDecoder(ue())],["freezeEnabled",getBooleanDecoder()],["frozen",getBooleanDecoder()],["frozenAt",getOptionDecoder(getI64Decoder())],["autoUnfreezeDuration",getOptionDecoder(getI64Decoder())]])}function p2(){return combineCodec(ao(),uo())}var Zx=a(()=>{m();});function je(){return getEnumEncoder(go)}function $e(){return getEnumDecoder(go)}function T2(){return combineCodec(je(),$e())}var go,Yx=a(()=>{go=(r=>(r[r.Hard=0]="Hard",r[r.Soft=1]="Soft",r[r.Advisory=2]="Advisory",r[r.ExceptionBased=3]="ExceptionBased",r))(go||{});});function nD(){return getStructEncoder([["escrowId",getU64Encoder()],["agent",getAddressEncoder()],["amount",getU64Encoder()]])}function rD(){return getStructDecoder([["escrowId",getU64Decoder()],["agent",getAddressDecoder()],["amount",getU64Decoder()]])}function E2(){return combineCodec(nD(),rD())}var oD=a(()=>{});function dD(){return getStructEncoder([["escrowId",getU64Encoder()],["client",getAddressEncoder()],["agent",getAddressEncoder()],["amount",getU64Encoder()],["deadline",getI64Encoder()]])}function uD(){return getStructDecoder([["escrowId",getU64Decoder()],["client",getAddressDecoder()],["agent",getAddressDecoder()],["amount",getU64Decoder()],["deadline",getI64Decoder()]])}function v2(){return combineCodec(dD(),uD())}var gD=a(()=>{});function po(){return getEnumEncoder(Ao)}function lo(){return getEnumDecoder(Ao)}function U2(){return combineCodec(po(),lo())}var Ao,AD=a(()=>{Ao=(r=>(r[r.Active=0]="Active",r[r.Completed=1]="Completed",r[r.Disputed=2]="Disputed",r[r.Cancelled=3]="Cancelled",r))(Ao||{});});function ge(){return getStructEncoder([["conditionType",Ne()],["targetValue",getU64Encoder()],["currentValue",getU64Encoder()],["met",getBooleanEncoder()],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function Ae(){return getStructDecoder([["conditionType",Be()],["targetValue",getU64Decoder()],["currentValue",getU64Decoder()],["met",getBooleanDecoder()],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function H2(){return combineCodec(ge(),Ae())}var mD=a(()=>{m();});function qe(){return getStructEncoder([["instructions",getArrayEncoder(mo())],["executionDelay",getI64Encoder()],["executionConditions",getArrayEncoder(ge())],["cancellable",getBooleanEncoder()],["autoExecute",getBooleanEncoder()],["executionAuthority",getAddressEncoder()]])}function Je(){return getStructDecoder([["instructions",getArrayDecoder(yo())],["executionDelay",getI64Decoder()],["executionConditions",getArrayDecoder(Ae())],["cancellable",getBooleanDecoder()],["autoExecute",getBooleanDecoder()],["executionAuthority",getAddressDecoder()]])}function Y2(){return combineCodec(qe(),Je())}var xD=a(()=>{m();});function To(){return getStructEncoder([["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["latitudeRange",So()],["longitudeRange",Do()],["radius",getOptionEncoder(getU32Encoder())]])}function fo(){return getStructDecoder([["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["latitudeRange",xo()],["longitudeRange",Po()],["radius",getOptionDecoder(getU32Decoder())]])}function dW(){return combineCodec(To(),fo())}var ED=a(()=>{m();});function hD(){return getStructEncoder([["agent",getAddressEncoder()],["amount",getU64Encoder()],["reason",Qe()],["newTier",V()]])}function CD(){return getStructDecoder([["agent",getAddressDecoder()],["amount",getU64Decoder()],["reason",Xe()],["newTier",L()]])}function TW(){return combineCodec(hD(),CD())}var RD=a(()=>{m();});function vD(){return getStructEncoder([["agent",getAddressEncoder()],["amount",getU64Encoder()],["unlockAt",getI64Encoder()],["reputationBoostBps",getU16Encoder()],["tier",V()],["dailyApiCalls",getU32Encoder()],["votingPower",getU64Encoder()]])}function MD(){return getStructDecoder([["agent",getAddressDecoder()],["amount",getU64Decoder()],["unlockAt",getI64Decoder()],["reputationBoostBps",getU16Decoder()],["tier",L()],["dailyApiCalls",getU32Decoder()],["votingPower",getU64Decoder()]])}function vW(){return combineCodec(vD(),MD())}var kD=a(()=>{m();});function wD(){return getStructEncoder([["agent",getAddressEncoder()],["amount",getU64Encoder()]])}function UD(){return getStructDecoder([["agent",getAddressDecoder()],["amount",getU64Decoder()]])}function FW(){return combineCodec(wD(),UD())}var _D=a(()=>{});function FD(){return getStructEncoder([["proposal",getAddressEncoder()],["proposalId",getU64Encoder()],["proposer",getAddressEncoder()],["title",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function GD(){return getStructDecoder([["proposal",getAddressDecoder()],["proposalId",getU64Decoder()],["proposer",getAddressDecoder()],["title",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function JW(){return combineCodec(FD(),GD())}var WD=a(()=>{});function Eo(){return getStructEncoder([["level",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["value",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["includeDescendants",getBooleanEncoder()]])}function ho(){return getStructDecoder([["level",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["value",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["includeDescendants",getBooleanDecoder()]])}function tN(){return combineCodec(Eo(),ho())}var jD=a(()=>{});function Co(){return getStructEncoder([["responseTeam",getArrayEncoder(getAddressEncoder())],["escalationProcedures",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["notificationRequirements",getArrayEncoder(Me())]])}function Ro(){return getStructDecoder([["responseTeam",getArrayDecoder(getAddressDecoder())],["escalationProcedures",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["notificationRequirements",getArrayDecoder(ke())]])}function pN(){return combineCodec(Co(),Ro())}var $D=a(()=>{m();});function So(){return getStructEncoder([["min",getF64Encoder()],["max",getF64Encoder()]])}function xo(){return getStructDecoder([["min",getF64Decoder()],["max",getF64Decoder()]])}function TN(){return combineCodec(So(),xo())}var QD=a(()=>{});function Uo(){return getStructEncoder([["allowedCountries",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["blockedCountries",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["allowedIpRanges",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["blockedIpRanges",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["geofencingEnabled",getBooleanEncoder()],["allowedRegions",getArrayEncoder(To())]])}function _o(){return getStructDecoder([["allowedCountries",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["blockedCountries",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["allowedIpRanges",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["blockedIpRanges",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["geofencingEnabled",getBooleanDecoder()],["allowedRegions",getArrayDecoder(fo())]])}function EN(){return combineCodec(Uo(),_o())}var XD=a(()=>{m();});function Do(){return getStructEncoder([["min",getF64Encoder()],["max",getF64Encoder()]])}function Po(){return getStructDecoder([["min",getF64Decoder()],["max",getF64Decoder()]])}function bN(){return combineCodec(Do(),Po())}var eP=a(()=>{});function rP(){return getStructEncoder([["multisigId",getU64Encoder()],["multisigType",pe()],["owner",getAddressEncoder()],["threshold",getU8Encoder()],["signerCount",getU8Encoder()],["timestamp",getI64Encoder()]])}function oP(){return getStructDecoder([["multisigId",getU64Decoder()],["multisigType",le()],["owner",getAddressDecoder()],["threshold",getU8Decoder()],["signerCount",getU8Decoder()],["timestamp",getI64Decoder()]])}function FN(){return combineCodec(rP(),oP())}var iP=a(()=>{m();});function zo(){return getStructEncoder([["signer",getAddressEncoder()],["signature",fixEncoderSize(getBytesEncoder(),64)],["signedAt",getI64Encoder()],["signatureMethod",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["verificationData",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))]])}function Oo(){return getStructDecoder([["signer",getAddressDecoder()],["signature",fixDecoderSize(getBytesDecoder(),64)],["signedAt",getI64Decoder()],["signatureMethod",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["verificationData",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))]])}function XN(){return combineCodec(zo(),Oo())}var AP=a(()=>{});function pe(){return getEnumEncoder(Fo)}function le(){return getEnumDecoder(Fo)}function t6(){return combineCodec(pe(),le())}var Fo,pP=a(()=>{Fo=(i=>(i[i.Protocol=0]="Protocol",i[i.Dao=1]="Dao",i[i.Dispute=2]="Dispute",i[i.AgentConsortium=3]="AgentConsortium",i[i.AgentTreasury=4]="AgentTreasury",i[i.Custom=5]="Custom",i))(Fo||{});});function Go(){return getStructEncoder([["multisigType",pe()],["timelockSeconds",getI64Encoder()],["minSigners",getU8Encoder()],["maxSigners",getU8Encoder()],["minReputationScore",getU16Encoder()],["requiresTokenHoldings",getBooleanEncoder()],["minTokenBalance",getU64Encoder()]])}function Wo(){return getStructDecoder([["multisigType",le()],["timelockSeconds",getI64Decoder()],["minSigners",getU8Decoder()],["maxSigners",getU8Decoder()],["minReputationScore",getU16Decoder()],["requiresTokenHoldings",getBooleanDecoder()],["minTokenBalance",getU64Decoder()]])}function p6(){return combineCodec(Go(),Wo())}var yP=a(()=>{m();});function Ze(){return getStructEncoder([["maxSigners",getU8Encoder()],["defaultTimeout",getI64Encoder()],["allowEmergencyOverride",getBooleanEncoder()],["emergencyThreshold",getOptionEncoder(getU8Encoder())],["autoExecute",getBooleanEncoder()],["signerChangeThreshold",getU8Encoder()],["allowedTransactionTypes",getArrayEncoder(de())]])}function Ye(){return getStructDecoder([["maxSigners",getU8Decoder()],["defaultTimeout",getI64Decoder()],["allowEmergencyOverride",getBooleanDecoder()],["emergencyThreshold",getOptionDecoder(getU8Decoder())],["autoExecute",getBooleanDecoder()],["signerChangeThreshold",getU8Decoder()],["allowedTransactionTypes",getArrayDecoder(ue())]])}function E6(){return combineCodec(Ze(),Ye())}var SP=a(()=>{m();});function No(){return getStructEncoder([["firewallRequired",getBooleanEncoder()],["intrusionDetection",getBooleanEncoder()],["trafficMonitoring",getBooleanEncoder()]])}function Bo(){return getStructDecoder([["firewallRequired",getBooleanDecoder()],["intrusionDetection",getBooleanDecoder()],["trafficMonitoring",getBooleanDecoder()]])}function b6(){return combineCodec(No(),Bo())}var xP=a(()=>{});function Lo(){return getEnumEncoder(Vo)}function Ko(){return getEnumDecoder(Vo)}function k6(){return combineCodec(Lo(),Ko())}var Vo,DP=a(()=>{Vo=(i=>(i[i.OnChain=0]="OnChain",i[i.Email=1]="Email",i[i.Sms=2]="Sms",i[i.Push=3]="Push",i[i.InApp=4]="InApp",i[i.All=5]="All",i))(Vo||{});});function jo(){return getEnumEncoder(Ho)}function $o(){return getEnumDecoder(Ho)}function z6(){return combineCodec(jo(),$o())}var Ho,PP=a(()=>{Ho=(c=>(c[c.Low=0]="Low",c[c.Medium=1]="Medium",c[c.High=2]="High",c[c.Critical=3]="Critical",c[c.Emergency=4]="Emergency",c))(Ho||{});});function Me(){return getStructEncoder([["eventType",Zo()],["targets",getArrayEncoder(qo())],["method",Lo()],["timing",Qo()]])}function ke(){return getStructDecoder([["eventType",Yo()],["targets",getArrayDecoder(Jo())],["method",Ko()],["timing",Xo()]])}function B6(){return combineCodec(Me(),ke())}var EP=a(()=>{m();});function qo(){return getStructEncoder([["targetType",ei()],["targetId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["priority",jo()]])}function Jo(){return getStructDecoder([["targetType",ti()],["targetId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["priority",$o()]])}function X6(){return combineCodec(qo(),Jo())}var hP=a(()=>{m();});function ei(){return getEnumEncoder(ni)}function ti(){return getEnumDecoder(ni)}function tB(){return combineCodec(ei(),ti())}var ni,CP=a(()=>{ni=(d=>(d[d.User=0]="User",d[d.Administrator=1]="Administrator",d[d.SecurityTeam=2]="SecurityTeam",d[d.ComplianceTeam=3]="ComplianceTeam",d[d.Manager=4]="Manager",d[d.AuditTeam=5]="AuditTeam",d[d.ExternalSystem=6]="ExternalSystem",d))(ni||{});});function Qo(){return getEnumEncoder(ri)}function Xo(){return getEnumDecoder(ri)}function iB(){return combineCodec(Qo(),Xo())}var ri,RP=a(()=>{ri=(r=>(r[r.Immediate=0]="Immediate",r[r.Delayed=1]="Delayed",r[r.Batched=2]="Batched",r[r.Scheduled=3]="Scheduled",r))(ri||{});});function oi(){return getStructEncoder([["minimumLength",getU8Encoder()],["complexityRequirements",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["historyCount",getU8Encoder()],["maxAge",getI64Encoder()]])}function ii(){return getStructDecoder([["minimumLength",getU8Decoder()],["complexityRequirements",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["historyCount",getU8Decoder()],["maxAge",getI64Decoder()]])}function SB(){return combineCodec(oi(),ii())}var vP=a(()=>{});function ci(){return getStructEncoder([["transactionId",getU64Encoder()],["transactionType",de()],["target",getAddressEncoder()],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["requiredSignatures",getU8Encoder()],["signatures",getArrayEncoder(zo())],["createdAt",getI64Encoder()],["expiresAt",getI64Encoder()],["priority",ui()],["executionConditions",getArrayEncoder(ge())],["status",Ai()],["timeLock",getOptionEncoder(ai())]])}function si(){return getStructDecoder([["transactionId",getU64Decoder()],["transactionType",ue()],["target",getAddressDecoder()],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["requiredSignatures",getU8Decoder()],["signatures",getArrayDecoder(Oo())],["createdAt",getI64Decoder()],["expiresAt",getI64Decoder()],["priority",gi()],["executionConditions",getArrayDecoder(Ae())],["status",pi()],["timeLock",getOptionDecoder(di())]])}function FB(){return combineCodec(ci(),si())}var _P=a(()=>{m();});function xi(){return getStructEncoder([["permissionId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["resourceType",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["actions",getArrayEncoder(zn())],["scope",Ri()],["constraints",getArrayEncoder(Pi())],["metadata",hi()]])}function Di(){return getStructDecoder([["permissionId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["resourceType",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["actions",getArrayDecoder(On())],["scope",bi()],["constraints",getArrayDecoder(Ei())],["metadata",Ci()]])}function BB(){return combineCodec(xi(),Di())}var FP=a(()=>{m();});function Pi(){return getStructEncoder([["constraintType",Ii()],["conditions",getArrayEncoder(Gr())],["enforcement",je()]])}function Ei(){return getStructDecoder([["constraintType",vi()],["conditions",getArrayDecoder(Wr())],["enforcement",$e()]])}function $B(){return combineCodec(Pi(),Ei())}var GP=a(()=>{m();});function Ii(){return getEnumEncoder(Mi)}function vi(){return getEnumDecoder(Mi)}function XB(){return combineCodec(Ii(),vi())}var Mi,WP=a(()=>{Mi=(i=>(i[i.Temporal=0]="Temporal",i[i.Contextual=1]="Contextual",i[i.Conditional=2]="Conditional",i[i.ResourceBased=3]="ResourceBased",i[i.AttributeBased=4]="AttributeBased",i[i.RiskBased=5]="RiskBased",i))(Mi||{});});function hi(){return getStructEncoder([["businessJustification",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["riskAssessment",ki()],["complianceMapping",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["relatedPermissions",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["owner",getOptionEncoder(getAddressEncoder())],["lastReview",getOptionEncoder(getI64Encoder())],["reviewFrequency",getI64Encoder()]])}function Ci(){return getStructDecoder([["businessJustification",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["riskAssessment",wi()],["complianceMapping",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["relatedPermissions",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["owner",getOptionDecoder(getAddressDecoder())],["lastReview",getOptionDecoder(getI64Decoder())],["reviewFrequency",getI64Decoder()]])}function r4(){return combineCodec(hi(),Ci())}var jP=a(()=>{m();});function Ri(){return getStructEncoder([["scopeType",zi()],["boundaries",Ui()],["hierarchical",getBooleanEncoder()],["inherited",getBooleanEncoder()]])}function bi(){return getStructDecoder([["scopeType",Oi()],["boundaries",_i()],["hierarchical",getBooleanDecoder()],["inherited",getBooleanDecoder()]])}function s4(){return combineCodec(Ri(),bi())}var JP=a(()=>{m();});function mn(){return getStructEncoder([["author",getOptionEncoder(getAddressEncoder())],["approver",getOptionEncoder(getAddressEncoder())],["approvalDate",getOptionEncoder(getI64Encoder())],["businessJustification",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["complianceReferences",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["riskAssessment",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["reviewSchedule",Wi()]])}function yn(){return getStructDecoder([["author",getOptionDecoder(getAddressDecoder())],["approver",getOptionDecoder(getAddressDecoder())],["approvalDate",getOptionDecoder(getI64Decoder())],["businessJustification",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["complianceReferences",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["riskAssessment",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["reviewSchedule",Ni()]])}function m4(){return combineCodec(mn(),yn())}var ZP=a(()=>{m();});function Tn(){return getStructEncoder([["ruleId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["conditions",getArrayEncoder(Li())],["effect",Bi()],["priority",getU8Encoder()],["enabled",getBooleanEncoder()]])}function fn(){return getStructDecoder([["ruleId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["conditions",getArrayDecoder(Ki())],["effect",Vi()],["priority",getU8Decoder()],["enabled",getBooleanDecoder()]])}function k4(){return combineCodec(Tn(),fn())}var YP=a(()=>{m();});function Sn(){return getStructEncoder([["subjects",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["resources",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["actions",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["inheritance",Hi()]])}function xn(){return getStructDecoder([["subjects",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["resources",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["actions",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["inheritance",ji()]])}function z4(){return combineCodec(Sn(),xn())}var eE=a(()=>{m();});function Dn(){return getEnumEncoder($i)}function Pn(){return getEnumDecoder($i)}function W4(){return combineCodec(Dn(),Pn())}var $i,tE=a(()=>{$i=(i=>(i[i.Active=0]="Active",i[i.Inactive=1]="Inactive",i[i.Draft=2]="Draft",i[i.UnderReview=3]="UnderReview",i[i.Deprecated=4]="Deprecated",i[i.Suspended=5]="Suspended",i))($i||{});});function En(){return getEnumEncoder(qi)}function hn(){return getEnumDecoder(qi)}function L4(){return combineCodec(En(),hn())}var qi,nE=a(()=>{qi=(i=>(i[i.Allow=0]="Allow",i[i.Deny=1]="Deny",i[i.Conditional=2]="Conditional",i[i.Delegated=3]="Delegated",i[i.Temporary=4]="Temporary",i[i.Emergency=5]="Emergency",i))(qi||{});});function J(){return getEnumEncoder(Dt)}function Q(){return getEnumDecoder(Dt)}function $4(){return combineCodec(J(),Q())}var Dt,rE=a(()=>{Dt=(s=>(s[s.Fixed=0]="Fixed",s[s.Hourly=1]="Hourly",s[s.PerTask=2]="PerTask",s[s.Subscription=3]="Subscription",s[s.Auction=4]="Auction",s[s.Dynamic=5]="Dynamic",s[s.RevenueShare=6]="RevenueShare",s[s.Tiered=7]="Tiered",s))(Dt||{});});function Ji(){return getStructEncoder([["pubkey",getAddressEncoder()],["isSigner",getBooleanEncoder()],["isWritable",getBooleanEncoder()],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function Qi(){return getStructDecoder([["pubkey",getAddressDecoder()],["isSigner",getBooleanDecoder()],["isWritable",getBooleanDecoder()],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function iV(){return combineCodec(Ji(),Qi())}var cE=a(()=>{});function mo(){return getStructEncoder([["programId",getAddressEncoder()],["accounts",getArrayEncoder(Ji())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function yo(){return getStructDecoder([["programId",getAddressDecoder()],["accounts",getArrayDecoder(Qi())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function TV(){return combineCodec(mo(),yo())}var gE=a(()=>{m();});function Yi(){return getStructEncoder([["ipfsHash",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["externalReferences",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["tags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["riskAssessment",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["impactAnalysis",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["implementationTimeline",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function ec(){return getStructDecoder([["ipfsHash",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["externalReferences",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["tags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["riskAssessment",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["impactAnalysis",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["implementationTimeline",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function DV(){return combineCodec(Yi(),ec())}var lE=a(()=>{});function nc(){return getEnumEncoder(tc)}function rc(){return getEnumDecoder(tc)}function CV(){return combineCodec(nc(),rc())}var tc,mE=a(()=>{tc=(s=>(s[s.Draft=0]="Draft",s[s.Active=1]="Active",s[s.Passed=2]="Passed",s[s.Failed=3]="Failed",s[s.Executed=4]="Executed",s[s.Cancelled=5]="Cancelled",s[s.Expired=6]="Expired",s[s.Queued=7]="Queued",s))(tc||{});});function se(){return getEnumEncoder(Pt)}function ae(){return getEnumDecoder(Pt)}function vV(){return combineCodec(se(),ae())}var Pt,Hg=a(()=>{Pt=(s=>(s[s.ParameterUpdate=0]="ParameterUpdate",s[s.ProtocolUpgrade=1]="ProtocolUpgrade",s[s.TreasuryOperation=2]="TreasuryOperation",s[s.FeeUpdate=3]="FeeUpdate",s[s.SecurityUpdate=4]="SecurityUpdate",s[s.GovernanceUpdate=5]="GovernanceUpdate",s[s.EmergencyAction=6]="EmergencyAction",s[s.Custom=7]="Custom",s))(Pt||{});});function xE(){return getStructEncoder([["authority",getAddressEncoder()],["feesEnabled",getBooleanEncoder()],["escrowFeeBps",getU16Encoder()],["agentRegistrationFee",getU64Encoder()],["listingFee",getU64Encoder()],["disputeFeeBps",getU16Encoder()],["timestamp",getI64Encoder()]])}function DE(){return getStructDecoder([["authority",getAddressDecoder()],["feesEnabled",getBooleanDecoder()],["escrowFeeBps",getU16Decoder()],["agentRegistrationFee",getU64Decoder()],["listingFee",getU64Decoder()],["disputeFeeBps",getU16Decoder()],["timestamp",getI64Decoder()]])}function WV(){return combineCodec(xE(),DE())}var PE=a(()=>{});function ic(){return getEnumEncoder(oc)}function cc(){return getEnumDecoder(oc)}function LV(){return combineCodec(ic(),cc())}var oc,EE=a(()=>{oc=(r=>(r[r.Absolute=0]="Absolute",r[r.Relative=1]="Relative",r[r.Weighted=2]="Weighted",r[r.Dynamic=3]="Dynamic",r))(oc||{});});function sc(){return getStructEncoder([["minimumParticipation",getU8Encoder()],["approvalThreshold",getU8Encoder()],["superMajorityRequired",getBooleanEncoder()],["minimumVotingPower",getU64Encoder()],["quorumMethod",ic()]])}function ac(){return getStructDecoder([["minimumParticipation",getU8Decoder()],["approvalThreshold",getU8Decoder()],["superMajorityRequired",getBooleanDecoder()],["minimumVotingPower",getU64Decoder()],["quorumMethod",cc()]])}function XV(){return combineCodec(sc(),ac())}var RE=a(()=>{m();});function vE(){return getStructEncoder([["rbacConfig",getAddressEncoder()],["authority",getAddressEncoder()],["rolesCount",getU32Encoder()]])}function ME(){return getStructDecoder([["rbacConfig",getAddressDecoder()],["authority",getAddressDecoder()],["rolesCount",getU32Decoder()]])}function rL(){return combineCodec(vE(),ME())}var kE=a(()=>{});function uc(){return getEnumEncoder(dc)}function gc(){return getEnumDecoder(dc)}function sL(){return combineCodec(uc(),gc())}var dc,wE=a(()=>{dc=(t=>(t[t.Unlocked=0]="Unlocked",t[t.Locked=1]="Locked",t))(dc||{});});function Ac(){return getStructEncoder([["summary",yc()],["entries",getArrayEncoder(lc())],["complianceMetrics",kr()],["riskIndicators",getArrayEncoder(fc())],["recommendations",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function pc(){return getStructDecoder([["summary",Tc()],["entries",getArrayDecoder(mc())],["complianceMetrics",wr()],["riskIndicators",getArrayDecoder(Sc())],["recommendations",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function TL(){return combineCodec(Ac(),pc())}var UE=a(()=>{m();});function lc(){return getStructEncoder([["timestamp",getI64Encoder()],["eventId",getUtf8Encoder()],["entryType",getUtf8Encoder()],["amount",getOptionEncoder(getU64Encoder())],["parties",getArrayEncoder(getAddressEncoder())]])}function mc(){return getStructDecoder([["timestamp",getI64Decoder()],["eventId",getUtf8Decoder()],["entryType",getUtf8Decoder()],["amount",getOptionDecoder(getU64Decoder())],["parties",getArrayDecoder(getAddressDecoder())]])}function kL(){return combineCodec(lc(),mc())}var OE=a(()=>{});function Zn(){return getEnumEncoder(xc)}function Yn(){return getEnumDecoder(xc)}function zL(){return combineCodec(Zn(),Yn())}var xc,FE=a(()=>{xc=(i=>(i[i.Daily=0]="Daily",i[i.Weekly=1]="Weekly",i[i.Monthly=2]="Monthly",i[i.Quarterly=3]="Quarterly",i[i.Annually=4]="Annually",i[i.OnDemand=5]="OnDemand",i))(xc||{});});function Pc(){return getEnumEncoder(Dc)}function Ec(){return getEnumDecoder(Dc)}function WL(){return combineCodec(Pc(),Ec())}var Dc,GE=a(()=>{Dc=(d=>(d[d.Draft=0]="Draft",d[d.Generated=1]="Generated",d[d.Reviewed=2]="Reviewed",d[d.Approved=3]="Approved",d[d.Submitted=4]="Submitted",d[d.Acknowledged=5]="Acknowledged",d[d.Rejected=6]="Rejected",d))(Dc||{});});function yc(){return getStructEncoder([["totalTransactions",getU64Encoder()],["totalVolume",getU64Encoder()],["highRiskTransactions",getU64Encoder()],["complianceViolations",getU64Encoder()],["securityIncidents",getU64Encoder()],["averageRiskScore",getU8Encoder()]])}function Tc(){return getStructDecoder([["totalTransactions",getU64Decoder()],["totalVolume",getU64Decoder()],["highRiskTransactions",getU64Decoder()],["complianceViolations",getU64Decoder()],["securityIncidents",getU64Decoder()],["averageRiskScore",getU8Decoder()]])}function HL(){return combineCodec(yc(),Tc())}var WE=a(()=>{});function ie(){return getEnumEncoder(hc)}function ce(){return getEnumDecoder(hc)}function JL(){return combineCodec(ie(),ce())}var hc,NE=a(()=>{hc=(s=>(s[s.FinancialTransactions=0]="FinancialTransactions",s[s.SuspiciousActivity=1]="SuspiciousActivity",s[s.RegulatoryCompliance=2]="RegulatoryCompliance",s[s.SecurityIncidents=3]="SecurityIncidents",s[s.AuditSummary=4]="AuditSummary",s[s.RiskAssessment=5]="RiskAssessment",s[s.GovernanceActivity=6]="GovernanceActivity",s[s.DataPrivacyCompliance=7]="DataPrivacyCompliance",s))(hc||{});});function vc(){return getStructEncoder([["allowedResourceTypes",getArrayEncoder(getUtf8Encoder())],["blockedResourceTypes",getArrayEncoder(getUtf8Encoder())],["accessLimits",getArrayEncoder(getStructEncoder([["0",getUtf8Encoder()],["1",getU64Encoder()]]))],["compartments",getArrayEncoder(getUtf8Encoder())]])}function Mc(){return getStructDecoder([["allowedResourceTypes",getArrayDecoder(getUtf8Decoder())],["blockedResourceTypes",getArrayDecoder(getUtf8Decoder())],["accessLimits",getArrayDecoder(getStructDecoder([["0",getUtf8Decoder()],["1",getU64Decoder()]]))],["compartments",getArrayDecoder(getUtf8Decoder())]])}function YL(){return combineCodec(vc(),Mc())}var LE=a(()=>{});function KE(){return getStructEncoder([["agent",getAddressEncoder()],["timestamp",getI64Encoder()]])}function HE(){return getStructDecoder([["agent",getAddressDecoder()],["timestamp",getI64Decoder()]])}function s5(){return combineCodec(KE(),HE())}var jE=a(()=>{});function $E(){return getStructEncoder([["agent",getAddressEncoder()],["paymentSignature",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["amount",getU64Encoder()],["responseTimeMs",getU64Encoder()],["success",getBooleanEncoder()],["newReputationScore",getU64Encoder()],["timestamp",getI64Encoder()]])}function qE(){return getStructDecoder([["agent",getAddressDecoder()],["paymentSignature",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["amount",getU64Decoder()],["responseTimeMs",getU64Decoder()],["success",getBooleanDecoder()],["newReputationScore",getU64Decoder()],["timestamp",getI64Decoder()]])}function E5(){return combineCodec($E(),qE())}var JE=a(()=>{});function ZE(){return getStructEncoder([["agent",getAddressEncoder()],["client",getAddressEncoder()],["rating",getU8Encoder()],["newReputationScore",getU64Encoder()],["timestamp",getI64Encoder()]])}function YE(){return getStructDecoder([["agent",getAddressDecoder()],["client",getAddressDecoder()],["rating",getU8Decoder()],["newReputationScore",getU64Decoder()],["timestamp",getI64Decoder()]])}function U5(){return combineCodec(ZE(),YE())}var eh=a(()=>{});function th(){return getStructEncoder([["agent",getAddressEncoder()],["totalTags",getU32Encoder()],["skillTagsCount",getU32Encoder()],["behaviorTagsCount",getU32Encoder()],["complianceTagsCount",getU32Encoder()],["tagScoresCount",getU32Encoder()],["timestamp",getI64Encoder()]])}function nh(){return getStructDecoder([["agent",getAddressDecoder()],["totalTags",getU32Decoder()],["skillTagsCount",getU32Decoder()],["behaviorTagsCount",getU32Decoder()],["complianceTagsCount",getU32Decoder()],["tagScoresCount",getU32Decoder()],["timestamp",getI64Decoder()]])}function B5(){return combineCodec(th(),nh())}var rh=a(()=>{});function Wi(){return getStructEncoder([["frequency",getI64Encoder()],["lastReview",getOptionEncoder(getI64Encoder())],["nextReview",getI64Encoder()],["reviewOwners",getArrayEncoder(getAddressEncoder())],["reviewCriteria",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function Ni(){return getStructDecoder([["frequency",getI64Decoder()],["lastReview",getOptionDecoder(getI64Decoder())],["nextReview",getI64Decoder()],["reviewOwners",getArrayDecoder(getAddressDecoder())],["reviewCriteria",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function t3(){return combineCodec(Wi(),Ni())}var ch=a(()=>{});function Uc(){return getStructEncoder([["accepted",getBooleanEncoder()],["acceptingAuthority",getOptionEncoder(getAddressEncoder())],["acceptanceDate",getOptionEncoder(getI64Encoder())],["reasoning",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["reviewDate",getOptionEncoder(getI64Encoder())]])}function _c(){return getStructDecoder([["accepted",getBooleanDecoder()],["acceptingAuthority",getOptionDecoder(getAddressDecoder())],["acceptanceDate",getOptionDecoder(getI64Decoder())],["reasoning",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["reviewDate",getOptionDecoder(getI64Decoder())]])}function m3(){return combineCodec(Uc(),_c())}var dh=a(()=>{});function ki(){return getStructEncoder([["riskScore",getU8Encoder()],["riskFactors",getArrayEncoder(zc())],["mitigationMeasures",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["riskAcceptance",Uc()]])}function wi(){return getStructDecoder([["riskScore",getU8Decoder()],["riskFactors",getArrayDecoder(Oc())],["mitigationMeasures",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["riskAcceptance",_c()]])}function b3(){return combineCodec(ki(),wi())}var Ah=a(()=>{m();});function Gc(){return getEnumEncoder(Fc)}function Wc(){return getEnumDecoder(Fc)}function k3(){return combineCodec(Gc(),Wc())}var Fc,ph=a(()=>{Fc=(d=>(d[d.Operational=0]="Operational",d[d.Financial=1]="Financial",d[d.Compliance=2]="Compliance",d[d.Security=3]="Security",d[d.Reputational=4]="Reputational",d[d.Technical=5]="Technical",d[d.Legal=6]="Legal",d))(Fc||{});});function zc(){return getStructEncoder([["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["category",Gc()],["impact",getU8Encoder()],["likelihood",getU8Encoder()],["riskScore",getU8Encoder()]])}function Oc(){return getStructDecoder([["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["category",Wc()],["impact",getU8Decoder()],["likelihood",getU8Decoder()],["riskScore",getU8Decoder()]])}function B3(){return combineCodec(zc(),Oc())}var lh=a(()=>{m();});function fc(){return getStructEncoder([["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["currentValue",getU64Encoder()],["thresholdValue",getU64Encoder()],["trend",Nc()],["severity",Vc()],["recommendedActions",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function Sc(){return getStructDecoder([["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["currentValue",getU64Decoder()],["thresholdValue",getU64Decoder()],["trend",Bc()],["severity",Lc()],["recommendedActions",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function $3(){return combineCodec(fc(),Sc())}var Eh=a(()=>{m();});function Hc(){return getEnumEncoder(Kc)}function jc(){return getEnumDecoder(Kc)}function X3(){return combineCodec(Hc(),jc())}var Kc,hh=a(()=>{Kc=(r=>(r[r.Low=0]="Low",r[r.Medium=1]="Medium",r[r.High=2]="High",r[r.Critical=3]="Critical",r))(Kc||{});});function ct(){return getStructEncoder([["roleId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["roleType",Yc()],["permissions",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["constraints",$c()],["inheritsFrom",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["metadata",Jc()],["status",Xc()],["createdAt",getI64Encoder()],["modifiedAt",getI64Encoder()]])}function st(){return getStructDecoder([["roleId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["roleType",es()],["permissions",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["constraints",qc()],["inheritsFrom",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["metadata",Qc()],["status",Zc()],["createdAt",getI64Decoder()],["modifiedAt",getI64Decoder()]])}function t9(){return combineCodec(ct(),st())}var vh=a(()=>{m();});function $c(){return getStructEncoder([["timeConstraints",getOptionEncoder(is())],["locationConstraints",getOptionEncoder(Uo())],["resourceConstraints",getOptionEncoder(vc())],["sessionConstraints",getOptionEncoder(ts())],["sodConstraints",getArrayEncoder(rs())],["maxConcurrentSessions",getOptionEncoder(getU32Encoder())],["activationRequirements",getArrayEncoder(Mn())]])}function qc(){return getStructDecoder([["timeConstraints",getOptionDecoder(cs())],["locationConstraints",getOptionDecoder(_o())],["resourceConstraints",getOptionDecoder(Mc())],["sessionConstraints",getOptionDecoder(ns())],["sodConstraints",getArrayDecoder(os())],["maxConcurrentSessions",getOptionDecoder(getU32Decoder())],["activationRequirements",getArrayDecoder(kn())]])}function s9(){return combineCodec($c(),qc())}var wh=a(()=>{m();});function Jc(){return getStructEncoder([["businessPurpose",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["riskLevel",Hc()],["dataAccessLevel",Xr()],["complianceRequirements",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["roleOwner",getOptionEncoder(getAddressEncoder())],["roleCustodian",getOptionEncoder(getAddressEncoder())],["reviewFrequency",getI64Encoder()],["lastReview",getOptionEncoder(getI64Encoder())],["nextReview",getOptionEncoder(getI64Encoder())]])}function Qc(){return getStructDecoder([["businessPurpose",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["riskLevel",jc()],["dataAccessLevel",Zr()],["complianceRequirements",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["roleOwner",getOptionDecoder(getAddressDecoder())],["roleCustodian",getOptionDecoder(getAddressDecoder())],["reviewFrequency",getI64Decoder()],["lastReview",getOptionDecoder(getI64Decoder())],["nextReview",getOptionDecoder(getI64Decoder())]])}function p9(){return combineCodec(Jc(),Qc())}var Bh=a(()=>{m();});function Xc(){return getEnumEncoder(ds)}function Zc(){return getEnumDecoder(ds)}function T9(){return combineCodec(Xc(),Zc())}var ds,Vh=a(()=>{ds=(c=>(c[c.Active=0]="Active",c[c.Inactive=1]="Inactive",c[c.Deprecated=2]="Deprecated",c[c.UnderReview=3]="UnderReview",c[c.Suspended=4]="Suspended",c))(ds||{});});function Yc(){return getEnumEncoder(us)}function es(){return getEnumDecoder(us)}function D9(){return combineCodec(Yc(),es())}var us,Lh=a(()=>{us=(s=>(s[s.Administrative=0]="Administrative",s[s.Operational=1]="Operational",s[s.ReadOnly=2]="ReadOnly",s[s.Compliance=3]="Compliance",s[s.Emergency=4]="Emergency",s[s.Custom=5]="Custom",s[s.Service=6]="Service",s[s.Guest=7]="Guest",s))(us||{});});function Bi(){return getEnumEncoder(gs)}function Vi(){return getEnumDecoder(gs)}function C9(){return combineCodec(Bi(),Vi())}var gs,Kh=a(()=>{gs=(i=>(i[i.Allow=0]="Allow",i[i.Deny=1]="Deny",i[i.AuditOnly=2]="AuditOnly",i[i.RequireApproval=3]="RequireApproval",i[i.RequireMfa=4]="RequireMfa",i[i.RequireJustification=5]="RequireJustification",i))(gs||{});});function Li(){return getStructEncoder([["conditionType",Ne()],["subjectAttributes",getArrayEncoder(ls)],["resourceAttributes",getArrayEncoder(ls)],["actionAttributes",getArrayEncoder(ls)],["environmentAttributes",getArrayEncoder(ls)]])}function Ki(){return getStructDecoder([["conditionType",Be()],["subjectAttributes",getArrayDecoder(ms)],["resourceAttributes",getArrayDecoder(ms)],["actionAttributes",getArrayDecoder(ms)],["environmentAttributes",getArrayDecoder(ms)]])}function b9(){return combineCodec(Li(),Ki())}var ls,ms,Jh=a(()=>{m();ls=getStructEncoder([["0",getUtf8Encoder()],["1",getUtf8Encoder()]]),ms=getStructDecoder([["0",getUtf8Decoder()],["1",getUtf8Decoder()]]);});function Ui(){return getStructEncoder([["includedResources",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["excludedResources",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["resourcePatterns",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["hierarchicalBoundaries",getArrayEncoder(Eo())]])}function _i(){return getStructDecoder([["includedResources",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["excludedResources",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["resourcePatterns",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["hierarchicalBoundaries",getArrayDecoder(ho())]])}function k9(){return combineCodec(Ui(),_i())}var Qh=a(()=>{m();});function Hi(){return getEnumEncoder(fs)}function ji(){return getEnumDecoder(fs)}function z9(){return combineCodec(Hi(),ji())}var fs,Xh=a(()=>{fs=(r=>(r[r.None=0]="None",r[r.Hierarchical=1]="Hierarchical",r[r.Delegated=2]="Delegated",r[r.Inherited=3]="Inherited",r))(fs||{});});function zi(){return getEnumEncoder(Ss)}function Oi(){return getEnumDecoder(Ss)}function W9(){return combineCodec(zi(),Oi())}var Ss,Zh=a(()=>{Ss=(i=>(i[i.Global=0]="Global",i[i.Organization=1]="Organization",i[i.Department=2]="Department",i[i.Project=3]="Project",i[i.Resource=4]="Resource",i[i.Individual=5]="Individual",i))(Ss||{});});function Zo(){return getEnumEncoder(xs)}function Yo(){return getEnumDecoder(xs)}function L9(){return combineCodec(Zo(),Yo())}var xs,Yh=a(()=>{xs=(s=>(s[s.AccountLockout=0]="AccountLockout",s[s.PasswordChange=1]="PasswordChange",s[s.PrivilegeEscalation=2]="PrivilegeEscalation",s[s.SuspiciousActivity=3]="SuspiciousActivity",s[s.PolicyViolation=4]="PolicyViolation",s[s.AccessDenied=5]="AccessDenied",s[s.DataBreach=6]="DataBreach",s[s.SystemCompromise=7]="SystemCompromise",s))(xs||{});});function Ds(){return getStructEncoder([["authentication",Ar()],["authorization",xr()],["password",oi()],["session",Es()],["dataProtection",Yr()],["networkSecurity",No()],["incidentResponse",Co()],["compliance",Ur()]])}function Ps(){return getStructDecoder([["authentication",pr()],["authorization",Dr()],["password",ii()],["session",hs()],["dataProtection",eo()],["networkSecurity",Bo()],["incidentResponse",Ro()],["compliance",_r()]])}function $9(){return combineCodec(Ds(),Ps())}var eC=a(()=>{m();});function me(){return getStructEncoder([["id",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["serviceType",Cs()],["serviceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function ye(){return getStructDecoder([["id",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["serviceType",Rs()],["serviceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function X9(){return combineCodec(me(),ye())}var tC=a(()=>{m();});function Cs(){return getEnumEncoder(bs)}function Rs(){return getEnumDecoder(bs)}function tK(){return combineCodec(Cs(),Rs())}var bs,nC=a(()=>{bs=(c=>(c[c.AIAgentService=0]="AIAgentService",c[c.DIDCommMessaging=1]="DIDCommMessaging",c[c.CredentialRepository=2]="CredentialRepository",c[c.LinkedDomains=3]="LinkedDomains",c[c.Custom=4]="Custom",c))(bs||{});});function ts(){return getStructEncoder([["maxSessionDuration",getI64Encoder()],["idleTimeout",getI64Encoder()],["reauthInterval",getI64Encoder()],["mfaRequired",getBooleanEncoder()],["deviceFingerprinting",getBooleanEncoder()],["sessionEncryption",getBooleanEncoder()]])}function ns(){return getStructDecoder([["maxSessionDuration",getI64Decoder()],["idleTimeout",getI64Decoder()],["reauthInterval",getI64Decoder()],["mfaRequired",getBooleanDecoder()],["deviceFingerprinting",getBooleanDecoder()],["sessionEncryption",getBooleanDecoder()]])}function iK(){return combineCodec(ts(),ns())}var rC=a(()=>{});function Es(){return getStructEncoder([["maxSessionDuration",getI64Encoder()],["idleTimeout",getI64Encoder()],["concurrentSessions",getU8Encoder()]])}function hs(){return getStructDecoder([["maxSessionDuration",getI64Decoder()],["idleTimeout",getI64Decoder()],["concurrentSessions",getU8Decoder()]])}function gK(){return combineCodec(Es(),hs())}var cC=a(()=>{});function Qe(){return getEnumEncoder(Is)}function Xe(){return getEnumDecoder(Is)}function mK(){return combineCodec(Qe(),Xe())}var Is,sC=a(()=>{Is=(o=>(o[o.Fraud=0]="Fraud",o[o.DisputeLoss=1]="DisputeLoss",o[o.Custom=2]="Custom",o))(Is||{});});function rs(){return getStructEncoder([["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["conflictingRoles",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["constraintType",vs()],["enforcementLevel",je()],["exceptionProcedures",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function os(){return getStructDecoder([["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["conflictingRoles",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["constraintType",Ms()],["enforcementLevel",$e()],["exceptionProcedures",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function SK(){return combineCodec(rs(),os())}var uC=a(()=>{m();});function vs(){return getEnumEncoder(ks)}function Ms(){return getEnumDecoder(ks)}function EK(){return combineCodec(vs(),Ms())}var ks,gC=a(()=>{ks=(r=>(r[r.Static=0]="Static",r[r.Dynamic=1]="Dynamic",r[r.Temporal=2]="Temporal",r[r.Contextual=3]="Contextual",r))(ks||{});});function lC(){return getStructEncoder([["agent",getAddressEncoder()],["sourceName",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["sourceScore",getU16Encoder()],["weightedAggregateScore",getU64Encoder()],["hasConflict",getBooleanEncoder()],["totalSources",getU32Encoder()],["timestamp",getI64Encoder()]])}function mC(){return getStructDecoder([["agent",getAddressDecoder()],["sourceName",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["sourceScore",getU16Decoder()],["weightedAggregateScore",getU64Decoder()],["hasConflict",getBooleanDecoder()],["totalSources",getU32Decoder()],["timestamp",getI64Decoder()]])}function BK(){return combineCodec(lC(),mC())}var yC=a(()=>{});function ws(){return getStructEncoder([["sourceName",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["score",getU16Encoder()],["weight",getU16Encoder()],["dataPoints",getU32Encoder()],["reliability",getU16Encoder()],["lastUpdated",getI64Encoder()]])}function Us(){return getStructDecoder([["sourceName",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["score",getU16Decoder()],["weight",getU16Decoder()],["dataPoints",getU32Decoder()],["reliability",getU16Decoder()],["lastUpdated",getI64Decoder()]])}function XK(){return combineCodec(ws(),Us())}var SC=a(()=>{});function fr(){return getEnumEncoder(_s)}function Sr(){return getEnumDecoder(_s)}function tH(){return combineCodec(fr(),Sr())}var _s,xC=a(()=>{_s=(d=>(d[d.HighRiskAction=0]="HighRiskAction",d[d.SensitiveData=1]="SensitiveData",d[d.LargeTransaction=2]="LargeTransaction",d[d.NewDevice=3]="NewDevice",d[d.UnusualLocation=4]="UnusualLocation",d[d.TimeBasedRisk=5]="TimeBasedRisk",d[d.BehaviorAnomaly=6]="BehaviorAnomaly",d))(_s||{});});function zs(){return getStructEncoder([["submittedAt",getI64Encoder()],["regulatoryBody",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["submissionReference",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["acknowledged",getBooleanEncoder()],["acknowledgedAt",getOptionEncoder(getI64Encoder())],["regulatoryResponse",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function Os(){return getStructDecoder([["submittedAt",getI64Decoder()],["regulatoryBody",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["submissionReference",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["acknowledged",getBooleanDecoder()],["acknowledgedAt",getOptionDecoder(getI64Decoder())],["regulatoryResponse",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function sH(){return combineCodec(zs(),Os())}var CC=a(()=>{});function IC(){return getStructEncoder([["agent",getAddressEncoder()],["tagsRemoved",getU32Encoder()],["remainingTags",getU32Encoder()],["timestamp",getI64Encoder()]])}function vC(){return getStructDecoder([["agent",getAddressDecoder()],["tagsRemoved",getU32Decoder()],["remainingTags",getU32Decoder()],["timestamp",getI64Decoder()]])}function mH(){return combineCodec(IC(),vC())}var MC=a(()=>{});function at(){return getStructEncoder([["tagName",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["confidence",getU16Encoder()],["evidenceCount",getU32Encoder()],["lastUpdated",getI64Encoder()]])}function dt(){return getStructDecoder([["tagName",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["confidence",getU16Decoder()],["evidenceCount",getU32Decoder()],["lastUpdated",getI64Decoder()]])}function bH(){return combineCodec(at(),dt())}var UC=a(()=>{});function OC(){return getStructEncoder([["agent",getAddressEncoder()],["oldTier",V()],["newTier",V()],["totalStaked",getU64Encoder()],["dailyApiCalls",getU32Encoder()],["votingPower",getU64Encoder()]])}function FC(){return getStructDecoder([["agent",getAddressDecoder()],["oldTier",L()],["newTier",L()],["totalStaked",getU64Decoder()],["dailyApiCalls",getU32Decoder()],["votingPower",getU64Decoder()]])}function zH(){return combineCodec(OC(),FC())}var GC=a(()=>{m();});function is(){return getStructEncoder([["allowedHours",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["allowedDays",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["timezone",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["maxSessionDuration",getOptionEncoder(getI64Encoder())],["expiresAt",getOptionEncoder(getI64Encoder())],["reactivationPeriod",getOptionEncoder(getI64Encoder())]])}function cs(){return getStructDecoder([["allowedHours",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["allowedDays",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["timezone",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["maxSessionDuration",getOptionDecoder(getI64Decoder())],["expiresAt",getOptionDecoder(getI64Decoder())],["reactivationPeriod",getOptionDecoder(getI64Decoder())]])}function BH(){return combineCodec(is(),cs())}var BC=a(()=>{});function ai(){return getStructEncoder([["duration",getI64Encoder()],["lockedAt",getI64Encoder()],["unlocksAt",getI64Encoder()],["earlyUnlockConditions",getArrayEncoder(ge())],["lockType",Fs()],["cancellable",getBooleanEncoder()]])}function di(){return getStructDecoder([["duration",getI64Decoder()],["lockedAt",getI64Decoder()],["unlocksAt",getI64Decoder()],["earlyUnlockConditions",getArrayDecoder(Ae())],["lockType",Gs()],["cancellable",getBooleanDecoder()]])}function JH(){return combineCodec(ai(),di())}var VC=a(()=>{m();});function Fs(){return getEnumEncoder(Ws)}function Gs(){return getEnumDecoder(Ws)}function YH(){return combineCodec(Fs(),Gs())}var Ws,LC=a(()=>{Ws=(r=>(r[r.Standard=0]="Standard",r[r.Vesting=1]="Vesting",r[r.Emergency=2]="Emergency",r[r.Governance=3]="Governance",r))(Ws||{});});function ui(){return getEnumEncoder(Ns)}function gi(){return getEnumDecoder(Ns)}function r7(){return combineCodec(ui(),gi())}var Ns,KC=a(()=>{Ns=(c=>(c[c.Low=0]="Low",c[c.Normal=1]="Normal",c[c.High=2]="High",c[c.Critical=3]="Critical",c[c.Emergency=4]="Emergency",c))(Ns||{});});function Ai(){return getEnumEncoder(Bs)}function pi(){return getEnumDecoder(Bs)}function s7(){return combineCodec(Ai(),pi())}var Bs,HC=a(()=>{Bs=(d=>(d[d.Pending=0]="Pending",d[d.PartiallyApproved=1]="PartiallyApproved",d[d.FullyApproved=2]="FullyApproved",d[d.Executed=3]="Executed",d[d.Cancelled=4]="Cancelled",d[d.Expired=5]="Expired",d[d.Failed=6]="Failed",d))(Bs||{});});function de(){return getEnumEncoder(Vs)}function ue(){return getEnumDecoder(Vs)}function g7(){return combineCodec(de(),ue())}var Vs,jC=a(()=>{Vs=(b=>(b[b.Transfer=0]="Transfer",b[b.Withdrawal=1]="Withdrawal",b[b.EscrowRelease=2]="EscrowRelease",b[b.ProposalCreation=3]="ProposalCreation",b[b.VoteExecution=4]="VoteExecution",b[b.ParameterUpdate=5]="ParameterUpdate",b[b.SignerAddition=6]="SignerAddition",b[b.SignerRemoval=7]="SignerRemoval",b[b.ThresholdUpdate=8]="ThresholdUpdate",b[b.ConfigUpdate=9]="ConfigUpdate",b[b.EmergencyFreeze=10]="EmergencyFreeze",b[b.EmergencyUnfreeze=11]="EmergencyUnfreeze",b[b.SecurityPolicyUpdate=12]="SecurityPolicyUpdate",b[b.ProtocolUpgrade=13]="ProtocolUpgrade",b[b.FeatureToggle=14]="FeatureToggle",b[b.RiskParameterUpdate=15]="RiskParameterUpdate",b[b.CustomInstruction=16]="CustomInstruction",b))(Vs||{});});function Nc(){return getEnumEncoder(Ls)}function Bc(){return getEnumDecoder(Ls)}function m7(){return combineCodec(Nc(),Bc())}var Ls,$C=a(()=>{Ls=(r=>(r[r.Increasing=0]="Increasing",r[r.Decreasing=1]="Decreasing",r[r.Stable=2]="Stable",r[r.Unknown=3]="Unknown",r))(Ls||{});});function In(){return getEnumEncoder(Ks)}function vn(){return getEnumDecoder(Ks)}function S7(){return combineCodec(In(),vn())}var Ks,qC=a(()=>{Ks=(c=>(c[c.TimeBasedAutoUnlock=0]="TimeBasedAutoUnlock",c[c.AdminUnlock=1]="AdminUnlock",c[c.SelfServiceUnlock=2]="SelfServiceUnlock",c[c.MultiFactorUnlock=3]="MultiFactorUnlock",c[c.SupervisorUnlock=4]="SupervisorUnlock",c))(Ks||{});});function Vr(){return getEnumEncoder(Hs)}function Lr(){return getEnumDecoder(Hs)}function E7(){return combineCodec(Vr(),Lr())}var Hs,JC=a(()=>{Hs=(s=>(s[s.String=0]="String",s[s.Number=1]="Number",s[s.Boolean=2]="Boolean",s[s.Date=3]="Date",s[s.Time=4]="Time",s[s.Duration=5]="Duration",s[s.List=6]="List",s[s.Object=7]="Object",s))(Hs||{});});function Te(){return getStructEncoder([["id",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["methodType",js()],["controller",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["publicKeyMultibase",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["relationships",getArrayEncoder(qs())],["createdAt",getI64Encoder()],["revoked",getBooleanEncoder()]])}function fe(){return getStructDecoder([["id",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["methodType",$s()],["controller",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["publicKeyMultibase",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["relationships",getArrayDecoder(Js())],["createdAt",getI64Decoder()],["revoked",getBooleanDecoder()]])}function U7(){return combineCodec(Te(),fe())}var QC=a(()=>{m();});function js(){return getEnumEncoder(Qs)}function $s(){return getEnumDecoder(Qs)}function F7(){return combineCodec(js(),$s())}var Qs,XC=a(()=>{Qs=(o=>(o[o.Ed25519VerificationKey2020=0]="Ed25519VerificationKey2020",o[o.X25519KeyAgreementKey2020=1]="X25519KeyAgreementKey2020",o[o.EcdsaSecp256k1VerificationKey2019=2]="EcdsaSecp256k1VerificationKey2019",o))(Qs||{});});function qs(){return getEnumEncoder(Xs)}function Js(){return getEnumDecoder(Xs)}function B7(){return combineCodec(qs(),Js())}var Xs,ZC=a(()=>{Xs=(c=>(c[c.Authentication=0]="Authentication",c[c.AssertionMethod=1]="AssertionMethod",c[c.KeyAgreement=2]="KeyAgreement",c[c.CapabilityInvocation=3]="CapabilityInvocation",c[c.CapabilityDelegation=4]="CapabilityDelegation",c))(Xs||{});});function Vc(){return getEnumEncoder(Zs)}function Lc(){return getEnumDecoder(Zs)}function H7(){return combineCodec(Vc(),Lc())}var Zs,YC=a(()=>{Zs=(r=>(r[r.Low=0]="Low",r[r.Medium=1]="Medium",r[r.High=2]="High",r[r.Critical=3]="Critical",r))(Zs||{});});function Ys(){return getStructEncoder([["voter",getAddressEncoder()],["choice",ta()],["votingPower",getU64Encoder()],["votedAt",getI64Encoder()],["reasoning",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["delegationInfo",getOptionEncoder(no())]])}function ea(){return getStructDecoder([["voter",getAddressDecoder()],["choice",na()],["votingPower",getU64Decoder()],["votedAt",getI64Decoder()],["reasoning",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["delegationInfo",getOptionDecoder(ro())]])}function sj(){return combineCodec(Ys(),ea())}var nR=a(()=>{m();});function ta(){return getEnumEncoder(ra)}function na(){return getEnumDecoder(ra)}function gj(){return combineCodec(ta(),na())}var ra,rR=a(()=>{ra=(o=>(o[o.For=0]="For",o[o.Against=1]="Against",o[o.Abstain=2]="Abstain",o))(ra||{});});function ca(){return getStructEncoder([["votesFor",getU64Encoder()],["votesAgainst",getU64Encoder()],["votesAbstain",getU64Encoder()],["totalVotingPower",getU64Encoder()],["participationRate",getU8Encoder()],["individualVotes",getArrayEncoder(Ys())],["weightedVoting",getBooleanEncoder()],["quorumReached",getBooleanEncoder()],["approvalThresholdMet",getBooleanEncoder()]])}function sa(){return getStructDecoder([["votesFor",getU64Decoder()],["votesAgainst",getU64Decoder()],["votesAbstain",getU64Decoder()],["totalVotingPower",getU64Decoder()],["participationRate",getU8Decoder()],["individualVotes",getArrayDecoder(ea())],["weightedVoting",getBooleanDecoder()],["quorumReached",getBooleanDecoder()],["approvalThresholdMet",getBooleanDecoder()]])}function Sj(){return combineCodec(ca(),sa())}var oR=a(()=>{m();});var m=a(()=>{Tf();xf();Df();hf();bf();If();Uf();Of();Gf();Lf();qf();tS();cS();sS();aS();dS();uS();gS();lS();TS();PS();CS();RS();bS();IS();kS();_S();zS();OS();WS();NS();BS();qS();JS();QS();XS();ex();ix();lx();mx();Px();Ex();hx();Cx();Rx();bx();Ix();vx();wx();Ux();Ox();Wx();Vx();Hx();Zx();Yx();oD();gD();AD();mD();xD();ED();RD();kD();_D();WD();jD();$D();QD();XD();eP();iP();AP();pP();yP();SP();xP();DP();PP();EP();hP();CP();RP();vP();_P();FP();GP();WP();jP();JP();ZP();YP();eE();tE();nE();rE();cE();gE();lE();mE();Hg();PE();EE();RE();kE();wE();UE();OE();FE();GE();WE();NE();LE();jE();JE();eh();rh();ch();dh();Ah();ph();lh();Eh();hh();vh();wh();Bh();Vh();Lh();Kh();Jh();Qh();Xh();Zh();Yh();eC();tC();nC();rC();cC();sC();uC();gC();yC();SC();xC();CC();MC();UC();GC();BC();VC();LC();KC();HC();jC();$C();qC();JC();QC();XC();ZC();YC();nR();rR();oR();});function kj(){return fixEncoderSize(getBytesEncoder(),8).encode(ZA)}function dR(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["owner",getAddressEncoder()],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["agentType",getU8Encoder()],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["capabilities",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["pricingModel",J()],["reputationScore",getU32Encoder()],["totalJobsCompleted",getU32Encoder()],["totalEarnings",getU64Encoder()],["isActive",getBooleanEncoder()],["createdAt",getI64Encoder()],["updatedAt",getI64Encoder()],["originalPrice",getU64Encoder()],["genomeHash",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["isReplicable",getBooleanEncoder()],["replicationFee",getU64Encoder()],["serviceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["isVerified",getBooleanEncoder()],["verificationTimestamp",getI64Encoder()],["metadataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["frameworkOrigin",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["supportedTokens",getArrayEncoder(getAddressEncoder())],["cnftMint",getOptionEncoder(getAddressEncoder())],["merkleTree",getOptionEncoder(getAddressEncoder())],["supportsA2a",getBooleanEncoder()],["transferHook",getOptionEncoder(getAddressEncoder())],["parentAgent",getOptionEncoder(getAddressEncoder())],["generation",getU32Encoder()],["x402Enabled",getBooleanEncoder()],["x402PaymentAddress",getAddressEncoder()],["x402AcceptedTokens",getArrayEncoder(getAddressEncoder())],["x402PricePerCall",getU64Encoder()],["x402ServiceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["x402TotalPayments",getU64Encoder()],["x402TotalCalls",getU64Encoder()],["lastPaymentTimestamp",getI64Encoder()],["apiSpecUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["apiVersion",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["bump",getU8Encoder()]]),n=>({...n,discriminator:ZA}))}function YA(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["owner",getAddressDecoder()],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["agentType",getU8Decoder()],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["capabilities",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["pricingModel",Q()],["reputationScore",getU32Decoder()],["totalJobsCompleted",getU32Decoder()],["totalEarnings",getU64Decoder()],["isActive",getBooleanDecoder()],["createdAt",getI64Decoder()],["updatedAt",getI64Decoder()],["originalPrice",getU64Decoder()],["genomeHash",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["isReplicable",getBooleanDecoder()],["replicationFee",getU64Decoder()],["serviceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["isVerified",getBooleanDecoder()],["verificationTimestamp",getI64Decoder()],["metadataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["frameworkOrigin",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["supportedTokens",getArrayDecoder(getAddressDecoder())],["cnftMint",getOptionDecoder(getAddressDecoder())],["merkleTree",getOptionDecoder(getAddressDecoder())],["supportsA2a",getBooleanDecoder()],["transferHook",getOptionDecoder(getAddressDecoder())],["parentAgent",getOptionDecoder(getAddressDecoder())],["generation",getU32Decoder()],["x402Enabled",getBooleanDecoder()],["x402PaymentAddress",getAddressDecoder()],["x402AcceptedTokens",getArrayDecoder(getAddressDecoder())],["x402PricePerCall",getU64Decoder()],["x402ServiceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["x402TotalPayments",getU64Decoder()],["x402TotalCalls",getU64Decoder()],["lastPaymentTimestamp",getI64Decoder()],["apiSpecUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["apiVersion",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["bump",getU8Decoder()]])}function wj(){return combineCodec(dR(),YA())}function ep(n){return decodeAccount(n,YA())}async function Uj(n,e,t){let o=await uR(n,e,t);return assertAccountExists(o),o}async function uR(n,e,t){let o=await fetchEncodedAccount(n,e,t);return ep(o)}async function _j(n,e,t){let o=await gR(n,e,t);return assertAccountsExist(o),o}async function gR(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>ep(r))}var ZA,AR=a(()=>{m();ZA=new Uint8Array([47,166,112,147,155,197,86,7]);});function Zj(){return fixEncoderSize(getBytesEncoder(),8).encode(rp)}function ER(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agent",getAddressEncoder()],["authorizedSource",getAddressEncoder()],["indexLimit",getU64Encoder()],["currentIndex",getU64Encoder()],["expiresAt",getI64Encoder()],["network",getU8Encoder()],["signature",fixEncoderSize(getBytesEncoder(),64)],["nonce",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["revoked",getBooleanEncoder()],["createdAt",getI64Encoder()],["lastUsedAt",getOptionEncoder(getI64Encoder())],["totalReputationChange",getI64Encoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:rp}))}function op(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agent",getAddressDecoder()],["authorizedSource",getAddressDecoder()],["indexLimit",getU64Decoder()],["currentIndex",getU64Decoder()],["expiresAt",getI64Decoder()],["network",getU8Decoder()],["signature",fixDecoderSize(getBytesDecoder(),64)],["nonce",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["revoked",getBooleanDecoder()],["createdAt",getI64Decoder()],["lastUsedAt",getOptionDecoder(getI64Decoder())],["totalReputationChange",getI64Decoder()],["bump",getU8Decoder()]])}function Yj(){return combineCodec(ER(),op())}function ip(n){return decodeAccount(n,op())}async function e$(n,e,t){let o=await hR(n,e,t);return assertAccountExists(o),o}async function hR(n,e,t){let o=await fetchEncodedAccount(n,e,t);return ip(o)}async function t$(n,e,t){let o=await CR(n,e,t);return assertAccountsExist(o),o}async function CR(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>ip(r))}var rp,RR=a(()=>{rp=new Uint8Array([30,249,165,44,155,194,188,175]);});function T$(){return fixEncoderSize(getBytesEncoder(),8).encode(cp)}function kR(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["treeCreator",getAddressEncoder()],["treeDelegate",getAddressEncoder()],["numMinted",getU64Encoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:cp}))}function sp(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["treeCreator",getAddressDecoder()],["treeDelegate",getAddressDecoder()],["numMinted",getU64Decoder()],["bump",getU8Decoder()]])}function f$(){return combineCodec(kR(),sp())}function ap(n){return decodeAccount(n,sp())}async function S$(n,e,t){let o=await wR(n,e,t);return assertAccountExists(o),o}async function wR(n,e,t){let o=await fetchEncodedAccount(n,e,t);return ap(o)}async function x$(n,e,t){let o=await UR(n,e,t);return assertAccountsExist(o),o}async function UR(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>ap(r))}function D$(){return 81}var cp,_R=a(()=>{cp=new Uint8Array([145,145,156,0,197,232,130,245]);});function F$(){return fixEncoderSize(getBytesEncoder(),8).encode(dp)}function BR(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agent",getAddressEncoder()],["verifier",getAddressEncoder()],["verificationData",Bn()],["createdAt",getI64Encoder()],["expiresAt",getI64Encoder()],["isActive",getBooleanEncoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:dp}))}function up(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agent",getAddressDecoder()],["verifier",getAddressDecoder()],["verificationData",Vn()],["createdAt",getI64Decoder()],["expiresAt",getI64Decoder()],["isActive",getBooleanDecoder()],["bump",getU8Decoder()]])}function G$(){return combineCodec(BR(),up())}function gp(n){return decodeAccount(n,up())}async function W$(n,e,t){let o=await VR(n,e,t);return assertAccountExists(o),o}async function VR(n,e,t){let o=await fetchEncodedAccount(n,e,t);return gp(o)}async function N$(n,e,t){let o=await LR(n,e,t);return assertAccountsExist(o),o}async function LR(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>gp(r))}var dp,KR=a(()=>{m();dp=new Uint8Array([128,155,95,241,66,207,166,59]);});function nq(){return fixEncoderSize(getBytesEncoder(),8).encode(lp)}function JR(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["trailId",getU64Encoder()],["createdAt",getI64Encoder()],["updatedAt",getI64Encoder()],["version",getU8Encoder()],["entries",getArrayEncoder(nr())],["config",Oe()],["complianceStatus",zr()],["hashChain",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["reserved",fixEncoderSize(getBytesEncoder(),128)]]),n=>({...n,discriminator:lp}))}function mp(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["trailId",getU64Decoder()],["createdAt",getI64Decoder()],["updatedAt",getI64Decoder()],["version",getU8Decoder()],["entries",getArrayDecoder(rr())],["config",Fe()],["complianceStatus",Or()],["hashChain",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["reserved",fixDecoderSize(getBytesDecoder(),128)]])}function rq(){return combineCodec(JR(),mp())}function yp(n){return decodeAccount(n,mp())}async function oq(n,e,t){let o=await QR(n,e,t);return assertAccountExists(o),o}async function QR(n,e,t){let o=await fetchEncodedAccount(n,e,t);return yp(o)}async function iq(n,e,t){let o=await XR(n,e,t);return assertAccountsExist(o),o}async function XR(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>yp(r))}var lp,ZR=a(()=>{m();lp=new Uint8Array([171,223,253,181,134,88,66,26]);});function Eq(){return fixEncoderSize(getBytesEncoder(),8).encode(Sp)}function db(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authorization",getAddressEncoder()],["agent",getAddressEncoder()],["authorizedSource",getAddressEncoder()],["usageIndex",getU64Encoder()],["reputationChange",getI64Encoder()],["usedAt",getI64Encoder()],["transactionSignature",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["metadata",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["bump",getU8Encoder()]]),n=>({...n,discriminator:Sp}))}function xp(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authorization",getAddressDecoder()],["agent",getAddressDecoder()],["authorizedSource",getAddressDecoder()],["usageIndex",getU64Decoder()],["reputationChange",getI64Decoder()],["usedAt",getI64Decoder()],["transactionSignature",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["metadata",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["bump",getU8Decoder()]])}function hq(){return combineCodec(db(),xp())}function Dp(n){return decodeAccount(n,xp())}async function Cq(n,e,t){let o=await ub(n,e,t);return assertAccountExists(o),o}async function ub(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Dp(o)}async function Rq(n,e,t){let o=await gb(n,e,t);return assertAccountsExist(o),o}async function gb(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Dp(r))}var Sp,Ab=a(()=>{Sp=new Uint8Array([109,102,102,17,210,84,85,210]);});function Nq(){return fixEncoderSize(getBytesEncoder(),8).encode(Rp)}function pb(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["reportId",getU64Encoder()],["reportType",ie()],["generatedAt",getI64Encoder()],["periodStart",getI64Encoder()],["periodEnd",getI64Encoder()],["reportData",Ac()],["signature",fixEncoderSize(getBytesEncoder(),64)],["status",Pc()],["submissionDetails",getOptionEncoder(zs())],["reserved",fixEncoderSize(getBytesEncoder(),64)]]),n=>({...n,discriminator:Rp}))}function bp(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["reportId",getU64Decoder()],["reportType",ce()],["generatedAt",getI64Decoder()],["periodStart",getI64Decoder()],["periodEnd",getI64Decoder()],["reportData",pc()],["signature",fixDecoderSize(getBytesDecoder(),64)],["status",Ec()],["submissionDetails",getOptionDecoder(Os())],["reserved",fixDecoderSize(getBytesDecoder(),64)]])}function Bq(){return combineCodec(pb(),bp())}function Ip(n){return decodeAccount(n,bp())}async function Vq(n,e,t){let o=await lb(n,e,t);return assertAccountExists(o),o}async function lb(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Ip(o)}async function Lq(n,e,t){let o=await mb(n,e,t);return assertAccountsExist(o),o}async function mb(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Ip(r))}var Rp,yb=a(()=>{m();Rp=new Uint8Array([75,146,78,26,130,240,228,35]);});function tJ(){return fixEncoderSize(getBytesEncoder(),8).encode(Wp)}function Tb(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["template",getAddressEncoder()],["subject",getAddressEncoder()],["issuer",getAddressEncoder()],["credentialId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["subjectDataHash",fixEncoderSize(getBytesEncoder(),32)],["subjectDataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["status",$r()],["signature",fixEncoderSize(getBytesEncoder(),64)],["issuedAt",getI64Encoder()],["expiresAt",getOptionEncoder(getI64Encoder())],["revokedAt",getOptionEncoder(getI64Encoder())],["crossChainStatus",Ke()],["crossmintCredentialId",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["sourceAccount",getOptionEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),n=>({...n,discriminator:Wp}))}function Np(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["template",getAddressDecoder()],["subject",getAddressDecoder()],["issuer",getAddressDecoder()],["credentialId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["subjectDataHash",fixDecoderSize(getBytesDecoder(),32)],["subjectDataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["status",qr()],["signature",fixDecoderSize(getBytesDecoder(),64)],["issuedAt",getI64Decoder()],["expiresAt",getOptionDecoder(getI64Decoder())],["revokedAt",getOptionDecoder(getI64Decoder())],["crossChainStatus",He()],["crossmintCredentialId",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["sourceAccount",getOptionDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function nJ(){return combineCodec(Tb(),Np())}function Bp(n){return decodeAccount(n,Np())}async function rJ(n,e,t){let o=await fb(n,e,t);return assertAccountExists(o),o}async function fb(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Bp(o)}async function oJ(n,e,t){let o=await Sb(n,e,t);return assertAccountsExist(o),o}async function Sb(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Bp(r))}var Wp,xb=a(()=>{m();Wp=new Uint8Array([145,44,68,220,67,46,100,135]);});function RJ(){return fixEncoderSize(getBytesEncoder(),8).encode(qp)}function Cb(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["credentialType",getAddressEncoder()],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["imageUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["issuer",getAddressEncoder()],["isActive",getBooleanEncoder()],["totalIssued",getU64Encoder()],["createdAt",getI64Encoder()],["crossmintTemplateId",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["bump",getU8Encoder()]]),n=>({...n,discriminator:qp}))}function Jp(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["credentialType",getAddressDecoder()],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["imageUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["issuer",getAddressDecoder()],["isActive",getBooleanDecoder()],["totalIssued",getU64Decoder()],["createdAt",getI64Decoder()],["crossmintTemplateId",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["bump",getU8Decoder()]])}function bJ(){return combineCodec(Cb(),Jp())}function Qp(n){return decodeAccount(n,Jp())}async function IJ(n,e,t){let o=await Rb(n,e,t);return assertAccountExists(o),o}async function Rb(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Qp(o)}async function vJ(n,e,t){let o=await bb(n,e,t);return assertAccountsExist(o),o}async function bb(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Qp(r))}var qp,Ib=a(()=>{qp=new Uint8Array([229,129,99,91,179,207,66,75]);});function XJ(){return fixEncoderSize(getBytesEncoder(),8).encode(rl)}function kb(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["kind",Ve()],["schemaUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["isActive",getBooleanEncoder()],["totalIssued",getU64Encoder()],["createdAt",getI64Encoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:rl}))}function ol(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["kind",Le()],["schemaUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["isActive",getBooleanDecoder()],["totalIssued",getU64Decoder()],["createdAt",getI64Decoder()],["bump",getU8Decoder()]])}function ZJ(){return combineCodec(kb(),ol())}function il(n){return decodeAccount(n,ol())}async function YJ(n,e,t){let o=await wb(n,e,t);return assertAccountExists(o),o}async function wb(n,e,t){let o=await fetchEncodedAccount(n,e,t);return il(o)}async function eQ(n,e,t){let o=await Ub(n,e,t);return assertAccountsExist(o),o}async function Ub(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>il(r))}var rl,_b=a(()=>{m();rl=new Uint8Array([132,171,20,181,39,219,217,112]);});function xQ(){return fixEncoderSize(getBytesEncoder(),8).encode(Al)}function Fb(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["did",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["controller",getAddressEncoder()],["verificationMethods",getArrayEncoder(Te())],["serviceEndpoints",getArrayEncoder(me())],["context",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["alsoKnownAs",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["createdAt",getI64Encoder()],["updatedAt",getI64Encoder()],["version",getU32Encoder()],["deactivated",getBooleanEncoder()],["deactivatedAt",getOptionEncoder(getI64Encoder())],["bump",getU8Encoder()]]),n=>({...n,discriminator:Al}))}function pl(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["did",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["controller",getAddressDecoder()],["verificationMethods",getArrayDecoder(fe())],["serviceEndpoints",getArrayDecoder(ye())],["context",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["alsoKnownAs",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["createdAt",getI64Decoder()],["updatedAt",getI64Decoder()],["version",getU32Decoder()],["deactivated",getBooleanDecoder()],["deactivatedAt",getOptionDecoder(getI64Decoder())],["bump",getU8Decoder()]])}function DQ(){return combineCodec(Fb(),pl())}function ll(n){return decodeAccount(n,pl())}async function PQ(n,e,t){let o=await Gb(n,e,t);return assertAccountExists(o),o}async function Gb(n,e,t){let o=await fetchEncodedAccount(n,e,t);return ll(o)}async function EQ(n,e,t){let o=await Wb(n,e,t);return assertAccountsExist(o),o}async function Wb(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>ll(r))}var Al,Nb=a(()=>{m();Al=new Uint8Array([109,220,168,224,33,173,192,166]);});function FQ(){return fixEncoderSize(getBytesEncoder(),8).encode(Cl)}function Hb(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["escrowId",getU64Encoder()],["client",getAddressEncoder()],["agent",getAddressEncoder()],["amount",getU64Encoder()],["tokenMint",getAddressEncoder()],["status",po()],["jobDescription",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["deliveryProof",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["deadline",getI64Encoder()],["createdAt",getI64Encoder()],["completedAt",getOptionEncoder(getI64Encoder())],["disputeReason",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["arbitratorDecision",getOptionEncoder(re())],["bump",getU8Encoder()]]),n=>({...n,discriminator:Cl}))}function Rl(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["escrowId",getU64Decoder()],["client",getAddressDecoder()],["agent",getAddressDecoder()],["amount",getU64Decoder()],["tokenMint",getAddressDecoder()],["status",lo()],["jobDescription",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["deliveryProof",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["deadline",getI64Decoder()],["createdAt",getI64Decoder()],["completedAt",getOptionDecoder(getI64Decoder())],["disputeReason",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["arbitratorDecision",getOptionDecoder(oe())],["bump",getU8Decoder()]])}function GQ(){return combineCodec(Hb(),Rl())}function bl(n){return decodeAccount(n,Rl())}async function WQ(n,e,t){let o=await jb(n,e,t);return assertAccountExists(o),o}async function jb(n,e,t){let o=await fetchEncodedAccount(n,e,t);return bl(o)}async function NQ(n,e,t){let o=await $b(n,e,t);return assertAccountsExist(o),o}async function $b(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>bl(r))}var Cl,qb=a(()=>{m();Cl=new Uint8Array([38,0,98,160,102,4,51,160]);});function nX(){return fixEncoderSize(getBytesEncoder(),8).encode(Ml)}function rI(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["proposalId",getU64Encoder()],["proposer",getAddressEncoder()],["title",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["proposalType",se()],["createdAt",getI64Encoder()],["votingStartsAt",getI64Encoder()],["votingEndsAt",getI64Encoder()],["executionTimestamp",getOptionEncoder(getI64Encoder())],["status",nc()],["votingResults",ca()],["executionParams",qe()],["quorumRequirements",sc()],["metadata",Yi()],["reserved",fixEncoderSize(getBytesEncoder(),64)]]),n=>({...n,discriminator:Ml}))}function kl(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["proposalId",getU64Decoder()],["proposer",getAddressDecoder()],["title",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["proposalType",ae()],["createdAt",getI64Decoder()],["votingStartsAt",getI64Decoder()],["votingEndsAt",getI64Decoder()],["executionTimestamp",getOptionDecoder(getI64Decoder())],["status",rc()],["votingResults",sa()],["executionParams",Je()],["quorumRequirements",ac()],["metadata",ec()],["reserved",fixDecoderSize(getBytesDecoder(),64)]])}function rX(){return combineCodec(rI(),kl())}function wl(n){return decodeAccount(n,kl())}async function oX(n,e,t){let o=await oI(n,e,t);return assertAccountExists(o),o}async function oI(n,e,t){let o=await fetchEncodedAccount(n,e,t);return wl(o)}async function iX(n,e,t){let o=await iI(n,e,t);return assertAccountsExist(o),o}async function iI(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>wl(r))}var Ml,cI=a(()=>{m();Ml=new Uint8Array([53,107,240,190,43,73,65,143]);});function TX(){return fixEncoderSize(getBytesEncoder(),8).encode(zl)}function TI(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["multisigId",getU64Encoder()],["multisigType",pe()],["threshold",getU8Encoder()],["signers",getArrayEncoder(getAddressEncoder())],["owner",getAddressEncoder()],["createdAt",getI64Encoder()],["updatedAt",getI64Encoder()],["nonce",getU64Encoder()],["pendingTransactions",getArrayEncoder(ci())],["config",Ze()],["emergencyConfig",ao()],["typeConfig",Go()],["reserved",fixEncoderSize(getBytesEncoder(),64)]]),n=>({...n,discriminator:zl}))}function Ol(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multisigId",getU64Decoder()],["multisigType",le()],["threshold",getU8Decoder()],["signers",getArrayDecoder(getAddressDecoder())],["owner",getAddressDecoder()],["createdAt",getI64Decoder()],["updatedAt",getI64Decoder()],["nonce",getU64Decoder()],["pendingTransactions",getArrayDecoder(si())],["config",Ye()],["emergencyConfig",uo()],["typeConfig",Wo()],["reserved",fixDecoderSize(getBytesDecoder(),64)]])}function fX(){return combineCodec(TI(),Ol())}function Fl(n){return decodeAccount(n,Ol())}async function SX(n,e,t){let o=await fI(n,e,t);return assertAccountExists(o),o}async function fI(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Fl(o)}async function xX(n,e,t){let o=await SI(n,e,t);return assertAccountsExist(o),o}async function SI(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Fl(r))}var zl,xI=a(()=>{m();zl=new Uint8Array([224,116,121,186,68,161,79,236]);});function OX(){return fixEncoderSize(getBytesEncoder(),8).encode(Nl)}function bI(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["treasury",getAddressEncoder()],["buybackPool",getAddressEncoder()],["moderatorPool",getAddressEncoder()],["escrowFeeBps",getU16Encoder()],["agentRegistrationFee",getU64Encoder()],["listingFee",getU64Encoder()],["disputeFeeBps",getU16Encoder()],["feesEnabled",getBooleanEncoder()],["updatedAt",getI64Encoder()],["bump",getU8Encoder()],["reserved",fixEncoderSize(getBytesEncoder(),64)]]),n=>({...n,discriminator:Nl}))}function Bl(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["treasury",getAddressDecoder()],["buybackPool",getAddressDecoder()],["moderatorPool",getAddressDecoder()],["escrowFeeBps",getU16Decoder()],["agentRegistrationFee",getU64Decoder()],["listingFee",getU64Decoder()],["disputeFeeBps",getU16Decoder()],["feesEnabled",getBooleanDecoder()],["updatedAt",getI64Decoder()],["bump",getU8Decoder()],["reserved",fixDecoderSize(getBytesDecoder(),64)]])}function FX(){return combineCodec(bI(),Bl())}function Vl(n){return decodeAccount(n,Bl())}async function GX(n,e,t){let o=await II(n,e,t);return assertAccountExists(o),o}async function II(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Vl(o)}async function WX(n,e,t){let o=await vI(n,e,t);return assertAccountsExist(o),o}async function vI(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Vl(r))}function NX(){return 230}var Nl,MI=a(()=>{Nl=new Uint8Array([207,91,250,28,152,179,215,209]);});function eZ(){return fixEncoderSize(getBytesEncoder(),8).encode($l)}function zI(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["createdAt",getI64Encoder()],["updatedAt",getI64Encoder()],["version",getU8Encoder()],["roles",getArrayEncoder(ct())],["permissions",getArrayEncoder(xi())],["accessPolicies",getArrayEncoder(pn())],["securityPolicies",Ds()],["auditConfig",gn()],["emergencyAccess",co()],["reserved",fixEncoderSize(getBytesEncoder(),128)]]),n=>({...n,discriminator:$l}))}function ql(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["createdAt",getI64Decoder()],["updatedAt",getI64Decoder()],["version",getU8Decoder()],["roles",getArrayDecoder(st())],["permissions",getArrayDecoder(Di())],["accessPolicies",getArrayDecoder(ln())],["securityPolicies",Ps()],["auditConfig",An()],["emergencyAccess",so()],["reserved",fixDecoderSize(getBytesDecoder(),128)]])}function tZ(){return combineCodec(zI(),ql())}function Jl(n){return decodeAccount(n,ql())}async function nZ(n,e,t){let o=await OI(n,e,t);return assertAccountExists(o),o}async function OI(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Jl(o)}async function rZ(n,e,t){let o=await FI(n,e,t);return assertAccountsExist(o),o}async function FI(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Jl(r))}var $l,GI=a(()=>{m();$l=new Uint8Array([177,94,184,202,221,112,110,38]);});function EZ(){return fixEncoderSize(getBytesEncoder(),8).encode(Ql)}function BI(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["state",uc()],["nonce",getU64Encoder()],["lastInteraction",getI64Encoder()],["authority",getAddressEncoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:Ql}))}function Xl(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["state",gc()],["nonce",getU64Decoder()],["lastInteraction",getI64Decoder()],["authority",getAddressDecoder()],["bump",getU8Decoder()]])}function hZ(){return combineCodec(BI(),Xl())}function Zl(n){return decodeAccount(n,Xl())}async function CZ(n,e,t){let o=await VI(n,e,t);return assertAccountExists(o),o}async function VI(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Zl(o)}async function RZ(n,e,t){let o=await LI(n,e,t);return assertAccountsExist(o),o}async function LI(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Zl(r))}function bZ(){return 58}var Ql,KI=a(()=>{m();Ql=new Uint8Array([207,227,141,11,194,21,193,32]);});function LZ(){return fixEncoderSize(getBytesEncoder(),8).encode(Yl)}function $I(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agent",getAddressEncoder()],["successfulPayments",getU64Encoder()],["failedPayments",getU64Encoder()],["totalResponseTime",getU64Encoder()],["responseTimeCount",getU64Encoder()],["totalDisputes",getU32Encoder()],["disputesResolved",getU32Encoder()],["totalRating",getU32Encoder()],["totalRatingsCount",getU32Encoder()],["paymentHistory7d",getArrayEncoder(getU64Encoder(),{size:7})],["createdAt",getI64Encoder()],["updatedAt",getI64Encoder()],["skillTags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["behaviorTags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["complianceTags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["tagScores",getArrayEncoder(at())],["tagUpdatedAt",getI64Encoder()],["sourceScores",getArrayEncoder(ws())],["primarySource",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["lastAggregation",getI64Encoder()],["conflictFlags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["bump",getU8Encoder()]]),n=>({...n,discriminator:Yl}))}function em(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agent",getAddressDecoder()],["successfulPayments",getU64Decoder()],["failedPayments",getU64Decoder()],["totalResponseTime",getU64Decoder()],["responseTimeCount",getU64Decoder()],["totalDisputes",getU32Decoder()],["disputesResolved",getU32Decoder()],["totalRating",getU32Decoder()],["totalRatingsCount",getU32Decoder()],["paymentHistory7d",getArrayDecoder(getU64Decoder(),{size:7})],["createdAt",getI64Decoder()],["updatedAt",getI64Decoder()],["skillTags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["behaviorTags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["complianceTags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["tagScores",getArrayDecoder(dt())],["tagUpdatedAt",getI64Decoder()],["sourceScores",getArrayDecoder(Us())],["primarySource",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["lastAggregation",getI64Decoder()],["conflictFlags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["bump",getU8Decoder()]])}function KZ(){return combineCodec($I(),em())}function tm(n){return decodeAccount(n,em())}async function HZ(n,e,t){let o=await qI(n,e,t);return assertAccountExists(o),o}async function qI(n,e,t){let o=await fetchEncodedAccount(n,e,t);return tm(o)}async function jZ(n,e,t){let o=await JI(n,e,t);return assertAccountsExist(o),o}async function JI(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>tm(r))}var Yl,QI=a(()=>{m();Yl=new Uint8Array([8,160,71,30,66,150,108,33]);});function AY(){return fixEncoderSize(getBytesEncoder(),8).encode(om)}function tv(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["owner",getAddressEncoder()],["amountStaked",getU64Encoder()],["stakedAt",getI64Encoder()],["lockDuration",getI64Encoder()],["unlockAt",getI64Encoder()],["reputationBoostBps",getU16Encoder()],["hasVerifiedBadge",getBooleanEncoder()],["hasPremiumBenefits",getBooleanEncoder()],["totalSlashed",getU64Encoder()],["tier",V()],["apiCallsRemaining",getU32Encoder()],["lastQuotaReset",getI64Encoder()],["votingPower",getU64Encoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:om}))}function im(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["owner",getAddressDecoder()],["amountStaked",getU64Decoder()],["stakedAt",getI64Decoder()],["lockDuration",getI64Decoder()],["unlockAt",getI64Decoder()],["reputationBoostBps",getU16Decoder()],["hasVerifiedBadge",getBooleanDecoder()],["hasPremiumBenefits",getBooleanDecoder()],["totalSlashed",getU64Decoder()],["tier",L()],["apiCallsRemaining",getU32Decoder()],["lastQuotaReset",getI64Decoder()],["votingPower",getU64Decoder()],["bump",getU8Decoder()]])}function pY(){return combineCodec(tv(),im())}function cm(n){return decodeAccount(n,im())}async function lY(n,e,t){let o=await nv(n,e,t);return assertAccountExists(o),o}async function nv(n,e,t){let o=await fetchEncodedAccount(n,e,t);return cm(o)}async function mY(n,e,t){let o=await rv(n,e,t);return assertAccountsExist(o),o}async function rv(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>cm(r))}function yY(){return 106}var om,ov=a(()=>{m();om=new Uint8Array([52,178,251,157,180,186,98,234]);});function _Y(){return fixEncoderSize(getBytesEncoder(),8).encode(sm)}function gv(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["minStake",getU64Encoder()],["minLockDuration",getI64Encoder()],["fraudSlashBps",getU16Encoder()],["disputeSlashBps",getU16Encoder()],["treasury",getAddressEncoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:sm}))}function am(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["minStake",getU64Decoder()],["minLockDuration",getI64Decoder()],["fraudSlashBps",getU16Decoder()],["disputeSlashBps",getU16Decoder()],["treasury",getAddressDecoder()],["bump",getU8Decoder()]])}function zY(){return combineCodec(gv(),am())}function dm(n){return decodeAccount(n,am())}async function OY(n,e,t){let o=await Av(n,e,t);return assertAccountExists(o),o}async function Av(n,e,t){let o=await fetchEncodedAccount(n,e,t);return dm(o)}async function FY(n,e,t){let o=await pv(n,e,t);return assertAccountsExist(o),o}async function pv(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>dm(r))}function GY(){return 93}var sm,lv=a(()=>{sm=new Uint8Array([45,134,252,82,37,57,84,25]);});function oee(){return fixEncoderSize(getBytesEncoder(),8).encode(um)}function Tv(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["user",getAddressEncoder()],["agentCount",getU16Encoder()],["listingCount",getU16Encoder()],["workOrderCount",getU16Encoder()],["channelCount",getU16Encoder()],["totalVolumeTraded",getU64Encoder()],["lastActivity",getI64Encoder()],["createdAt",getI64Encoder()],["isRateLimited",getBooleanEncoder()],["rateLimitExpiry",getI64Encoder()],["lastExtensionRegistration",getI64Encoder()],["lastDisputeFiling",getI64Encoder()],["lastEvidenceSubmission",getI64Encoder()],["lastBatchExecution",getI64Encoder()],["lastDashboardUpdate",getI64Encoder()],["lastBulkDealCreation",getI64Encoder()],["lastDashboardCreation",getI64Encoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:um}))}function gm(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["user",getAddressDecoder()],["agentCount",getU16Decoder()],["listingCount",getU16Decoder()],["workOrderCount",getU16Decoder()],["channelCount",getU16Decoder()],["totalVolumeTraded",getU64Decoder()],["lastActivity",getI64Decoder()],["createdAt",getI64Decoder()],["isRateLimited",getBooleanDecoder()],["rateLimitExpiry",getI64Decoder()],["lastExtensionRegistration",getI64Decoder()],["lastDisputeFiling",getI64Decoder()],["lastEvidenceSubmission",getI64Decoder()],["lastBatchExecution",getI64Decoder()],["lastDashboardUpdate",getI64Decoder()],["lastBulkDealCreation",getI64Decoder()],["lastDashboardCreation",getI64Decoder()],["bump",getU8Decoder()]])}function iee(){return combineCodec(Tv(),gm())}function Am(n){return decodeAccount(n,gm())}async function cee(n,e,t){let o=await fv(n,e,t);return assertAccountExists(o),o}async function fv(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Am(o)}async function see(n,e,t){let o=await Sv(n,e,t);return assertAccountsExist(o),o}async function Sv(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Am(r))}function aee(){return 138}var um,xv=a(()=>{um=new Uint8Array([37,84,98,14,130,63,210,138]);});var Dv=a(()=>{AR();RR();_R();KR();ZR();Ab();yb();xb();Ib();_b();Nb();qb();cI();xI();MI();GI();KI();QI();ov();lv();xv();});function dee(n){let e="data"in n?n.data:n;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([47,166,112,147,155,197,86,7])),0))return 0;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([30,249,165,44,155,194,188,175])),0))return 1;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([145,145,156,0,197,232,130,245])),0))return 2;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([128,155,95,241,66,207,166,59])),0))return 3;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([171,223,253,181,134,88,66,26])),0))return 4;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([109,102,102,17,210,84,85,210])),0))return 5;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([75,146,78,26,130,240,228,35])),0))return 6;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([145,44,68,220,67,46,100,135])),0))return 7;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([229,129,99,91,179,207,66,75])),0))return 8;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([132,171,20,181,39,219,217,112])),0))return 9;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([109,220,168,224,33,173,192,166])),0))return 10;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([38,0,98,160,102,4,51,160])),0))return 11;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([53,107,240,190,43,73,65,143])),0))return 12;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([224,116,121,186,68,161,79,236])),0))return 13;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([207,91,250,28,152,179,215,209])),0))return 14;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([177,94,184,202,221,112,110,38])),0))return 15;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([207,227,141,11,194,21,193,32])),0))return 16;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([8,160,71,30,66,150,108,33])),0))return 17;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([52,178,251,157,180,186,98,234])),0))return 18;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([45,134,252,82,37,57,84,25])),0))return 19;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([37,84,98,14,130,63,210,138])),0))return 20;throw new Error("The provided account could not be identified as a ghostspeakMarketplace account.")}function uee(n){let e="data"in n?n.data:n;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([252,139,87,21,195,152,29,217])),0))return 0;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([28,233,51,115,33,220,41,28])),0))return 1;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([225,89,166,101,215,40,191,4])),0))return 2;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([48,219,232,202,151,97,230,20])),0))return 3;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([183,109,12,128,134,8,139,144])),0))return 4;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([211,208,67,175,20,248,8,227])),0))return 5;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([253,40,200,239,69,147,82,182])),0))return 6;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([253,215,165,116,36,108,68,80])),0))return 7;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([148,146,240,10,226,215,167,174])),0))return 8;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([205,171,239,225,82,126,96,166])),0))return 9;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([177,8,195,104,56,34,84,162])),0))return 10;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([110,174,221,244,36,206,60,237])),0))return 11;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([77,13,56,161,67,155,206,119])),0))return 12;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([9,115,79,19,158,209,221,38])),0))return 13;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([210,63,221,114,212,97,195,156])),0))return 14;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([213,97,79,234,22,228,14,32])),0))return 15;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([156,109,115,85,12,60,245,99])),0))return 16;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([145,182,236,249,212,17,175,161])),0))return 17;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([137,84,234,206,17,58,54,215])),0))return 18;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([28,50,43,233,244,98,123,118])),0))return 19;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([215,68,129,228,237,165,0,240])),0))return 20;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([228,11,207,44,52,188,169,237])),0))return 21;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([78,164,6,115,206,48,168,105])),0))return 22;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([255,193,171,224,68,171,194,87])),0))return 23;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([164,219,91,38,45,31,33,47])),0))return 24;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([165,202,159,139,65,65,36,163])),0))return 25;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([135,157,66,195,2,113,175,30])),0))return 26;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([15,6,94,55,65,80,123,248])),0))return 27;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([93,74,168,125,46,153,9,255])),0))return 28;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([168,180,218,211,184,19,102,12])),0))return 29;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([222,179,207,59,191,78,24,248])),0))return 30;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([38,123,95,95,223,158,169,87])),0))return 31;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([190,242,137,27,41,18,233,37])),0))return 32;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([5,196,24,54,196,56,173,191])),0))return 33;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([217,177,33,54,136,185,123,96])),0))return 34;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([23,160,228,88,168,145,129,19])),0))return 35;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([252,101,172,252,1,4,12,116])),0))return 36;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([85,2,178,9,119,139,102,164])),0))return 37;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([80,227,92,245,231,37,99,180])),0))return 38;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([87,146,181,198,252,68,243,102])),0))return 39;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([22,167,59,238,22,231,239,146])),0))return 40;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([64,216,17,91,205,94,45,57])),0))return 41;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([197,97,123,54,221,168,11,135])),0))return 42;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([206,96,254,186,129,180,103,198])),0))return 43;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([61,236,225,167,134,43,53,93])),0))return 44;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([161,240,255,69,130,227,71,123])),0))return 45;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([206,212,108,12,105,61,100,66])),0))return 46;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([43,9,131,59,74,118,113,170])),0))return 47;throw new Error("The provided instruction could not be identified as a ghostspeakMarketplace instruction.")}var u,Pv,Ev,hv=a(()=>{u="4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB",Pv=(C=>(C[C.Agent=0]="Agent",C[C.AgentReputationAuth=1]="AgentReputationAuth",C[C.AgentTreeConfig=2]="AgentTreeConfig",C[C.AgentVerification=3]="AgentVerification",C[C.AuditTrail=4]="AuditTrail",C[C.AuthorizationUsageRecord=5]="AuthorizationUsageRecord",C[C.ComplianceReport=6]="ComplianceReport",C[C.Credential=7]="Credential",C[C.CredentialTemplate=8]="CredentialTemplate",C[C.CredentialType=9]="CredentialType",C[C.DidDocument=10]="DidDocument",C[C.GhostProtectEscrow=11]="GhostProtectEscrow",C[C.GovernanceProposal=12]="GovernanceProposal",C[C.Multisig=13]="Multisig",C[C.ProtocolConfig=14]="ProtocolConfig",C[C.RbacConfig=15]="RbacConfig",C[C.ReentrancyGuard=16]="ReentrancyGuard",C[C.ReputationMetrics=17]="ReputationMetrics",C[C.StakingAccount=18]="StakingAccount",C[C.StakingConfig=19]="StakingConfig",C[C.UserRegistry=20]="UserRegistry",C))(Pv||{});Ev=(l=>(l[l.ActivateAgent=0]="ActivateAgent",l[l.ApproveDelivery=1]="ApproveDelivery",l[l.ArbitrateDispute=2]="ArbitrateDispute",l[l.CreateAgentAuthorization=3]="CreateAgentAuthorization",l[l.CreateCredentialTemplate=4]="CreateCredentialTemplate",l[l.CreateCredentialType=5]="CreateCredentialType",l[l.CreateDidDocument=6]="CreateDidDocument",l[l.CreateEscrow=7]="CreateEscrow",l[l.CreateMultisig=8]="CreateMultisig",l[l.DeactivateAgent=9]="DeactivateAgent",l[l.DeactivateCredentialTemplate=10]="DeactivateCredentialTemplate",l[l.DeactivateCredentialType=11]="DeactivateCredentialType",l[l.DeactivateDidDocument=12]="DeactivateDidDocument",l[l.EnableProtocolFees=13]="EnableProtocolFees",l[l.FileDispute=14]="FileDispute",l[l.GenerateComplianceReport=15]="GenerateComplianceReport",l[l.InitReentrancyGuard=16]="InitReentrancyGuard",l[l.InitializeAuditTrail=17]="InitializeAuditTrail",l[l.InitializeGovernanceProposal=18]="InitializeGovernanceProposal",l[l.InitializeProtocolConfig=19]="InitializeProtocolConfig",l[l.InitializeRbacConfig=20]="InitializeRbacConfig",l[l.InitializeReputationMetrics=21]="InitializeReputationMetrics",l[l.InitializeStakingConfig=22]="InitializeStakingConfig",l[l.IssueCredential=23]="IssueCredential",l[l.ManageAgentStatus=24]="ManageAgentStatus",l[l.RecordPayaiPayment=25]="RecordPayaiPayment",l[l.RegisterAgent=26]="RegisterAgent",l[l.RegisterAgentCompressed=27]="RegisterAgentCompressed",l[l.ResetReentrancyGuard=28]="ResetReentrancyGuard",l[l.ResolveDidDocument=29]="ResolveDidDocument",l[l.RevokeAuthorization=30]="RevokeAuthorization",l[l.RevokeCredential=31]="RevokeCredential",l[l.SlashStake=32]="SlashStake",l[l.StakeGhost=33]="StakeGhost",l[l.SubmitDelivery=34]="SubmitDelivery",l[l.SubmitServiceRating=35]="SubmitServiceRating",l[l.UnstakeGhost=36]="UnstakeGhost",l[l.UpdateAgent=37]="UpdateAgent",l[l.UpdateAgentReputation=38]="UpdateAgentReputation",l[l.UpdateAgentService=39]="UpdateAgentService",l[l.UpdateCrosschainStatus=40]="UpdateCrosschainStatus",l[l.UpdateDidDocument=41]="UpdateDidDocument",l[l.UpdateProtocolConfig=42]="UpdateProtocolConfig",l[l.UpdateReputationTags=43]="UpdateReputationTags",l[l.UpdateReputationWithAuth=44]="UpdateReputationWithAuth",l[l.UpdateSourceReputation=45]="UpdateSourceReputation",l[l.VerifyAgent=46]="VerifyAgent",l[l.VerifyAuthorization=47]="VerifyAuthorization",l))(Ev||{});});var E=a(()=>{hv();});function Aee(n){return process.env.NODE_ENV!=="production"?zv[n]:"Error message not available in production bundles."}function pee(n,e,t){return isProgramError(n,e,u,t)}var Cv,Rv,bv,Iv,vv,Mv,kv,wv,Uv,_v,zv,Ov=a(()=>{E();Cv=6e3,Rv=6001,bv=6002,Iv=6003,vv=6004,Mv=6005,kv=6006,wv=6007,Uv=6008,_v=6009;process.env.NODE_ENV!=="production"&&(zv={[Cv]:"DID document is already deactivated",[_v]:"DID is deactivated",[Iv]:"Duplicate verification method ID",[vv]:"Duplicate service endpoint ID",[wv]:"Invalid DID format",[Mv]:"Verification method not found",[kv]:"Service endpoint not found",[bv]:"Maximum number of service endpoints reached",[Rv]:"Maximum number of verification methods reached",[Uv]:"Unauthorized DID operation"});});var Fv=a(()=>{Ov();});function I(n){if(n==null)throw new Error("Expected a value but received null or undefined.");return n}function x(n){if(!n)throw new Error("Expected a Address.");return typeof n=="object"&&"address"in n?n.address:Array.isArray(n)?n[0]:n}function g(n,e){return t=>{if(!t.value)return Object.freeze({address:n,role:AccountRole.READONLY});let o=t.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:x(t.value),role:Gv(t.value)?upgradeRoleToSigner(o):o,...Gv(t.value)?{signer:t.value}:{}})}}function Gv(n){return !!n&&typeof n=="object"&&"address"in n&&isTransactionSigner(n)}var h=a(()=>{});function vee(){return fixEncoderSize(getBytesEncoder(),8).encode(mm)}function Na(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),n=>({...n,discriminator:mm}))}function ym(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function Mee(){return combineCodec(Na(),ym())}async function kee(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agentAccount.value||(r.agentAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(x(r.signer.value)),getUtf8Encoder().encode(I(c.agentId))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Na().encode(c),programAddress:t})}function Tm(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Na().encode(c),programAddress:t})}function wee(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),signer:t(),clock:t()},data:ym().decode(n.data)}}var mm,Bv=a(()=>{E();h();mm=new Uint8Array([252,139,87,21,195,152,29,217]);});function Wee(){return fixEncoderSize(getBytesEncoder(),8).encode(fm)}function Sm(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:fm}))}function xm(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function Nee(){return combineCodec(Sm(),xm())}function Bee(n,e){let t=e?.programAddress??u,r={escrow:{value:n.escrow??null,isWritable:true},escrowVault:{value:n.escrowVault??null,isWritable:true},agentTokenAccount:{value:n.agentTokenAccount??null,isWritable:true},client:{value:n.client??null,isWritable:false},tokenProgram:{value:n.tokenProgram??null,isWritable:false}};r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");let c=g(t);return Object.freeze({accounts:[c(r.escrow),c(r.escrowVault),c(r.agentTokenAccount),c(r.client),c(r.tokenProgram)],data:Sm().encode({}),programAddress:t})}function Vee(n){if(n.accounts.length<5)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{escrow:t(),escrowVault:t(),agentTokenAccount:t(),client:t(),tokenProgram:t()},data:xm().decode(n.data)}}var fm,Kv=a(()=>{E();h();fm=new Uint8Array([28,233,51,115,33,220,41,28]);});function Jee(){return fixEncoderSize(getBytesEncoder(),8).encode(Dm)}function Pm(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["decision",re()]]),n=>({...n,discriminator:Dm}))}function Em(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["decision",oe()]])}function Qee(){return combineCodec(Pm(),Em())}function Xee(n,e){let t=e?.programAddress??u,r={escrow:{value:n.escrow??null,isWritable:true},escrowVault:{value:n.escrowVault??null,isWritable:true},agentTokenAccount:{value:n.agentTokenAccount??null,isWritable:true},clientTokenAccount:{value:n.clientTokenAccount??null,isWritable:true},agentStaking:{value:n.agentStaking??null,isWritable:true},arbitrator:{value:n.arbitrator??null,isWritable:false},tokenProgram:{value:n.tokenProgram??null,isWritable:false}},c={...n};r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");let i=g(t);return Object.freeze({accounts:[i(r.escrow),i(r.escrowVault),i(r.agentTokenAccount),i(r.clientTokenAccount),i(r.agentStaking),i(r.arbitrator),i(r.tokenProgram)],data:Pm().encode(c),programAddress:t})}function Zee(n){if(n.accounts.length<7)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{escrow:t(),escrowVault:t(),agentTokenAccount:t(),clientTokenAccount:t(),agentStaking:t(),arbitrator:t(),tokenProgram:t()},data:Em().decode(n.data)}}var Dm,$v=a(()=>{E();h();m();Dm=new Uint8Array([225,89,166,101,215,40,191,4]);});var iM={};ne(iM,{CREATE_AGENT_AUTHORIZATION_DISCRIMINATOR:()=>Va,getCreateAgentAuthorizationDiscriminatorBytes:()=>eM,getCreateAgentAuthorizationInstruction:()=>rM,getCreateAgentAuthorizationInstructionAsync:()=>nM,getCreateAgentAuthorizationInstructionDataCodec:()=>tM,getCreateAgentAuthorizationInstructionDataDecoder:()=>La,getCreateAgentAuthorizationInstructionDataEncoder:()=>Lt,parseCreateAgentAuthorizationInstruction:()=>oM});function eM(){return fixEncoderSize(getBytesEncoder(),8).encode(Va)}function Lt(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authorizedSource",getAddressEncoder()],["indexLimit",getU64Encoder()],["expiresAt",getI64Encoder()],["network",getU8Encoder()],["signature",fixEncoderSize(getBytesEncoder(),64)],["nonce",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:Va}))}function La(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authorizedSource",getAddressDecoder()],["indexLimit",getU64Decoder()],["expiresAt",getI64Decoder()],["network",getU8Decoder()],["signature",fixDecoderSize(getBytesDecoder(),64)],["nonce",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function tM(){return combineCodec(Lt(),La())}async function nM(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:false},authorization:{value:n.authorization??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.authorization.value||(r.authorization.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116,95,97,117,116,104])),getAddressEncoder().encode(x(r.agent.value)),getAddressEncoder().encode(I(c.authorizedSource)),getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())).encode(I(c.nonce))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.authorization),i(r.authority),i(r.systemProgram)],data:Lt().encode(c),programAddress:t})}function rM(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:false},authorization:{value:n.authorization??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.authorization),i(r.authority),i(r.systemProgram)],data:Lt().encode(c),programAddress:t})}function oM(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agent:t(),authorization:t(),authority:t(),systemProgram:t()},data:La().decode(n.data)}}var Va,Rm=a(()=>{E();h();Va=new Uint8Array([48,219,232,202,151,97,230,20]);});function Cte(){return fixEncoderSize(getBytesEncoder(),8).encode(Um)}function Ha(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["imageUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["crossmintTemplateId",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:Um}))}function _m(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["imageUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["crossmintTemplateId",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function Rte(){return combineCodec(Ha(),_m())}async function bte(n,e){let t=e?.programAddress??u,r={credentialTemplate:{value:n.credentialTemplate??null,isWritable:true},credentialType:{value:n.credentialType??null,isWritable:false},issuer:{value:n.issuer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.credentialTemplate.value||(r.credentialTemplate.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([99,114,101,100,101,110,116,105,97,108,95,116,101,109,112,108,97,116,101])),getAddressEncoder().encode(x(r.credentialType.value)),getUtf8Encoder().encode(I(c.name))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.credentialTemplate),i(r.credentialType),i(r.issuer),i(r.systemProgram)],data:Ha().encode(c),programAddress:t})}function Ite(n,e){let t=e?.programAddress??u,r={credentialTemplate:{value:n.credentialTemplate??null,isWritable:true},credentialType:{value:n.credentialType??null,isWritable:false},issuer:{value:n.issuer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.credentialTemplate),i(r.credentialType),i(r.issuer),i(r.systemProgram)],data:Ha().encode(c),programAddress:t})}function vte(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credentialTemplate:t(),credentialType:t(),issuer:t(),systemProgram:t()},data:_m().decode(n.data)}}var Um,sM=a(()=>{E();h();Um=new Uint8Array([183,109,12,128,134,8,139,144]);});function Fte(){return fixEncoderSize(getBytesEncoder(),8).encode(Bm)}function $a(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["kind",Ve()],["schemaUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),n=>({...n,discriminator:Bm}))}function Vm(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["kind",Le()],["schemaUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function Gte(){return combineCodec($a(),Vm())}async function Wte(n,e){let t=e?.programAddress??u,r={credentialType:{value:n.credentialType??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.credentialType.value||(r.credentialType.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([99,114,101,100,101,110,116,105,97,108,95,116,121,112,101])),getUtf8Encoder().encode(I(c.name))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.credentialType),i(r.authority),i(r.systemProgram)],data:$a().encode(c),programAddress:t})}function Nte(n,e){let t=e?.programAddress??u,r={credentialType:{value:n.credentialType??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.credentialType),i(r.authority),i(r.systemProgram)],data:$a().encode(c),programAddress:t})}function Bte(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credentialType:t(),authority:t(),systemProgram:t()},data:Vm().decode(n.data)}}var Bm,dM=a(()=>{E();h();m();Bm=new Uint8Array([211,208,67,175,20,248,8,227]);});function nne(){return fixEncoderSize(getBytesEncoder(),8).encode(Km)}function qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["didString",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["verificationMethods",getArrayEncoder(Te())],["serviceEndpoints",getArrayEncoder(me())]]),n=>({...n,discriminator:Km}))}function Hm(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["didString",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["verificationMethods",getArrayDecoder(fe())],["serviceEndpoints",getArrayDecoder(ye())]])}function rne(){return combineCodec(qa(),Hm())}async function one(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:true},controller:{value:n.controller??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.didDocument.value||(r.didDocument.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([100,105,100,95,100,111,99,117,109,101,110,116])),getAddressEncoder().encode(x(r.controller.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.didDocument),i(r.controller),i(r.systemProgram),i(r.clock)],data:qa().encode(c),programAddress:t})}function ine(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:true},controller:{value:n.controller??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.didDocument),i(r.controller),i(r.systemProgram),i(r.clock)],data:qa().encode(c),programAddress:t})}function cne(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{didDocument:t(),controller:t(),systemProgram:t(),clock:t()},data:Hm().decode(n.data)}}var Km,pM=a(()=>{E();h();m();Km=new Uint8Array([253,40,200,239,69,147,82,182]);});function Ene(){return fixEncoderSize(getBytesEncoder(),8).encode(qm)}function Ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["escrowId",getU64Encoder()],["amount",getU64Encoder()],["jobDescription",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["deadline",getI64Encoder()]]),n=>({...n,discriminator:qm}))}function Jm(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["escrowId",getU64Decoder()],["amount",getU64Decoder()],["jobDescription",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["deadline",getI64Decoder()]])}function hne(){return combineCodec(Ja(),Jm())}async function Cne(n,e){let t=e?.programAddress??u,r={escrow:{value:n.escrow??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},clientTokenAccount:{value:n.clientTokenAccount??null,isWritable:true},escrowVault:{value:n.escrowVault??null,isWritable:true},tokenMint:{value:n.tokenMint??null,isWritable:false},client:{value:n.client??null,isWritable:true},tokenProgram:{value:n.tokenProgram??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.escrow.value||(r.escrow.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([103,104,111,115,116,95,112,114,111,116,101,99,116])),getAddressEncoder().encode(x(r.client.value)),getU64Encoder().encode(I(c.escrowId))]})),r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.escrow),i(r.agent),i(r.clientTokenAccount),i(r.escrowVault),i(r.tokenMint),i(r.client),i(r.tokenProgram),i(r.systemProgram)],data:Ja().encode(c),programAddress:t})}function Rne(n,e){let t=e?.programAddress??u,r={escrow:{value:n.escrow??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},clientTokenAccount:{value:n.clientTokenAccount??null,isWritable:true},escrowVault:{value:n.escrowVault??null,isWritable:true},tokenMint:{value:n.tokenMint??null,isWritable:false},client:{value:n.client??null,isWritable:true},tokenProgram:{value:n.tokenProgram??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.escrow),i(r.agent),i(r.clientTokenAccount),i(r.escrowVault),i(r.tokenMint),i(r.client),i(r.tokenProgram),i(r.systemProgram)],data:Ja().encode(c),programAddress:t})}function bne(n){if(n.accounts.length<8)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{escrow:t(),agent:t(),clientTokenAccount:t(),escrowVault:t(),tokenMint:t(),client:t(),tokenProgram:t(),systemProgram:t()},data:Jm().decode(n.data)}}var qm,yM=a(()=>{E();h();qm=new Uint8Array([253,215,165,116,36,108,68,80]);});function Bne(){return fixEncoderSize(getBytesEncoder(),8).encode(Xm)}function Qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["multisigId",getU64Encoder()],["threshold",getU8Encoder()],["signers",getArrayEncoder(getAddressEncoder())],["config",Ze()]]),n=>({...n,discriminator:Xm}))}function Zm(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multisigId",getU64Decoder()],["threshold",getU8Decoder()],["signers",getArrayDecoder(getAddressDecoder())],["config",Ye()]])}function Vne(){return combineCodec(Qa(),Zm())}async function Lne(n,e){let t=e?.programAddress??u,r={multisig:{value:n.multisig??null,isWritable:true},owner:{value:n.owner??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.multisig.value||(r.multisig.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,115,105,103])),getAddressEncoder().encode(x(r.owner.value)),getU64Encoder().encode(I(c.multisigId))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.multisig),i(r.owner),i(r.systemProgram)],data:Qa().encode(c),programAddress:t})}function Kne(n,e){let t=e?.programAddress??u,r={multisig:{value:n.multisig??null,isWritable:true},owner:{value:n.owner??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.multisig),i(r.owner),i(r.systemProgram)],data:Qa().encode(c),programAddress:t})}function Hne(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{multisig:t(),owner:t(),systemProgram:t()},data:Zm().decode(n.data)}}var Xm,xM=a(()=>{E();h();m();Xm=new Uint8Array([148,146,240,10,226,215,167,174]);});function ire(){return fixEncoderSize(getBytesEncoder(),8).encode(e1)}function Xa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),n=>({...n,discriminator:e1}))}function t1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function cre(){return combineCodec(Xa(),t1())}async function sre(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agentAccount.value||(r.agentAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(x(r.signer.value)),getUtf8Encoder().encode(I(c.agentId))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Xa().encode(c),programAddress:t})}function n1(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Xa().encode(c),programAddress:t})}function are(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),signer:t(),clock:t()},data:t1().decode(n.data)}}var e1,EM=a(()=>{E();h();e1=new Uint8Array([205,171,239,225,82,126,96,166]);});function mre(){return fixEncoderSize(getBytesEncoder(),8).encode(r1)}function o1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:r1}))}function i1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function yre(){return combineCodec(o1(),i1())}function Tre(n,e){let t=e?.programAddress??u,r={credentialTemplate:{value:n.credentialTemplate??null,isWritable:true},issuer:{value:n.issuer??null,isWritable:true}},c=g(t);return Object.freeze({accounts:[c(r.credentialTemplate),c(r.issuer)],data:o1().encode({}),programAddress:t})}function fre(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credentialTemplate:t(),issuer:t()},data:i1().decode(n.data)}}var r1,RM=a(()=>{E();h();r1=new Uint8Array([177,8,195,104,56,34,84,162]);});function Cre(){return fixEncoderSize(getBytesEncoder(),8).encode(c1)}function s1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:c1}))}function a1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function Rre(){return combineCodec(s1(),a1())}function bre(n,e){let t=e?.programAddress??u,r={credentialType:{value:n.credentialType??null,isWritable:true},authority:{value:n.authority??null,isWritable:true}},c=g(t);return Object.freeze({accounts:[c(r.credentialType),c(r.authority)],data:s1().encode({}),programAddress:t})}function Ire(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credentialType:t(),authority:t()},data:a1().decode(n.data)}}var c1,vM=a(()=>{E();h();c1=new Uint8Array([110,174,221,244,36,206,60,237]);});function Fre(){return fixEncoderSize(getBytesEncoder(),8).encode(u1)}function Za(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:u1}))}function g1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function Gre(){return combineCodec(Za(),g1())}async function Wre(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:true},controller:{value:n.controller??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}};r.didDocument.value||(r.didDocument.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([100,105,100,95,100,111,99,117,109,101,110,116])),getAddressEncoder().encode(x(r.controller.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.didDocument),c(r.controller),c(r.clock)],data:Za().encode({}),programAddress:t})}function Nre(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:true},controller:{value:n.controller??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.didDocument),c(r.controller),c(r.clock)],data:Za().encode({}),programAddress:t})}function Bre(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{didDocument:t(),controller:t(),clock:t()},data:g1().decode(n.data)}}var u1,kM=a(()=>{E();h();u1=new Uint8Array([77,13,56,161,67,155,206,119]);});function Jre(){return fixEncoderSize(getBytesEncoder(),8).encode(p1)}function Ya(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:p1}))}function l1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function Qre(){return combineCodec(Ya(),l1())}async function Xre(n,e){let t=e?.programAddress??u,r={config:{value:n.config??null,isWritable:true},authority:{value:n.authority??null,isWritable:false}};r.config.value||(r.config.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([112,114,111,116,111,99,111,108,95,99,111,110,102,105,103]))]}));let c=g(t);return Object.freeze({accounts:[c(r.config),c(r.authority)],data:Ya().encode({}),programAddress:t})}function Zre(n,e){let t=e?.programAddress??u,r={config:{value:n.config??null,isWritable:true},authority:{value:n.authority??null,isWritable:false}},c=g(t);return Object.freeze({accounts:[c(r.config),c(r.authority)],data:Ya().encode({}),programAddress:t})}function Yre(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{config:t(),authority:t()},data:l1().decode(n.data)}}var p1,UM=a(()=>{E();h();p1=new Uint8Array([9,115,79,19,158,209,221,38]);});function Aoe(){return fixEncoderSize(getBytesEncoder(),8).encode(m1)}function y1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["reason",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),n=>({...n,discriminator:m1}))}function T1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["reason",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function poe(){return combineCodec(y1(),T1())}function loe(n,e){let t=e?.programAddress??u,r={escrow:{value:n.escrow??null,isWritable:true},client:{value:n.client??null,isWritable:false}},c={...n},i=g(t);return Object.freeze({accounts:[i(r.escrow),i(r.client)],data:y1().encode(c),programAddress:t})}function moe(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{escrow:t(),client:t()},data:T1().decode(n.data)}}var m1,OM=a(()=>{E();h();m1=new Uint8Array([210,63,221,114,212,97,195,156]);});function hoe(){return fixEncoderSize(getBytesEncoder(),8).encode(S1)}function ed(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["reportId",getU64Encoder()],["reportType",ie()],["dateRangeStart",getI64Encoder()],["dateRangeEnd",getI64Encoder()]]),n=>({...n,discriminator:S1}))}function x1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["reportId",getU64Decoder()],["reportType",ce()],["dateRangeStart",getI64Decoder()],["dateRangeEnd",getI64Decoder()]])}function Coe(){return combineCodec(ed(),x1())}async function Roe(n,e){let t=e?.programAddress??u,r={report:{value:n.report??null,isWritable:true},auditTrail:{value:n.auditTrail??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.report.value||(r.report.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([99,111,109,112,108,105,97,110,99,101,95,114,101,112,111,114,116])),getU64Encoder().encode(I(c.reportId))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.report),i(r.auditTrail),i(r.authority),i(r.systemProgram)],data:ed().encode(c),programAddress:t})}function boe(n,e){let t=e?.programAddress??u,r={report:{value:n.report??null,isWritable:true},auditTrail:{value:n.auditTrail??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.report),i(r.auditTrail),i(r.authority),i(r.systemProgram)],data:ed().encode(c),programAddress:t})}function Ioe(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{report:t(),auditTrail:t(),authority:t(),systemProgram:t()},data:x1().decode(n.data)}}var S1,BM=a(()=>{E();h();m();S1=new Uint8Array([213,97,79,234,22,228,14,32]);});function Loe(){return fixEncoderSize(getBytesEncoder(),8).encode(P1)}function td(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["entityType",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["config",Oe()]]),n=>({...n,discriminator:P1}))}function E1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["entityType",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["config",Fe()]])}function Koe(){return combineCodec(td(),E1())}async function Hoe(n,e){let t=e?.programAddress??u,r={auditTrail:{value:n.auditTrail??null,isWritable:true},entity:{value:n.entity??null,isWritable:false},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.auditTrail.value||(r.auditTrail.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,117,100,105,116,95,116,114,97,105,108])),getAddressEncoder().encode(x(r.entity.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.auditTrail),i(r.entity),i(r.authority),i(r.systemProgram)],data:td().encode(c),programAddress:t})}function joe(n,e){let t=e?.programAddress??u,r={auditTrail:{value:n.auditTrail??null,isWritable:true},entity:{value:n.entity??null,isWritable:false},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.auditTrail),i(r.entity),i(r.authority),i(r.systemProgram)],data:td().encode(c),programAddress:t})}function $oe(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{auditTrail:t(),entity:t(),authority:t(),systemProgram:t()},data:E1().decode(n.data)}}var P1,LM=a(()=>{E();h();m();P1=new Uint8Array([145,182,236,249,212,17,175,161]);});function nie(){return fixEncoderSize(getBytesEncoder(),8).encode(C1)}function nd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["proposalId",getU64Encoder()],["title",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["proposalType",se()],["executionParams",qe()]]),n=>({...n,discriminator:C1}))}function R1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["proposalId",getU64Decoder()],["title",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["proposalType",ae()],["executionParams",Je()]])}function rie(){return combineCodec(nd(),R1())}async function Kt(n,e){let t=e?.programAddress??u,r={proposal:{value:n.proposal??null,isWritable:true},proposer:{value:n.proposer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.proposal.value||(r.proposal.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([103,111,118,101,114,110,97,110,99,101,95,112,114,111,112,111,115,97,108])),getU64Encoder().encode(I(c.proposalId))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.proposal),i(r.proposer),i(r.systemProgram)],data:nd().encode(c),programAddress:t})}function oie(n,e){let t=e?.programAddress??u,r={proposal:{value:n.proposal??null,isWritable:true},proposer:{value:n.proposer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.proposal),i(r.proposer),i(r.systemProgram)],data:nd().encode(c),programAddress:t})}function iie(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{proposal:t(),proposer:t(),systemProgram:t()},data:R1().decode(n.data)}}var C1,ZM=a(()=>{E();h();m();C1=new Uint8Array([137,84,234,206,17,58,54,215]);});function pie(){return fixEncoderSize(getBytesEncoder(),8).encode(I1)}function rd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:I1}))}function v1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function lie(){return combineCodec(rd(),v1())}async function mie(n,e){let t=e?.programAddress??u,r={config:{value:n.config??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},treasury:{value:n.treasury??null,isWritable:false},buybackPool:{value:n.buybackPool??null,isWritable:false},moderatorPool:{value:n.moderatorPool??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false}};r.config.value||(r.config.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([112,114,111,116,111,99,111,108,95,99,111,110,102,105,103]))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.config),c(r.authority),c(r.treasury),c(r.buybackPool),c(r.moderatorPool),c(r.systemProgram)],data:rd().encode({}),programAddress:t})}function yie(n,e){let t=e?.programAddress??u,r={config:{value:n.config??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},treasury:{value:n.treasury??null,isWritable:false},buybackPool:{value:n.buybackPool??null,isWritable:false},moderatorPool:{value:n.moderatorPool??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false}};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.config),c(r.authority),c(r.treasury),c(r.buybackPool),c(r.moderatorPool),c(r.systemProgram)],data:rd().encode({}),programAddress:t})}function Tie(n){if(n.accounts.length<6)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{config:t(),authority:t(),treasury:t(),buybackPool:t(),moderatorPool:t(),systemProgram:t()},data:v1().decode(n.data)}}var I1,ek=a(()=>{E();h();I1=new Uint8Array([28,50,43,233,244,98,123,118]);});function Iie(){return fixEncoderSize(getBytesEncoder(),8).encode(k1)}function od(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["initialRoles",getArrayEncoder(ct())]]),n=>({...n,discriminator:k1}))}function w1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["initialRoles",getArrayDecoder(st())]])}function vie(){return combineCodec(od(),w1())}async function Mie(n,e){let t=e?.programAddress??u,r={rbacConfig:{value:n.rbacConfig??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.rbacConfig.value||(r.rbacConfig.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,98,97,99,95,99,111,110,102,105,103])),getAddressEncoder().encode(x(r.authority.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.rbacConfig),i(r.authority),i(r.systemProgram)],data:od().encode(c),programAddress:t})}function kie(n,e){let t=e?.programAddress??u,r={rbacConfig:{value:n.rbacConfig??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.rbacConfig),i(r.authority),i(r.systemProgram)],data:od().encode(c),programAddress:t})}function wie(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{rbacConfig:t(),authority:t(),systemProgram:t()},data:w1().decode(n.data)}}var k1,nk=a(()=>{E();h();m();k1=new Uint8Array([215,68,129,228,237,165,0,240]);});function Bie(){return fixEncoderSize(getBytesEncoder(),8).encode(_1)}function id(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:_1}))}function z1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function Vie(){return combineCodec(id(),z1())}async function Lie(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}};r.reputationMetrics.value||(r.reputationMetrics.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,112,117,116,97,116,105,111,110,95,109,101,116,114,105,99,115])),getAddressEncoder().encode(x(r.agent.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.reputationMetrics),c(r.agent),c(r.authority),c(r.systemProgram),c(r.clock)],data:id().encode({}),programAddress:t})}function Kie(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.reputationMetrics),c(r.agent),c(r.authority),c(r.systemProgram),c(r.clock)],data:id().encode({}),programAddress:t})}function Hie(n){if(n.accounts.length<5)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reputationMetrics:t(),agent:t(),authority:t(),systemProgram:t(),clock:t()},data:z1().decode(n.data)}}var _1,ok=a(()=>{E();h();_1=new Uint8Array([228,11,207,44,52,188,169,237]);});function rce(){return fixEncoderSize(getBytesEncoder(),8).encode(F1)}function cd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["minStake",getU64Encoder()],["treasury",getAddressEncoder()]]),n=>({...n,discriminator:F1}))}function G1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["minStake",getU64Decoder()],["treasury",getAddressDecoder()]])}function oce(){return combineCodec(cd(),G1())}async function W1(n,e){let t=e?.programAddress??u,r={stakingConfig:{value:n.stakingConfig??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.stakingConfig.value||(r.stakingConfig.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103,95,99,111,110,102,105,103]))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.stakingConfig),i(r.authority),i(r.systemProgram)],data:cd().encode(c),programAddress:t})}function ice(n,e){let t=e?.programAddress??u,r={stakingConfig:{value:n.stakingConfig??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.stakingConfig),i(r.authority),i(r.systemProgram)],data:cd().encode(c),programAddress:t})}function cce(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{stakingConfig:t(),authority:t(),systemProgram:t()},data:G1().decode(n.data)}}var F1,ck=a(()=>{E();h();F1=new Uint8Array([78,164,6,115,206,48,168,105]);});function lce(){return fixEncoderSize(getBytesEncoder(),8).encode(B1)}function sd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:B1}))}function V1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function mce(){return combineCodec(sd(),V1())}async function yce(n,e){let t=e?.programAddress??u,r={reentrancyGuard:{value:n.reentrancyGuard??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}};r.reentrancyGuard.value||(r.reentrancyGuard.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,101,110,116,114,97,110,99,121,95,103,117,97,114,100]))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.reentrancyGuard),c(r.authority),c(r.systemProgram)],data:sd().encode({}),programAddress:t})}function Tce(n,e){let t=e?.programAddress??u,r={reentrancyGuard:{value:n.reentrancyGuard??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.reentrancyGuard),c(r.authority),c(r.systemProgram)],data:sd().encode({}),programAddress:t})}function fce(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reentrancyGuard:t(),authority:t(),systemProgram:t()},data:V1().decode(n.data)}}var B1,ak=a(()=>{E();h();B1=new Uint8Array([156,109,115,85,12,60,245,99]);});function bce(){return fixEncoderSize(getBytesEncoder(),8).encode(j1)}function dd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["credentialId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["subjectDataHash",fixEncoderSize(getBytesEncoder(),32)],["subjectDataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["expiresAt",getOptionEncoder(getI64Encoder())],["sourceAccount",getOptionEncoder(getAddressEncoder())]]),n=>({...n,discriminator:j1}))}function $1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["credentialId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["subjectDataHash",fixDecoderSize(getBytesDecoder(),32)],["subjectDataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["expiresAt",getOptionDecoder(getI64Decoder())],["sourceAccount",getOptionDecoder(getAddressDecoder())]])}function Ice(){return combineCodec(dd(),$1())}async function vce(n,e){let t=e?.programAddress??u,r={credential:{value:n.credential??null,isWritable:true},credentialTemplate:{value:n.credentialTemplate??null,isWritable:true},credentialType:{value:n.credentialType??null,isWritable:true},subject:{value:n.subject??null,isWritable:false},issuer:{value:n.issuer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.credential.value||(r.credential.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([99,114,101,100,101,110,116,105,97,108])),getAddressEncoder().encode(x(r.credentialTemplate.value)),getAddressEncoder().encode(x(r.subject.value)),getUtf8Encoder().encode(I(c.credentialId))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.credential),i(r.credentialTemplate),i(r.credentialType),i(r.subject),i(r.issuer),i(r.systemProgram)],data:dd().encode(c),programAddress:t})}function Mce(n,e){let t=e?.programAddress??u,r={credential:{value:n.credential??null,isWritable:true},credentialTemplate:{value:n.credentialTemplate??null,isWritable:true},credentialType:{value:n.credentialType??null,isWritable:true},subject:{value:n.subject??null,isWritable:false},issuer:{value:n.issuer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.credential),i(r.credentialTemplate),i(r.credentialType),i(r.subject),i(r.issuer),i(r.systemProgram)],data:dd().encode(c),programAddress:t})}function kce(n){if(n.accounts.length<6)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credential:t(),credentialTemplate:t(),credentialType:t(),subject:t(),issuer:t(),systemProgram:t()},data:$1().decode(n.data)}}var j1,fk=a(()=>{E();h();j1=new Uint8Array([255,193,171,224,68,171,194,87]);});function Vce(){return fixEncoderSize(getBytesEncoder(),8).encode(J1)}function ud(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["newStatus",getBooleanEncoder()]]),n=>({...n,discriminator:J1}))}function Q1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["newStatus",getBooleanDecoder()]])}function Lce(){return combineCodec(ud(),Q1())}async function Kce(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:true},owner:{value:n.owner??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agent.value||(r.agent.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(x(r.owner.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.owner),i(r.clock)],data:ud().encode(c),programAddress:t})}function Hce(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:true},owner:{value:n.owner??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.owner),i(r.clock)],data:ud().encode(c),programAddress:t})}function jce(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agent:t(),owner:t(),clock:t()},data:Q1().decode(n.data)}}var J1,xk=a(()=>{E();h();J1=new Uint8Array([164,219,91,38,45,31,33,47]);});function dse(){return fixEncoderSize(getBytesEncoder(),8).encode(Z1)}function gd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["paymentSignature",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["amount",getU64Encoder()],["responseTimeMs",getU64Encoder()],["success",getBooleanEncoder()]]),n=>({...n,discriminator:Z1}))}function Y1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["paymentSignature",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["amount",getU64Decoder()],["responseTimeMs",getU64Decoder()],["success",getBooleanDecoder()]])}function use(){return combineCodec(gd(),Y1())}async function gse(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.reputationMetrics.value||(r.reputationMetrics.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,112,117,116,97,116,105,111,110,95,109,101,116,114,105,99,115])),getAddressEncoder().encode(x(r.agent.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.authority),i(r.clock)],data:gd().encode(c),programAddress:t})}function Ase(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.authority),i(r.clock)],data:gd().encode(c),programAddress:t})}function pse(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reputationMetrics:t(),agent:t(),authority:t(),clock:t()},data:Y1().decode(n.data)}}var Z1,hk=a(()=>{E();h();Z1=new Uint8Array([165,202,159,139,65,65,36,163]);});function Pse(){return fixEncoderSize(getBytesEncoder(),8).encode(ey)}function fd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentType",getU8Encoder()],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["metadataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["pricingModel",J()]]),n=>({...n,discriminator:ey}))}function ty(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentType",getU8Decoder()],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["metadataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["pricingModel",Q()]])}function Ese(){return combineCodec(fd(),ty())}async function ny(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},stakingAccount:{value:n.stakingAccount??null,isWritable:false},signer:{value:n.signer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agentAccount.value||(r.agentAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(x(r.signer.value)),getUtf8Encoder().encode(I(c.agentId))]})),r.stakingAccount.value||(r.stakingAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103])),getAddressEncoder().encode(x(r.signer.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.stakingAccount),i(r.signer),i(r.systemProgram),i(r.clock)],data:fd().encode(c),programAddress:t})}function hse(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},stakingAccount:{value:n.stakingAccount??null,isWritable:false},signer:{value:n.signer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.stakingAccount),i(r.signer),i(r.systemProgram),i(r.clock)],data:fd().encode(c),programAddress:t})}function Cse(n){if(n.accounts.length<5)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),stakingAccount:t(),signer:t(),systemProgram:t(),clock:t()},data:ty().decode(n.data)}}var ey,Ik=a(()=>{E();h();m();ey=new Uint8Array([135,157,66,195,2,113,175,30]);});function _se(){return fixEncoderSize(getBytesEncoder(),8).encode(ry)}function Rd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentType",getU8Encoder()],["metadataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["pricingModel",J()]]),n=>({...n,discriminator:ry}))}function oy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentType",getU8Decoder()],["metadataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["pricingModel",Q()]])}function zse(){return combineCodec(Rd(),oy())}async function iy(n,e){let t=e?.programAddress??u,r={treeAuthority:{value:n.treeAuthority??null,isWritable:true},merkleTree:{value:n.merkleTree??null,isWritable:true},userRegistry:{value:n.userRegistry??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},compressionProgram:{value:n.compressionProgram??null,isWritable:false},logWrapper:{value:n.logWrapper??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.treeAuthority.value||(r.treeAuthority.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116,95,116,114,101,101,95,99,111,110,102,105,103])),getAddressEncoder().encode(x(r.signer.value))]})),r.userRegistry.value||(r.userRegistry.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114,95,114,101,103,105,115,116,114,121])),getAddressEncoder().encode(x(r.signer.value))]})),r.compressionProgram.value||(r.compressionProgram.value="cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK"),r.logWrapper.value||(r.logWrapper.value="noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV"),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.treeAuthority),i(r.merkleTree),i(r.userRegistry),i(r.signer),i(r.compressionProgram),i(r.logWrapper),i(r.systemProgram),i(r.clock)],data:Rd().encode(c),programAddress:t})}function Ose(n,e){let t=e?.programAddress??u,r={treeAuthority:{value:n.treeAuthority??null,isWritable:true},merkleTree:{value:n.merkleTree??null,isWritable:true},userRegistry:{value:n.userRegistry??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},compressionProgram:{value:n.compressionProgram??null,isWritable:false},logWrapper:{value:n.logWrapper??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.compressionProgram.value||(r.compressionProgram.value="cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK"),r.logWrapper.value||(r.logWrapper.value="noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV"),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.treeAuthority),i(r.merkleTree),i(r.userRegistry),i(r.signer),i(r.compressionProgram),i(r.logWrapper),i(r.systemProgram),i(r.clock)],data:Rd().encode(c),programAddress:t})}function Fse(n){if(n.accounts.length<8)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{treeAuthority:t(),merkleTree:t(),userRegistry:t(),signer:t(),compressionProgram:t(),logWrapper:t(),systemProgram:t(),clock:t()},data:oy().decode(n.data)}}var ry,wk=a(()=>{E();h();m();ry=new Uint8Array([15,6,94,55,65,80,123,248]);});function Hse(){return fixEncoderSize(getBytesEncoder(),8).encode(sy)}function bd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:sy}))}function ay(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function jse(){return combineCodec(bd(),ay())}async function $se(n,e){let t=e?.programAddress??u,r={reentrancyGuard:{value:n.reentrancyGuard??null,isWritable:true},authority:{value:n.authority??null,isWritable:true}};r.reentrancyGuard.value||(r.reentrancyGuard.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,101,110,116,114,97,110,99,121,95,103,117,97,114,100]))]}));let c=g(t);return Object.freeze({accounts:[c(r.reentrancyGuard),c(r.authority)],data:bd().encode({}),programAddress:t})}function qse(n,e){let t=e?.programAddress??u,r={reentrancyGuard:{value:n.reentrancyGuard??null,isWritable:true},authority:{value:n.authority??null,isWritable:true}},c=g(t);return Object.freeze({accounts:[c(r.reentrancyGuard),c(r.authority)],data:bd().encode({}),programAddress:t})}function Jse(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reentrancyGuard:t(),authority:t()},data:ay().decode(n.data)}}var sy,_k=a(()=>{E();h();sy=new Uint8Array([93,74,168,125,46,153,9,255]);});function oae(){return fixEncoderSize(getBytesEncoder(),8).encode(uy)}function Id(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:uy}))}function gy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function iae(){return combineCodec(Id(),gy())}async function cae(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:false},didController:{value:n.didController??null,isWritable:false}};r.didDocument.value||(r.didDocument.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([100,105,100,95,100,111,99,117,109,101,110,116])),getAddressEncoder().encode(x(r.didController.value))]}));let c=g(t);return Object.freeze({accounts:[c(r.didDocument),c(r.didController)],data:Id().encode({}),programAddress:t})}function sae(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:false},didController:{value:n.didController??null,isWritable:false}},c=g(t);return Object.freeze({accounts:[c(r.didDocument),c(r.didController)],data:Id().encode({}),programAddress:t})}function aae(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{didDocument:t(),didController:t()},data:gy().decode(n.data)}}var uy,Ok=a(()=>{E();h();uy=new Uint8Array([168,180,218,211,184,19,102,12]);});var Lk={};ne(Lk,{REVOKE_AUTHORIZATION_DISCRIMINATOR:()=>vd,getRevokeAuthorizationDiscriminatorBytes:()=>Wk,getRevokeAuthorizationInstruction:()=>Bk,getRevokeAuthorizationInstructionDataCodec:()=>Nk,getRevokeAuthorizationInstructionDataDecoder:()=>kd,getRevokeAuthorizationInstructionDataEncoder:()=>Md,parseRevokeAuthorizationInstruction:()=>Vk});function Wk(){return fixEncoderSize(getBytesEncoder(),8).encode(vd)}function Md(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["nonce",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:vd}))}function kd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["nonce",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function Nk(){return combineCodec(Md(),kd())}function Bk(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:false},authorization:{value:n.authorization??null,isWritable:true},authority:{value:n.authority??null,isWritable:false}},c={...n},i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.authorization),i(r.authority)],data:Md().encode(c),programAddress:t})}function Vk(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agent:t(),authorization:t(),authority:t()},data:kd().decode(n.data)}}var vd,Ay=a(()=>{E();h();vd=new Uint8Array([222,179,207,59,191,78,24,248]);});function vae(){return fixEncoderSize(getBytesEncoder(),8).encode(py)}function ly(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:py}))}function my(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function Mae(){return combineCodec(ly(),my())}function kae(n,e){let t=e?.programAddress??u,r={credential:{value:n.credential??null,isWritable:true},issuer:{value:n.issuer??null,isWritable:true}},c=g(t);return Object.freeze({accounts:[c(r.credential),c(r.issuer)],data:ly().encode({}),programAddress:t})}function wae(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credential:t(),issuer:t()},data:my().decode(n.data)}}var py,jk=a(()=>{E();h();py=new Uint8Array([38,123,95,95,223,158,169,87]);});function Kae(){return fixEncoderSize(getBytesEncoder(),8).encode(fy)}function wd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["owner",getAddressEncoder()],["reason",Qe()],["customAmount",getOptionEncoder(getU64Encoder())]]),n=>({...n,discriminator:fy}))}function Sy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["owner",getAddressDecoder()],["reason",Xe()],["customAmount",getOptionDecoder(getU64Decoder())]])}function Hae(){return combineCodec(wd(),Sy())}async function jae(n,e){let t=e?.programAddress??u,r={stakingAccount:{value:n.stakingAccount??null,isWritable:true},stakingConfig:{value:n.stakingConfig??null,isWritable:false},stakingVault:{value:n.stakingVault??null,isWritable:true},treasury:{value:n.treasury??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},tokenProgram:{value:n.tokenProgram??null,isWritable:false}},c={...n};r.stakingAccount.value||(r.stakingAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103])),getAddressEncoder().encode(I(c.owner))]})),r.stakingConfig.value||(r.stakingConfig.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103,95,99,111,110,102,105,103]))]})),r.stakingVault.value||(r.stakingVault.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103,95,118,97,117,108,116])),getAddressEncoder().encode(x(r.stakingConfig.value))]})),r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");let i=g(t);return Object.freeze({accounts:[i(r.stakingAccount),i(r.stakingConfig),i(r.stakingVault),i(r.treasury),i(r.authority),i(r.tokenProgram)],data:wd().encode(c),programAddress:t})}function $ae(n,e){let t=e?.programAddress??u,r={stakingAccount:{value:n.stakingAccount??null,isWritable:true},stakingConfig:{value:n.stakingConfig??null,isWritable:false},stakingVault:{value:n.stakingVault??null,isWritable:true},treasury:{value:n.treasury??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},tokenProgram:{value:n.tokenProgram??null,isWritable:false}},c={...n};r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");let i=g(t);return Object.freeze({accounts:[i(r.stakingAccount),i(r.stakingConfig),i(r.stakingVault),i(r.treasury),i(r.authority),i(r.tokenProgram)],data:wd().encode(c),programAddress:t})}function qae(n){if(n.accounts.length<6)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{stakingAccount:t(),stakingConfig:t(),stakingVault:t(),treasury:t(),authority:t(),tokenProgram:t()},data:Sy().decode(n.data)}}var fy,qk=a(()=>{E();h();m();fy=new Uint8Array([190,242,137,27,41,18,233,37]);});function ide(){return fixEncoderSize(getBytesEncoder(),8).encode(xy)}function _d(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["amount",getU64Encoder()],["lockDuration",getI64Encoder()]]),n=>({...n,discriminator:xy}))}function Dy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["amount",getU64Decoder()],["lockDuration",getI64Decoder()]])}function cde(){return combineCodec(_d(),Dy())}async function Py(n,e){let t=e?.programAddress??u,r={stakingAccount:{value:n.stakingAccount??null,isWritable:true},ownerTokenAccount:{value:n.ownerTokenAccount??null,isWritable:true},stakingVault:{value:n.stakingVault??null,isWritable:true},stakingConfig:{value:n.stakingConfig??null,isWritable:false},ghostMint:{value:n.ghostMint??null,isWritable:false},owner:{value:n.owner??null,isWritable:true},tokenProgram:{value:n.tokenProgram??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false},rent:{value:n.rent??null,isWritable:false}},c={...n};r.stakingAccount.value||(r.stakingAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103])),getAddressEncoder().encode(x(r.owner.value))]})),r.stakingVault.value||(r.stakingVault.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103,95,118,97,117,108,116])),getAddressEncoder().encode(x(r.stakingConfig.value))]})),r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.rent.value||(r.rent.value="SysvarRent111111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.stakingAccount),i(r.ownerTokenAccount),i(r.stakingVault),i(r.stakingConfig),i(r.ghostMint),i(r.owner),i(r.tokenProgram),i(r.systemProgram),i(r.rent)],data:_d().encode(c),programAddress:t})}function sde(n,e){let t=e?.programAddress??u,r={stakingAccount:{value:n.stakingAccount??null,isWritable:true},ownerTokenAccount:{value:n.ownerTokenAccount??null,isWritable:true},stakingVault:{value:n.stakingVault??null,isWritable:true},stakingConfig:{value:n.stakingConfig??null,isWritable:false},ghostMint:{value:n.ghostMint??null,isWritable:false},owner:{value:n.owner??null,isWritable:true},tokenProgram:{value:n.tokenProgram??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false},rent:{value:n.rent??null,isWritable:false}},c={...n};r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.rent.value||(r.rent.value="SysvarRent111111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.stakingAccount),i(r.ownerTokenAccount),i(r.stakingVault),i(r.stakingConfig),i(r.ghostMint),i(r.owner),i(r.tokenProgram),i(r.systemProgram),i(r.rent)],data:_d().encode(c),programAddress:t})}function ade(n){if(n.accounts.length<9)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{stakingAccount:t(),ownerTokenAccount:t(),stakingVault:t(),stakingConfig:t(),ghostMint:t(),owner:t(),tokenProgram:t(),systemProgram:t(),rent:t()},data:Dy().decode(n.data)}}var xy,Zk=a(()=>{E();h();xy=new Uint8Array([5,196,24,54,196,56,173,191]);});function Dde(){return fixEncoderSize(getBytesEncoder(),8).encode(Ey)}function hy(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["deliveryProof",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),n=>({...n,discriminator:Ey}))}function Cy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["deliveryProof",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function Pde(){return combineCodec(hy(),Cy())}function Ede(n,e){let t=e?.programAddress??u,r={escrow:{value:n.escrow??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},agentOwner:{value:n.agentOwner??null,isWritable:false}},c={...n},i=g(t);return Object.freeze({accounts:[i(r.escrow),i(r.agent),i(r.agentOwner)],data:hy().encode(c),programAddress:t})}function hde(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{escrow:t(),agent:t(),agentOwner:t()},data:Cy().decode(n.data)}}var Ey,tw=a(()=>{E();h();Ey=new Uint8Array([217,177,33,54,136,185,123,96]);});function Bde(){return fixEncoderSize(getBytesEncoder(),8).encode(by)}function zd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["rating",getU8Encoder()],["paymentSignature",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),n=>({...n,discriminator:by}))}function Iy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["rating",getU8Decoder()],["paymentSignature",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function Vde(){return combineCodec(zd(),Iy())}async function Lde(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},client:{value:n.client??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.reputationMetrics.value||(r.reputationMetrics.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,112,117,116,97,116,105,111,110,95,109,101,116,114,105,99,115])),getAddressEncoder().encode(x(r.agent.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.client),i(r.clock)],data:zd().encode(c),programAddress:t})}function Kde(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},client:{value:n.client??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.client),i(r.clock)],data:zd().encode(c),programAddress:t})}function Hde(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reputationMetrics:t(),agent:t(),client:t(),clock:t()},data:Iy().decode(n.data)}}var by,rw=a(()=>{E();h();by=new Uint8Array([23,160,228,88,168,145,129,19]);});function Zde(){return fixEncoderSize(getBytesEncoder(),8).encode(My)}function Od(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:My}))}function ky(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function Yde(){return combineCodec(Od(),ky())}async function wy(n,e){let t=e?.programAddress??u,r={stakingAccount:{value:n.stakingAccount??null,isWritable:true},stakingConfig:{value:n.stakingConfig??null,isWritable:false},stakingVault:{value:n.stakingVault??null,isWritable:true},ownerTokenAccount:{value:n.ownerTokenAccount??null,isWritable:true},owner:{value:n.owner??null,isWritable:true},tokenProgram:{value:n.tokenProgram??null,isWritable:false}};r.stakingAccount.value||(r.stakingAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103])),getAddressEncoder().encode(x(r.owner.value))]})),r.stakingConfig.value||(r.stakingConfig.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103,95,99,111,110,102,105,103]))]})),r.stakingVault.value||(r.stakingVault.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103,95,118,97,117,108,116])),getAddressEncoder().encode(x(r.stakingConfig.value))]})),r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");let c=g(t);return Object.freeze({accounts:[c(r.stakingAccount),c(r.stakingConfig),c(r.stakingVault),c(r.ownerTokenAccount),c(r.owner),c(r.tokenProgram)],data:Od().encode({}),programAddress:t})}function eue(n,e){let t=e?.programAddress??u,r={stakingAccount:{value:n.stakingAccount??null,isWritable:true},stakingConfig:{value:n.stakingConfig??null,isWritable:false},stakingVault:{value:n.stakingVault??null,isWritable:true},ownerTokenAccount:{value:n.ownerTokenAccount??null,isWritable:true},owner:{value:n.owner??null,isWritable:true},tokenProgram:{value:n.tokenProgram??null,isWritable:false}};r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");let c=g(t);return Object.freeze({accounts:[c(r.stakingAccount),c(r.stakingConfig),c(r.stakingVault),c(r.ownerTokenAccount),c(r.owner),c(r.tokenProgram)],data:Od().encode({}),programAddress:t})}function tue(n){if(n.accounts.length<6)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{stakingAccount:t(),stakingConfig:t(),stakingVault:t(),ownerTokenAccount:t(),owner:t(),tokenProgram:t()},data:ky().decode(n.data)}}var My,cw=a(()=>{E();h();My=new Uint8Array([252,101,172,252,1,4,12,116]);});function Aue(){return fixEncoderSize(getBytesEncoder(),8).encode(Oy)}function Vd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentType",getU8Encoder()],["name",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["description",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["metadataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["pricingModel",getOptionEncoder(J())]]),n=>({...n,discriminator:Oy}))}function Fy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentType",getU8Decoder()],["name",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["description",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["metadataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["pricingModel",getOptionDecoder(Q())]])}function pue(){return combineCodec(Vd(),Fy())}async function lue(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agentAccount.value||(r.agentAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(x(r.signer.value)),getUtf8Encoder().encode(I(c.agentId))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Vd().encode(c),programAddress:t})}function Gy(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Vd().encode(c),programAddress:t})}function mue(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),signer:t(),clock:t()},data:Fy().decode(n.data)}}var Oy,aw=a(()=>{E();h();m();Oy=new Uint8Array([85,2,178,9,119,139,102,164]);});function kue(){return fixEncoderSize(getBytesEncoder(),8).encode(Ny)}function Ld(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["reputationScore",getU64Encoder()]]),n=>({...n,discriminator:Ny}))}function By(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["reputationScore",getU64Decoder()]])}function wue(){return combineCodec(Ld(),By())}async function Uue(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agentAccount.value||(r.agentAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(x(r.signer.value)),getUtf8Encoder().encode(I(c.agentId))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Ld().encode(c),programAddress:t})}function _ue(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Ld().encode(c),programAddress:t})}function zue(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),signer:t(),clock:t()},data:By().decode(n.data)}}var Ny,gw=a(()=>{E();h();Ny=new Uint8Array([80,227,92,245,231,37,99,180]);});function Zue(){return fixEncoderSize(getBytesEncoder(),8).encode(Jy)}function Kd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentPubkey",getAddressEncoder()],["serviceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["isActive",getBooleanEncoder()],["lastUpdated",getI64Encoder()],["metadataUri",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["capabilities",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:Jy}))}function Qy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentPubkey",getAddressDecoder()],["serviceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["isActive",getBooleanDecoder()],["lastUpdated",getI64Decoder()],["metadataUri",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["capabilities",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function Yue(){return combineCodec(Kd(),Qy())}async function ege(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:true},owner:{value:n.owner??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.agent.value||(r.agent.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(x(r.owner.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.owner),i(r.systemProgram)],data:Kd().encode(c),programAddress:t})}function tge(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:true},owner:{value:n.owner??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.owner),i(r.systemProgram)],data:Kd().encode(c),programAddress:t})}function nge(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agent:t(),owner:t(),systemProgram:t()},data:Qy().decode(n.data)}}var Jy,lw=a(()=>{E();h();Jy=new Uint8Array([87,146,181,198,252,68,243,102]);});function mge(){return fixEncoderSize(getBytesEncoder(),8).encode(Xy)}function Zy(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["crossmintCredentialId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["status",Ke()]]),n=>({...n,discriminator:Xy}))}function Yy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["crossmintCredentialId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["status",He()]])}function yge(){return combineCodec(Zy(),Yy())}function Tge(n,e){let t=e?.programAddress??u,r={credential:{value:n.credential??null,isWritable:true},issuer:{value:n.issuer??null,isWritable:true}},c={...n},i=g(t);return Object.freeze({accounts:[i(r.credential),i(r.issuer)],data:Zy().encode(c),programAddress:t})}function fge(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credential:t(),issuer:t()},data:Yy().decode(n.data)}}var Xy,Tw=a(()=>{E();h();m();Xy=new Uint8Array([22,167,59,238,22,231,239,146]);});function bge(){return fixEncoderSize(getBytesEncoder(),8).encode(tT)}function $d(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["addVerificationMethod",getOptionEncoder(Te())],["removeVerificationMethodId",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["addServiceEndpoint",getOptionEncoder(me())],["removeServiceEndpointId",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:tT}))}function nT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["addVerificationMethod",getOptionDecoder(fe())],["removeVerificationMethodId",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["addServiceEndpoint",getOptionDecoder(ye())],["removeServiceEndpointId",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function Ige(){return combineCodec($d(),nT())}async function vge(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:true},controller:{value:n.controller??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.didDocument.value||(r.didDocument.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([100,105,100,95,100,111,99,117,109,101,110,116])),getAddressEncoder().encode(x(r.controller.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.didDocument),i(r.controller),i(r.clock)],data:$d().encode(c),programAddress:t})}function Mge(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:true},controller:{value:n.controller??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.didDocument),i(r.controller),i(r.clock)],data:$d().encode(c),programAddress:t})}function kge(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{didDocument:t(),controller:t(),clock:t()},data:nT().decode(n.data)}}var tT,Cw=a(()=>{E();h();m();tT=new Uint8Array([64,216,17,91,205,94,45,57]);});function Bge(){return fixEncoderSize(getBytesEncoder(),8).encode(cT)}function qd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["escrowFeeBps",getOptionEncoder(getU16Encoder())],["agentRegistrationFee",getOptionEncoder(getU64Encoder())],["listingFee",getOptionEncoder(getU64Encoder())],["disputeFeeBps",getOptionEncoder(getU16Encoder())],["feesEnabled",getOptionEncoder(getBooleanEncoder())],["treasury",getOptionEncoder(getAddressEncoder())],["buybackPool",getOptionEncoder(getAddressEncoder())],["moderatorPool",getOptionEncoder(getAddressEncoder())]]),n=>({...n,discriminator:cT}))}function sT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["escrowFeeBps",getOptionDecoder(getU16Decoder())],["agentRegistrationFee",getOptionDecoder(getU64Decoder())],["listingFee",getOptionDecoder(getU64Decoder())],["disputeFeeBps",getOptionDecoder(getU16Decoder())],["feesEnabled",getOptionDecoder(getBooleanDecoder())],["treasury",getOptionDecoder(getAddressDecoder())],["buybackPool",getOptionDecoder(getAddressDecoder())],["moderatorPool",getOptionDecoder(getAddressDecoder())]])}function Vge(){return combineCodec(qd(),sT())}async function Lge(n,e){let t=e?.programAddress??u,r={config:{value:n.config??null,isWritable:true},authority:{value:n.authority??null,isWritable:false}},c={...n};r.config.value||(r.config.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([112,114,111,116,111,99,111,108,95,99,111,110,102,105,103]))]}));let i=g(t);return Object.freeze({accounts:[i(r.config),i(r.authority)],data:qd().encode(c),programAddress:t})}function Kge(n,e){let t=e?.programAddress??u,r={config:{value:n.config??null,isWritable:true},authority:{value:n.authority??null,isWritable:false}},c={...n},i=g(t);return Object.freeze({accounts:[i(r.config),i(r.authority)],data:qd().encode(c),programAddress:t})}function Hge(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{config:t(),authority:t()},data:sT().decode(n.data)}}var cT,kw=a(()=>{E();h();cT=new Uint8Array([197,97,123,54,221,168,11,135]);});function eAe(){return fixEncoderSize(getBytesEncoder(),8).encode(mT)}function Xd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["skillTags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["behaviorTags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["complianceTags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["tagScores",getArrayEncoder(at())]]),n=>({...n,discriminator:mT}))}function yT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["skillTags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["behaviorTags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["complianceTags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["tagScores",getArrayDecoder(dt())]])}function tAe(){return combineCodec(Xd(),yT())}async function nAe(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.reputationMetrics.value||(r.reputationMetrics.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,112,117,116,97,116,105,111,110,95,109,101,116,114,105,99,115])),getAddressEncoder().encode(x(r.agent.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.authority),i(r.clock)],data:Xd().encode(c),programAddress:t})}function rAe(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.authority),i(r.clock)],data:Xd().encode(c),programAddress:t})}function oAe(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reputationMetrics:t(),agent:t(),authority:t(),clock:t()},data:yT().decode(n.data)}}var mT,Uw=a(()=>{E();h();m();mT=new Uint8Array([206,96,254,186,129,180,103,198]);});var Vw={};ne(Vw,{UPDATE_REPUTATION_WITH_AUTH_DISCRIMINATOR:()=>nu,getUpdateReputationWithAuthDiscriminatorBytes:()=>Fw,getUpdateReputationWithAuthInstruction:()=>Nw,getUpdateReputationWithAuthInstructionAsync:()=>Ww,getUpdateReputationWithAuthInstructionDataCodec:()=>Gw,getUpdateReputationWithAuthInstructionDataDecoder:()=>ru,getUpdateReputationWithAuthInstructionDataEncoder:()=>Jt,parseUpdateReputationWithAuthInstruction:()=>Bw});function Fw(){return fixEncoderSize(getBytesEncoder(),8).encode(nu)}function Jt(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["reputationChange",getI64Encoder()],["transactionSignature",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["metadata",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["nonce",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:nu}))}function ru(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["reputationChange",getI64Decoder()],["transactionSignature",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["metadata",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["nonce",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function Gw(){return combineCodec(Jt(),ru())}async function Ww(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:false},reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},authorization:{value:n.authorization??null,isWritable:true},usageRecord:{value:n.usageRecord??null,isWritable:true},authorizedSource:{value:n.authorizedSource??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.reputationMetrics.value||(r.reputationMetrics.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,112,117,116,97,116,105,111,110,95,109,101,116,114,105,99,115])),getAddressEncoder().encode(x(r.agent.value))]})),r.authorization.value||(r.authorization.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116,95,97,117,116,104])),getAddressEncoder().encode(x(r.agent.value)),getAddressEncoder().encode(x(r.authorizedSource.value)),getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())).encode(I(c.nonce))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.reputationMetrics),i(r.authorization),i(r.usageRecord),i(r.authorizedSource),i(r.systemProgram),i(r.clock)],data:Jt().encode(c),programAddress:t})}function Nw(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:false},reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},authorization:{value:n.authorization??null,isWritable:true},usageRecord:{value:n.usageRecord??null,isWritable:true},authorizedSource:{value:n.authorizedSource??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.reputationMetrics),i(r.authorization),i(r.usageRecord),i(r.authorizedSource),i(r.systemProgram),i(r.clock)],data:Jt().encode(c),programAddress:t})}function Bw(n){if(n.accounts.length<7)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agent:t(),reputationMetrics:t(),authorization:t(),usageRecord:t(),authorizedSource:t(),systemProgram:t(),clock:t()},data:ru().decode(n.data)}}var nu,PT=a(()=>{E();h();nu=new Uint8Array([61,236,225,167,134,43,53,93]);});function CAe(){return fixEncoderSize(getBytesEncoder(),8).encode(RT)}function ou(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["sourceName",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["score",getU16Encoder()],["weight",getU16Encoder()],["dataPoints",getU32Encoder()],["reliability",getU16Encoder()]]),n=>({...n,discriminator:RT}))}function bT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["sourceName",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["score",getU16Decoder()],["weight",getU16Decoder()],["dataPoints",getU32Decoder()],["reliability",getU16Decoder()]])}function RAe(){return combineCodec(ou(),bT())}async function bAe(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.reputationMetrics.value||(r.reputationMetrics.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,112,117,116,97,116,105,111,110,95,109,101,116,114,105,99,115])),getAddressEncoder().encode(x(r.agent.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.authority),i(r.clock)],data:ou().encode(c),programAddress:t})}function IAe(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.authority),i(r.clock)],data:ou().encode(c),programAddress:t})}function vAe(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reputationMetrics:t(),agent:t(),authority:t(),clock:t()},data:bT().decode(n.data)}}var RT,jw=a(()=>{E();h();RT=new Uint8Array([161,240,255,69,130,227,71,123]);});function QAe(){return fixEncoderSize(getBytesEncoder(),8).encode(MT)}function iu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentPubkey",getAddressEncoder()],["serviceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["supportedCapabilities",getArrayEncoder(getU64Encoder())],["verifiedAt",getI64Encoder()]]),n=>({...n,discriminator:MT}))}function kT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentPubkey",getAddressDecoder()],["serviceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["supportedCapabilities",getArrayDecoder(getU64Decoder())],["verifiedAt",getI64Decoder()]])}function XAe(){return combineCodec(iu(),kT())}async function wT(n,e){let t=e?.programAddress??u,r={agentVerification:{value:n.agentVerification??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},verifier:{value:n.verifier??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agentVerification.value||(r.agentVerification.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116,95,118,101,114,105,102,105,99,97,116,105,111,110])),getAddressEncoder().encode(x(r.agent.value)),getAddressEncoder().encode(x(r.verifier.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentVerification),i(r.agent),i(r.verifier),i(r.systemProgram),i(r.clock)],data:iu().encode(c),programAddress:t})}function ZAe(n,e){let t=e?.programAddress??u,r={agentVerification:{value:n.agentVerification??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},verifier:{value:n.verifier??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentVerification),i(r.agent),i(r.verifier),i(r.systemProgram),i(r.clock)],data:iu().encode(c),programAddress:t})}function YAe(n){if(n.accounts.length<5)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentVerification:t(),agent:t(),verifier:t(),systemProgram:t(),clock:t()},data:kT().decode(n.data)}}var MT,qw=a(()=>{E();h();MT=new Uint8Array([206,212,108,12,105,61,100,66]);});function lpe(){return fixEncoderSize(getBytesEncoder(),8).encode(UT)}function _T(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["nonce",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:UT}))}function zT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["nonce",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function mpe(){return combineCodec(_T(),zT())}function ype(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:false},authorization:{value:n.authorization??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.authorization),i(r.clock)],data:_T().encode(c),programAddress:t})}function Tpe(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agent:t(),authorization:t(),clock:t()},data:zT().decode(n.data)}}var UT,Xw=a(()=>{E();h();UT=new Uint8Array([43,9,131,59,74,118,113,170]);});var Zw=a(()=>{Bv();Kv();$v();Rm();sM();dM();pM();yM();xM();EM();RM();vM();kM();UM();OM();BM();LM();ZM();ek();nk();ok();ck();ak();fk();xk();hk();Ik();wk();_k();Ok();Ay();jk();qk();Zk();tw();rw();cw();aw();gw();lw();Tw();Cw();kw();Uw();PT();jw();qw();Xw();});var cu={};ne(cu,{ACTIVATE_AGENT_DISCRIMINATOR:()=>mm,AGENT_DISCRIMINATOR:()=>ZA,AGENT_REPUTATION_AUTH_DISCRIMINATOR:()=>rp,AGENT_TREE_CONFIG_DISCRIMINATOR:()=>cp,AGENT_VERIFICATION_DISCRIMINATOR:()=>dp,APPROVE_DELIVERY_DISCRIMINATOR:()=>fm,ARBITRATE_DISPUTE_DISCRIMINATOR:()=>Dm,AUDIT_TRAIL_DISCRIMINATOR:()=>lp,AUTHORIZATION_USAGE_RECORD_DISCRIMINATOR:()=>Sp,AccessTier:()=>Cn,ActionType:()=>Ff,ActivationRequirementType:()=>_n,AuditAction:()=>Jn,AuthenticationLevel:()=>cr,AuthenticationMethod:()=>dr,BackupFrequency:()=>Pr,BiometricStorageMethod:()=>vr,BiometricType:()=>Mr,COMPLIANCE_REPORT_DISCRIMINATOR:()=>Rp,CREATE_AGENT_AUTHORIZATION_DISCRIMINATOR:()=>Va,CREATE_CREDENTIAL_TEMPLATE_DISCRIMINATOR:()=>Um,CREATE_CREDENTIAL_TYPE_DISCRIMINATOR:()=>Bm,CREATE_DID_DOCUMENT_DISCRIMINATOR:()=>Km,CREATE_ESCROW_DISCRIMINATOR:()=>qm,CREATE_MULTISIG_DISCRIMINATOR:()=>Xm,CREDENTIAL_DISCRIMINATOR:()=>Wp,CREDENTIAL_TEMPLATE_DISCRIMINATOR:()=>qp,CREDENTIAL_TYPE_DISCRIMINATOR:()=>rl,ConditionType:()=>Fr,ConstraintOperator:()=>Kr,CredentialKind:()=>Hr,CredentialStatus:()=>jr,CrossChainStatus:()=>Jr,DEACTIVATE_AGENT_DISCRIMINATOR:()=>e1,DEACTIVATE_CREDENTIAL_TEMPLATE_DISCRIMINATOR:()=>r1,DEACTIVATE_CREDENTIAL_TYPE_DISCRIMINATOR:()=>c1,DEACTIVATE_DID_DOCUMENT_DISCRIMINATOR:()=>u1,DID_DOCUMENT_DISCRIMINATOR:()=>Al,DataAccessLevel:()=>Qr,DegradationHandling:()=>to,ENABLE_PROTOCOL_FEES_DISCRIMINATOR:()=>p1,EnforcementLevel:()=>go,EscrowStatus:()=>Ao,FILE_DISPUTE_DISCRIMINATOR:()=>m1,GENERATE_COMPLIANCE_REPORT_DISCRIMINATOR:()=>S1,GHOSTSPEAK_MARKETPLACE_ERROR__ALREADY_DEACTIVATED:()=>Cv,GHOSTSPEAK_MARKETPLACE_ERROR__DID_DEACTIVATED:()=>_v,GHOSTSPEAK_MARKETPLACE_ERROR__DUPLICATE_METHOD_ID:()=>Iv,GHOSTSPEAK_MARKETPLACE_ERROR__DUPLICATE_SERVICE_ID:()=>vv,GHOSTSPEAK_MARKETPLACE_ERROR__INVALID_DID_FORMAT:()=>wv,GHOSTSPEAK_MARKETPLACE_ERROR__METHOD_NOT_FOUND:()=>Mv,GHOSTSPEAK_MARKETPLACE_ERROR__SERVICE_NOT_FOUND:()=>kv,GHOSTSPEAK_MARKETPLACE_ERROR__TOO_MANY_SERVICE_ENDPOINTS:()=>bv,GHOSTSPEAK_MARKETPLACE_ERROR__TOO_MANY_VERIFICATION_METHODS:()=>Rv,GHOSTSPEAK_MARKETPLACE_ERROR__UNAUTHORIZED_DID_OPERATION:()=>Uv,GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS:()=>u,GHOST_PROTECT_ESCROW_DISCRIMINATOR:()=>Cl,GOVERNANCE_PROPOSAL_DISCRIMINATOR:()=>Ml,GhostspeakMarketplaceAccount:()=>Pv,GhostspeakMarketplaceInstruction:()=>Ev,INITIALIZE_AUDIT_TRAIL_DISCRIMINATOR:()=>P1,INITIALIZE_GOVERNANCE_PROPOSAL_DISCRIMINATOR:()=>C1,INITIALIZE_PROTOCOL_CONFIG_DISCRIMINATOR:()=>I1,INITIALIZE_RBAC_CONFIG_DISCRIMINATOR:()=>k1,INITIALIZE_REPUTATION_METRICS_DISCRIMINATOR:()=>_1,INITIALIZE_STAKING_CONFIG_DISCRIMINATOR:()=>F1,INIT_REENTRANCY_GUARD_DISCRIMINATOR:()=>B1,ISSUE_CREDENTIAL_DISCRIMINATOR:()=>j1,MANAGE_AGENT_STATUS_DISCRIMINATOR:()=>J1,MULTISIG_DISCRIMINATOR:()=>zl,MultisigType:()=>Fo,NotificationMethod:()=>Vo,NotificationPriority:()=>Ho,NotificationTargetType:()=>ni,NotificationTiming:()=>ri,PROTOCOL_CONFIG_DISCRIMINATOR:()=>Nl,PermissionConstraintType:()=>Mi,PolicyStatus:()=>$i,PolicyType:()=>qi,PricingModel:()=>Dt,ProposalStatus:()=>tc,ProposalType:()=>Pt,QuorumMethod:()=>oc,RBAC_CONFIG_DISCRIMINATOR:()=>$l,RECORD_PAYAI_PAYMENT_DISCRIMINATOR:()=>Z1,REENTRANCY_GUARD_DISCRIMINATOR:()=>Ql,REGISTER_AGENT_COMPRESSED_DISCRIMINATOR:()=>ry,REGISTER_AGENT_DISCRIMINATOR:()=>ey,REPUTATION_METRICS_DISCRIMINATOR:()=>Yl,RESET_REENTRANCY_GUARD_DISCRIMINATOR:()=>sy,RESOLVE_DID_DOCUMENT_DISCRIMINATOR:()=>uy,REVOKE_AUTHORIZATION_DISCRIMINATOR:()=>vd,REVOKE_CREDENTIAL_DISCRIMINATOR:()=>py,ReentrancyState:()=>dc,ReportStatus:()=>Dc,ReportType:()=>hc,ReportingFrequency:()=>xc,RiskCategory:()=>Fc,RiskLevel:()=>Kc,RoleStatus:()=>ds,RoleType:()=>us,RuleEffect:()=>gs,SLASH_STAKE_DISCRIMINATOR:()=>fy,STAKE_GHOST_DISCRIMINATOR:()=>xy,STAKING_ACCOUNT_DISCRIMINATOR:()=>om,STAKING_CONFIG_DISCRIMINATOR:()=>sm,SUBMIT_DELIVERY_DISCRIMINATOR:()=>Ey,SUBMIT_SERVICE_RATING_DISCRIMINATOR:()=>by,ScopeInheritance:()=>fs,ScopeType:()=>Ss,SecurityEventType:()=>xs,ServiceEndpointType:()=>bs,SlashReason:()=>Is,SodConstraintType:()=>ks,StepUpTrigger:()=>_s,TimeLockType:()=>Ws,TransactionPriority:()=>Ns,TransactionStatus:()=>Bs,TransactionType:()=>Vs,TrendDirection:()=>Ls,UNSTAKE_GHOST_DISCRIMINATOR:()=>My,UPDATE_AGENT_DISCRIMINATOR:()=>Oy,UPDATE_AGENT_REPUTATION_DISCRIMINATOR:()=>Ny,UPDATE_AGENT_SERVICE_DISCRIMINATOR:()=>Jy,UPDATE_CROSSCHAIN_STATUS_DISCRIMINATOR:()=>Xy,UPDATE_DID_DOCUMENT_DISCRIMINATOR:()=>tT,UPDATE_PROTOCOL_CONFIG_DISCRIMINATOR:()=>cT,UPDATE_REPUTATION_TAGS_DISCRIMINATOR:()=>mT,UPDATE_REPUTATION_WITH_AUTH_DISCRIMINATOR:()=>nu,UPDATE_SOURCE_REPUTATION_DISCRIMINATOR:()=>RT,USER_REGISTRY_DISCRIMINATOR:()=>um,UnlockMethod:()=>Ks,VERIFY_AGENT_DISCRIMINATOR:()=>MT,VERIFY_AUTHORIZATION_DISCRIMINATOR:()=>UT,ValueType:()=>Hs,VerificationMethodType:()=>Qs,VerificationRelationship:()=>Xs,ViolationSeverity:()=>Zs,VoteChoice:()=>ra,arbitratorDecision:()=>xz,decodeAgent:()=>ep,decodeAgentReputationAuth:()=>ip,decodeAgentTreeConfig:()=>ap,decodeAgentVerification:()=>gp,decodeAuditTrail:()=>yp,decodeAuthorizationUsageRecord:()=>Dp,decodeComplianceReport:()=>Ip,decodeCredential:()=>Bp,decodeCredentialTemplate:()=>Qp,decodeCredentialType:()=>il,decodeDidDocument:()=>ll,decodeGhostProtectEscrow:()=>bl,decodeGovernanceProposal:()=>wl,decodeMultisig:()=>Fl,decodeProtocolConfig:()=>Vl,decodeRbacConfig:()=>Jl,decodeReentrancyGuard:()=>Zl,decodeReputationMetrics:()=>tm,decodeStakingAccount:()=>cm,decodeStakingConfig:()=>dm,decodeUserRegistry:()=>Am,delegationScope:()=>lG,fetchAgent:()=>Uj,fetchAgentReputationAuth:()=>e$,fetchAgentTreeConfig:()=>S$,fetchAgentVerification:()=>W$,fetchAllAgent:()=>_j,fetchAllAgentReputationAuth:()=>t$,fetchAllAgentTreeConfig:()=>x$,fetchAllAgentVerification:()=>N$,fetchAllAuditTrail:()=>iq,fetchAllAuthorizationUsageRecord:()=>Rq,fetchAllComplianceReport:()=>Lq,fetchAllCredential:()=>oJ,fetchAllCredentialTemplate:()=>vJ,fetchAllCredentialType:()=>eQ,fetchAllDidDocument:()=>EQ,fetchAllGhostProtectEscrow:()=>NQ,fetchAllGovernanceProposal:()=>iX,fetchAllMaybeAgent:()=>gR,fetchAllMaybeAgentReputationAuth:()=>CR,fetchAllMaybeAgentTreeConfig:()=>UR,fetchAllMaybeAgentVerification:()=>LR,fetchAllMaybeAuditTrail:()=>XR,fetchAllMaybeAuthorizationUsageRecord:()=>gb,fetchAllMaybeComplianceReport:()=>mb,fetchAllMaybeCredential:()=>Sb,fetchAllMaybeCredentialTemplate:()=>bb,fetchAllMaybeCredentialType:()=>Ub,fetchAllMaybeDidDocument:()=>Wb,fetchAllMaybeGhostProtectEscrow:()=>$b,fetchAllMaybeGovernanceProposal:()=>iI,fetchAllMaybeMultisig:()=>SI,fetchAllMaybeProtocolConfig:()=>vI,fetchAllMaybeRbacConfig:()=>FI,fetchAllMaybeReentrancyGuard:()=>LI,fetchAllMaybeReputationMetrics:()=>JI,fetchAllMaybeStakingAccount:()=>rv,fetchAllMaybeStakingConfig:()=>pv,fetchAllMaybeUserRegistry:()=>Sv,fetchAllMultisig:()=>xX,fetchAllProtocolConfig:()=>WX,fetchAllRbacConfig:()=>rZ,fetchAllReentrancyGuard:()=>RZ,fetchAllReputationMetrics:()=>jZ,fetchAllStakingAccount:()=>mY,fetchAllStakingConfig:()=>FY,fetchAllUserRegistry:()=>see,fetchAuditTrail:()=>oq,fetchAuthorizationUsageRecord:()=>Cq,fetchComplianceReport:()=>Vq,fetchCredential:()=>rJ,fetchCredentialTemplate:()=>IJ,fetchCredentialType:()=>YJ,fetchDidDocument:()=>PQ,fetchGhostProtectEscrow:()=>WQ,fetchGovernanceProposal:()=>oX,fetchMaybeAgent:()=>uR,fetchMaybeAgentReputationAuth:()=>hR,fetchMaybeAgentTreeConfig:()=>wR,fetchMaybeAgentVerification:()=>VR,fetchMaybeAuditTrail:()=>QR,fetchMaybeAuthorizationUsageRecord:()=>ub,fetchMaybeComplianceReport:()=>lb,fetchMaybeCredential:()=>fb,fetchMaybeCredentialTemplate:()=>Rb,fetchMaybeCredentialType:()=>wb,fetchMaybeDidDocument:()=>Gb,fetchMaybeGhostProtectEscrow:()=>jb,fetchMaybeGovernanceProposal:()=>oI,fetchMaybeMultisig:()=>fI,fetchMaybeProtocolConfig:()=>II,fetchMaybeRbacConfig:()=>OI,fetchMaybeReentrancyGuard:()=>VI,fetchMaybeReputationMetrics:()=>qI,fetchMaybeStakingAccount:()=>nv,fetchMaybeStakingConfig:()=>Av,fetchMaybeUserRegistry:()=>fv,fetchMultisig:()=>SX,fetchProtocolConfig:()=>GX,fetchRbacConfig:()=>nZ,fetchReentrancyGuard:()=>CZ,fetchReputationMetrics:()=>HZ,fetchStakingAccount:()=>lY,fetchStakingConfig:()=>OY,fetchUserRegistry:()=>cee,getAccessAuditConfigCodec:()=>W0,getAccessAuditConfigDecoder:()=>An,getAccessAuditConfigEncoder:()=>gn,getAccessPolicyCodec:()=>J0,getAccessPolicyDecoder:()=>ln,getAccessPolicyEncoder:()=>pn,getAccessTierCodec:()=>Y0,getAccessTierDecoder:()=>L,getAccessTierEncoder:()=>V,getAccountLockoutPoliciesCodec:()=>dU,getAccountLockoutPoliciesDecoder:()=>bn,getAccountLockoutPoliciesEncoder:()=>Rn,getActionCodec:()=>kU,getActionConstraintCodec:()=>zU,getActionConstraintDecoder:()=>Gn,getActionConstraintEncoder:()=>Fn,getActionDecoder:()=>On,getActionEncoder:()=>zn,getActionTypeCodec:()=>WU,getActionTypeDecoder:()=>Nn,getActionTypeEncoder:()=>Wn,getActivateAgentDiscriminatorBytes:()=>vee,getActivateAgentInstruction:()=>Tm,getActivateAgentInstructionAsync:()=>kee,getActivateAgentInstructionDataCodec:()=>Mee,getActivateAgentInstructionDataDecoder:()=>ym,getActivateAgentInstructionDataEncoder:()=>Na,getActivationRequirementCodec:()=>CU,getActivationRequirementDecoder:()=>kn,getActivationRequirementEncoder:()=>Mn,getActivationRequirementTypeCodec:()=>vU,getActivationRequirementTypeDecoder:()=>Un,getActivationRequirementTypeEncoder:()=>wn,getAgentCodec:()=>wj,getAgentDecoder:()=>YA,getAgentDiscriminatorBytes:()=>kj,getAgentEncoder:()=>dR,getAgentRegisteredEventCodec:()=>XU,getAgentRegisteredEventDecoder:()=>Vf,getAgentRegisteredEventEncoder:()=>Bf,getAgentReputationAuthCodec:()=>Yj,getAgentReputationAuthDecoder:()=>op,getAgentReputationAuthDiscriminatorBytes:()=>Zj,getAgentReputationAuthEncoder:()=>ER,getAgentServiceUpdatedEventCodec:()=>g_,getAgentServiceUpdatedEventDecoder:()=>$f,getAgentServiceUpdatedEventEncoder:()=>jf,getAgentStatusChangedEventCodec:()=>T_,getAgentStatusChangedEventDecoder:()=>eS,getAgentStatusChangedEventEncoder:()=>Yf,getAgentTreeConfigCodec:()=>f$,getAgentTreeConfigDecoder:()=>sp,getAgentTreeConfigDiscriminatorBytes:()=>T$,getAgentTreeConfigEncoder:()=>kR,getAgentTreeConfigSize:()=>D$,getAgentUpdatedEventCodec:()=>E_,getAgentUpdatedEventDecoder:()=>iS,getAgentUpdatedEventEncoder:()=>oS,getAgentVerificationCodec:()=>G$,getAgentVerificationDataCodec:()=>B_,getAgentVerificationDataDecoder:()=>Vn,getAgentVerificationDataEncoder:()=>Bn,getAgentVerificationDecoder:()=>up,getAgentVerificationDiscriminatorBytes:()=>F$,getAgentVerificationEncoder:()=>BR,getAgingPolicyCodec:()=>tz,getAgingPolicyDecoder:()=>Kn,getAgingPolicyEncoder:()=>Ln,getApprovalLevelCodec:()=>pz,getApprovalLevelDecoder:()=>qn,getApprovalLevelEncoder:()=>$n,getApproveDeliveryDiscriminatorBytes:()=>Wee,getApproveDeliveryInstruction:()=>Bee,getApproveDeliveryInstructionDataCodec:()=>Nee,getApproveDeliveryInstructionDataDecoder:()=>xm,getApproveDeliveryInstructionDataEncoder:()=>Sm,getArbitrateDisputeDiscriminatorBytes:()=>Jee,getArbitrateDisputeInstruction:()=>Xee,getArbitrateDisputeInstructionDataCodec:()=>Qee,getArbitrateDisputeInstructionDataDecoder:()=>Em,getArbitrateDisputeInstructionDataEncoder:()=>Pm,getArbitratorDecisionCodec:()=>Sz,getArbitratorDecisionDecoder:()=>oe,getArbitratorDecisionEncoder:()=>re,getAuditActionCodec:()=>Cz,getAuditActionDecoder:()=>ze,getAuditActionEncoder:()=>_e,getAuditConfigCodec:()=>zz,getAuditConfigDecoder:()=>Fe,getAuditConfigEncoder:()=>Oe,getAuditContextCodec:()=>Hz,getAuditContextDecoder:()=>tr,getAuditContextEncoder:()=>er,getAuditEntryCodec:()=>Yz,getAuditEntryDecoder:()=>rr,getAuditEntryEncoder:()=>nr,getAuditTrailCodec:()=>rq,getAuditTrailDecoder:()=>mp,getAuditTrailDiscriminatorBytes:()=>nq,getAuditTrailEncoder:()=>JR,getAuditTrailInitializedEventCodec:()=>pO,getAuditTrailInitializedEventDecoder:()=>hS,getAuditTrailInitializedEventEncoder:()=>ES,getAuthenticationLevelCodec:()=>TO,getAuthenticationLevelDecoder:()=>ar,getAuthenticationLevelEncoder:()=>sr,getAuthenticationMethodCodec:()=>DO,getAuthenticationMethodDecoder:()=>gr,getAuthenticationMethodEncoder:()=>ur,getAuthenticationPoliciesCodec:()=>kO,getAuthenticationPoliciesDecoder:()=>pr,getAuthenticationPoliciesEncoder:()=>Ar,getAuthenticationStrengthCodec:()=>FO,getAuthenticationStrengthDecoder:()=>mr,getAuthenticationStrengthEncoder:()=>lr,getAuthorizationPoliciesCodec:()=>BO,getAuthorizationPoliciesDecoder:()=>Dr,getAuthorizationPoliciesEncoder:()=>xr,getAuthorizationUsageRecordCodec:()=>hq,getAuthorizationUsageRecordDecoder:()=>xp,getAuthorizationUsageRecordDiscriminatorBytes:()=>Eq,getAuthorizationUsageRecordEncoder:()=>db,getBackupFrequencyCodec:()=>HO,getBackupFrequencyDecoder:()=>Xn,getBackupFrequencyEncoder:()=>Qn,getBiometricPoliciesCodec:()=>YO,getBiometricPoliciesDecoder:()=>Tr,getBiometricPoliciesEncoder:()=>yr,getBiometricProtectionCodec:()=>i8,getBiometricProtectionDecoder:()=>hr,getBiometricProtectionEncoder:()=>Er,getBiometricQualityCodec:()=>S8,getBiometricQualityDecoder:()=>Rr,getBiometricQualityEncoder:()=>Cr,getBiometricStorageMethodCodec:()=>d8,getBiometricStorageMethodDecoder:()=>Ir,getBiometricStorageMethodEncoder:()=>br,getBiometricTypeCodec:()=>p8,getBiometricTypeDecoder:()=>Ue,getBiometricTypeEncoder:()=>we,getComplianceFlagsCodec:()=>k8,getComplianceFlagsDecoder:()=>ir,getComplianceFlagsEncoder:()=>or,getComplianceMetricsCodec:()=>F8,getComplianceMetricsDecoder:()=>wr,getComplianceMetricsEncoder:()=>kr,getCompliancePoliciesCodec:()=>B8,getCompliancePoliciesDecoder:()=>_r,getCompliancePoliciesEncoder:()=>Ur,getComplianceReportCodec:()=>Bq,getComplianceReportDecoder:()=>bp,getComplianceReportDiscriminatorBytes:()=>Nq,getComplianceReportEncoder:()=>pb,getComplianceReportGeneratedEventCodec:()=>rF,getComplianceReportGeneratedEventDecoder:()=>ox,getComplianceReportGeneratedEventEncoder:()=>rx,getComplianceStatusCodec:()=>X8,getComplianceStatusDecoder:()=>Or,getComplianceStatusEncoder:()=>zr,getCompressedAgentCreatedEventCodec:()=>mF,getCompressedAgentCreatedEventDecoder:()=>px,getCompressedAgentCreatedEventEncoder:()=>Ax,getConditionTypeCodec:()=>SF,getConditionTypeDecoder:()=>Be,getConditionTypeEncoder:()=>Ne,getConstraintConditionCodec:()=>EF,getConstraintConditionDecoder:()=>Wr,getConstraintConditionEncoder:()=>Gr,getConstraintOperatorCodec:()=>bF,getConstraintOperatorDecoder:()=>Br,getConstraintOperatorEncoder:()=>Nr,getCreateAgentAuthorizationDiscriminatorBytes:()=>eM,getCreateAgentAuthorizationInstruction:()=>rM,getCreateAgentAuthorizationInstructionAsync:()=>nM,getCreateAgentAuthorizationInstructionDataCodec:()=>tM,getCreateAgentAuthorizationInstructionDataDecoder:()=>La,getCreateAgentAuthorizationInstructionDataEncoder:()=>Lt,getCreateCredentialTemplateDiscriminatorBytes:()=>Cte,getCreateCredentialTemplateInstruction:()=>Ite,getCreateCredentialTemplateInstructionAsync:()=>bte,getCreateCredentialTemplateInstructionDataCodec:()=>Rte,getCreateCredentialTemplateInstructionDataDecoder:()=>_m,getCreateCredentialTemplateInstructionDataEncoder:()=>Ha,getCreateCredentialTypeDiscriminatorBytes:()=>Fte,getCreateCredentialTypeInstruction:()=>Nte,getCreateCredentialTypeInstructionAsync:()=>Wte,getCreateCredentialTypeInstructionDataCodec:()=>Gte,getCreateCredentialTypeInstructionDataDecoder:()=>Vm,getCreateCredentialTypeInstructionDataEncoder:()=>$a,getCreateDidDocumentDiscriminatorBytes:()=>nne,getCreateDidDocumentInstruction:()=>ine,getCreateDidDocumentInstructionAsync:()=>one,getCreateDidDocumentInstructionDataCodec:()=>rne,getCreateDidDocumentInstructionDataDecoder:()=>Hm,getCreateDidDocumentInstructionDataEncoder:()=>qa,getCreateEscrowDiscriminatorBytes:()=>Ene,getCreateEscrowInstruction:()=>Rne,getCreateEscrowInstructionAsync:()=>Cne,getCreateEscrowInstructionDataCodec:()=>hne,getCreateEscrowInstructionDataDecoder:()=>Jm,getCreateEscrowInstructionDataEncoder:()=>Ja,getCreateMultisigDiscriminatorBytes:()=>Bne,getCreateMultisigInstruction:()=>Kne,getCreateMultisigInstructionAsync:()=>Lne,getCreateMultisigInstructionDataCodec:()=>Vne,getCreateMultisigInstructionDataDecoder:()=>Zm,getCreateMultisigInstructionDataEncoder:()=>Qa,getCredentialCodec:()=>nJ,getCredentialDecoder:()=>Np,getCredentialDiscriminatorBytes:()=>tJ,getCredentialEncoder:()=>Tb,getCredentialKindCodec:()=>kF,getCredentialKindDecoder:()=>Le,getCredentialKindEncoder:()=>Ve,getCredentialStatusCodec:()=>zF,getCredentialStatusDecoder:()=>qr,getCredentialStatusEncoder:()=>$r,getCredentialTemplateCodec:()=>bJ,getCredentialTemplateDecoder:()=>Jp,getCredentialTemplateDiscriminatorBytes:()=>RJ,getCredentialTemplateEncoder:()=>Cb,getCredentialTypeCodec:()=>ZJ,getCredentialTypeDecoder:()=>ol,getCredentialTypeDiscriminatorBytes:()=>XJ,getCredentialTypeEncoder:()=>kb,getCrossChainStatusCodec:()=>WF,getCrossChainStatusDecoder:()=>He,getCrossChainStatusEncoder:()=>Ke,getDataAccessLevelCodec:()=>LF,getDataAccessLevelDecoder:()=>Zr,getDataAccessLevelEncoder:()=>Xr,getDataProtectionPoliciesCodec:()=>$F,getDataProtectionPoliciesDecoder:()=>eo,getDataProtectionPoliciesEncoder:()=>Yr,getDeactivateAgentDiscriminatorBytes:()=>ire,getDeactivateAgentInstruction:()=>n1,getDeactivateAgentInstructionAsync:()=>sre,getDeactivateAgentInstructionDataCodec:()=>cre,getDeactivateAgentInstructionDataDecoder:()=>t1,getDeactivateAgentInstructionDataEncoder:()=>Xa,getDeactivateCredentialTemplateDiscriminatorBytes:()=>mre,getDeactivateCredentialTemplateInstruction:()=>Tre,getDeactivateCredentialTemplateInstructionDataCodec:()=>yre,getDeactivateCredentialTemplateInstructionDataDecoder:()=>i1,getDeactivateCredentialTemplateInstructionDataEncoder:()=>o1,getDeactivateCredentialTypeDiscriminatorBytes:()=>Cre,getDeactivateCredentialTypeInstruction:()=>bre,getDeactivateCredentialTypeInstructionDataCodec:()=>Rre,getDeactivateCredentialTypeInstructionDataDecoder:()=>a1,getDeactivateCredentialTypeInstructionDataEncoder:()=>s1,getDeactivateDidDocumentDiscriminatorBytes:()=>Fre,getDeactivateDidDocumentInstruction:()=>Nre,getDeactivateDidDocumentInstructionAsync:()=>Wre,getDeactivateDidDocumentInstructionDataCodec:()=>Gre,getDeactivateDidDocumentInstructionDataDecoder:()=>g1,getDeactivateDidDocumentInstructionDataEncoder:()=>Za,getDegradationHandlingCodec:()=>XF,getDegradationHandlingDecoder:()=>jn,getDegradationHandlingEncoder:()=>Hn,getDelegationInfoCodec:()=>iG,getDelegationInfoDecoder:()=>ro,getDelegationInfoEncoder:()=>no,getDelegationScopeCodec:()=>pG,getDelegationScopeDecoder:()=>io,getDelegationScopeEncoder:()=>oo,getDeliverySubmittedEventCodec:()=>vG,getDeliverySubmittedEventDecoder:()=>zx,getDeliverySubmittedEventEncoder:()=>_x,getDidDocumentCodec:()=>DQ,getDidDocumentDecoder:()=>pl,getDidDocumentDiscriminatorBytes:()=>xQ,getDidDocumentEncoder:()=>Fb,getDisputeFiledEventCodec:()=>LG,getDisputeFiledEventDecoder:()=>Gx,getDisputeFiledEventEncoder:()=>Fx,getDisputeResolvedEventCodec:()=>XG,getDisputeResolvedEventDecoder:()=>Bx,getDisputeResolvedEventEncoder:()=>Nx,getEmergencyAccessConfigCodec:()=>i2,getEmergencyAccessConfigDecoder:()=>so,getEmergencyAccessConfigEncoder:()=>co,getEmergencyConfigCodec:()=>p2,getEmergencyConfigDecoder:()=>uo,getEmergencyConfigEncoder:()=>ao,getEnableProtocolFeesDiscriminatorBytes:()=>Jre,getEnableProtocolFeesInstruction:()=>Zre,getEnableProtocolFeesInstructionAsync:()=>Xre,getEnableProtocolFeesInstructionDataCodec:()=>Qre,getEnableProtocolFeesInstructionDataDecoder:()=>l1,getEnableProtocolFeesInstructionDataEncoder:()=>Ya,getEnforcementLevelCodec:()=>T2,getEnforcementLevelDecoder:()=>$e,getEnforcementLevelEncoder:()=>je,getEscrowCompletedEventCodec:()=>E2,getEscrowCompletedEventDecoder:()=>rD,getEscrowCompletedEventEncoder:()=>nD,getEscrowCreatedEventCodec:()=>v2,getEscrowCreatedEventDecoder:()=>uD,getEscrowCreatedEventEncoder:()=>dD,getEscrowStatusCodec:()=>U2,getEscrowStatusDecoder:()=>lo,getEscrowStatusEncoder:()=>po,getExecutionConditionCodec:()=>H2,getExecutionConditionDecoder:()=>Ae,getExecutionConditionEncoder:()=>ge,getExecutionParamsCodec:()=>Y2,getExecutionParamsDecoder:()=>Je,getExecutionParamsEncoder:()=>qe,getFileDisputeDiscriminatorBytes:()=>Aoe,getFileDisputeInstruction:()=>loe,getFileDisputeInstructionDataCodec:()=>poe,getFileDisputeInstructionDataDecoder:()=>T1,getFileDisputeInstructionDataEncoder:()=>y1,getGenerateComplianceReportDiscriminatorBytes:()=>hoe,getGenerateComplianceReportInstruction:()=>boe,getGenerateComplianceReportInstructionAsync:()=>Roe,getGenerateComplianceReportInstructionDataCodec:()=>Coe,getGenerateComplianceReportInstructionDataDecoder:()=>x1,getGenerateComplianceReportInstructionDataEncoder:()=>ed,getGeographicRegionCodec:()=>dW,getGeographicRegionDecoder:()=>fo,getGeographicRegionEncoder:()=>To,getGhostProtectEscrowCodec:()=>GQ,getGhostProtectEscrowDecoder:()=>Rl,getGhostProtectEscrowDiscriminatorBytes:()=>FQ,getGhostProtectEscrowEncoder:()=>Hb,getGhostSlashedEventCodec:()=>TW,getGhostSlashedEventDecoder:()=>CD,getGhostSlashedEventEncoder:()=>hD,getGhostStakedEventCodec:()=>vW,getGhostStakedEventDecoder:()=>MD,getGhostStakedEventEncoder:()=>vD,getGhostUnstakedEventCodec:()=>FW,getGhostUnstakedEventDecoder:()=>UD,getGhostUnstakedEventEncoder:()=>wD,getGhostspeakMarketplaceErrorMessage:()=>Aee,getGovernanceProposalCodec:()=>rX,getGovernanceProposalCreatedEventCodec:()=>JW,getGovernanceProposalCreatedEventDecoder:()=>GD,getGovernanceProposalCreatedEventEncoder:()=>FD,getGovernanceProposalDecoder:()=>kl,getGovernanceProposalDiscriminatorBytes:()=>nX,getGovernanceProposalEncoder:()=>rI,getHierarchicalBoundaryCodec:()=>tN,getHierarchicalBoundaryDecoder:()=>ho,getHierarchicalBoundaryEncoder:()=>Eo,getIncidentResponsePoliciesCodec:()=>pN,getIncidentResponsePoliciesDecoder:()=>Ro,getIncidentResponsePoliciesEncoder:()=>Co,getInitReentrancyGuardDiscriminatorBytes:()=>lce,getInitReentrancyGuardInstruction:()=>Tce,getInitReentrancyGuardInstructionAsync:()=>yce,getInitReentrancyGuardInstructionDataCodec:()=>mce,getInitReentrancyGuardInstructionDataDecoder:()=>V1,getInitReentrancyGuardInstructionDataEncoder:()=>sd,getInitializeAuditTrailDiscriminatorBytes:()=>Loe,getInitializeAuditTrailInstruction:()=>joe,getInitializeAuditTrailInstructionAsync:()=>Hoe,getInitializeAuditTrailInstructionDataCodec:()=>Koe,getInitializeAuditTrailInstructionDataDecoder:()=>E1,getInitializeAuditTrailInstructionDataEncoder:()=>td,getInitializeGovernanceProposalDiscriminatorBytes:()=>nie,getInitializeGovernanceProposalInstruction:()=>oie,getInitializeGovernanceProposalInstructionAsync:()=>Kt,getInitializeGovernanceProposalInstructionDataCodec:()=>rie,getInitializeGovernanceProposalInstructionDataDecoder:()=>R1,getInitializeGovernanceProposalInstructionDataEncoder:()=>nd,getInitializeProtocolConfigDiscriminatorBytes:()=>pie,getInitializeProtocolConfigInstruction:()=>yie,getInitializeProtocolConfigInstructionAsync:()=>mie,getInitializeProtocolConfigInstructionDataCodec:()=>lie,getInitializeProtocolConfigInstructionDataDecoder:()=>v1,getInitializeProtocolConfigInstructionDataEncoder:()=>rd,getInitializeRbacConfigDiscriminatorBytes:()=>Iie,getInitializeRbacConfigInstruction:()=>kie,getInitializeRbacConfigInstructionAsync:()=>Mie,getInitializeRbacConfigInstructionDataCodec:()=>vie,getInitializeRbacConfigInstructionDataDecoder:()=>w1,getInitializeRbacConfigInstructionDataEncoder:()=>od,getInitializeReputationMetricsDiscriminatorBytes:()=>Bie,getInitializeReputationMetricsInstruction:()=>Kie,getInitializeReputationMetricsInstructionAsync:()=>Lie,getInitializeReputationMetricsInstructionDataCodec:()=>Vie,getInitializeReputationMetricsInstructionDataDecoder:()=>z1,getInitializeReputationMetricsInstructionDataEncoder:()=>id,getInitializeStakingConfigDiscriminatorBytes:()=>rce,getInitializeStakingConfigInstruction:()=>ice,getInitializeStakingConfigInstructionAsync:()=>W1,getInitializeStakingConfigInstructionDataCodec:()=>oce,getInitializeStakingConfigInstructionDataDecoder:()=>G1,getInitializeStakingConfigInstructionDataEncoder:()=>cd,getIssueCredentialDiscriminatorBytes:()=>bce,getIssueCredentialInstruction:()=>Mce,getIssueCredentialInstructionAsync:()=>vce,getIssueCredentialInstructionDataCodec:()=>Ice,getIssueCredentialInstructionDataDecoder:()=>$1,getIssueCredentialInstructionDataEncoder:()=>dd,getLatitudeRangeCodec:()=>TN,getLatitudeRangeDecoder:()=>xo,getLatitudeRangeEncoder:()=>So,getLocationConstraintsCodec:()=>EN,getLocationConstraintsDecoder:()=>_o,getLocationConstraintsEncoder:()=>Uo,getLongitudeRangeCodec:()=>bN,getLongitudeRangeDecoder:()=>Po,getLongitudeRangeEncoder:()=>Do,getManageAgentStatusDiscriminatorBytes:()=>Vce,getManageAgentStatusInstruction:()=>Hce,getManageAgentStatusInstructionAsync:()=>Kce,getManageAgentStatusInstructionDataCodec:()=>Lce,getManageAgentStatusInstructionDataDecoder:()=>Q1,getManageAgentStatusInstructionDataEncoder:()=>ud,getMultisigCodec:()=>fX,getMultisigConfigCodec:()=>E6,getMultisigConfigDecoder:()=>Ye,getMultisigConfigEncoder:()=>Ze,getMultisigCreatedEventCodec:()=>FN,getMultisigCreatedEventDecoder:()=>oP,getMultisigCreatedEventEncoder:()=>rP,getMultisigDecoder:()=>Ol,getMultisigDiscriminatorBytes:()=>TX,getMultisigEncoder:()=>TI,getMultisigSignatureCodec:()=>XN,getMultisigSignatureDecoder:()=>Oo,getMultisigSignatureEncoder:()=>zo,getMultisigTypeCodec:()=>t6,getMultisigTypeConfigCodec:()=>p6,getMultisigTypeConfigDecoder:()=>Wo,getMultisigTypeConfigEncoder:()=>Go,getMultisigTypeDecoder:()=>le,getMultisigTypeEncoder:()=>pe,getNetworkSecurityPoliciesCodec:()=>b6,getNetworkSecurityPoliciesDecoder:()=>Bo,getNetworkSecurityPoliciesEncoder:()=>No,getNotificationMethodCodec:()=>k6,getNotificationMethodDecoder:()=>Ko,getNotificationMethodEncoder:()=>Lo,getNotificationPriorityCodec:()=>z6,getNotificationPriorityDecoder:()=>$o,getNotificationPriorityEncoder:()=>jo,getNotificationRequirementCodec:()=>B6,getNotificationRequirementDecoder:()=>ke,getNotificationRequirementEncoder:()=>Me,getNotificationTargetCodec:()=>X6,getNotificationTargetDecoder:()=>Jo,getNotificationTargetEncoder:()=>qo,getNotificationTargetTypeCodec:()=>tB,getNotificationTargetTypeDecoder:()=>ti,getNotificationTargetTypeEncoder:()=>ei,getNotificationTimingCodec:()=>iB,getNotificationTimingDecoder:()=>Xo,getNotificationTimingEncoder:()=>Qo,getPasswordPoliciesCodec:()=>SB,getPasswordPoliciesDecoder:()=>ii,getPasswordPoliciesEncoder:()=>oi,getPendingTransactionCodec:()=>FB,getPendingTransactionDecoder:()=>si,getPendingTransactionEncoder:()=>ci,getPermissionCodec:()=>BB,getPermissionConstraintCodec:()=>$B,getPermissionConstraintDecoder:()=>Ei,getPermissionConstraintEncoder:()=>Pi,getPermissionConstraintTypeCodec:()=>XB,getPermissionConstraintTypeDecoder:()=>vi,getPermissionConstraintTypeEncoder:()=>Ii,getPermissionDecoder:()=>Di,getPermissionEncoder:()=>xi,getPermissionMetadataCodec:()=>r4,getPermissionMetadataDecoder:()=>Ci,getPermissionMetadataEncoder:()=>hi,getPermissionScopeCodec:()=>s4,getPermissionScopeDecoder:()=>bi,getPermissionScopeEncoder:()=>Ri,getPolicyMetadataCodec:()=>m4,getPolicyMetadataDecoder:()=>yn,getPolicyMetadataEncoder:()=>mn,getPolicyRuleCodec:()=>k4,getPolicyRuleDecoder:()=>fn,getPolicyRuleEncoder:()=>Tn,getPolicyScopeCodec:()=>z4,getPolicyScopeDecoder:()=>xn,getPolicyScopeEncoder:()=>Sn,getPolicyStatusCodec:()=>W4,getPolicyStatusDecoder:()=>Pn,getPolicyStatusEncoder:()=>Dn,getPolicyTypeCodec:()=>L4,getPolicyTypeDecoder:()=>hn,getPolicyTypeEncoder:()=>En,getPricingModelCodec:()=>$4,getPricingModelDecoder:()=>Q,getPricingModelEncoder:()=>J,getProposalAccountCodec:()=>iV,getProposalAccountDecoder:()=>Qi,getProposalAccountEncoder:()=>Ji,getProposalInstructionCodec:()=>TV,getProposalInstructionDecoder:()=>yo,getProposalInstructionEncoder:()=>mo,getProposalMetadataCodec:()=>DV,getProposalMetadataDecoder:()=>ec,getProposalMetadataEncoder:()=>Yi,getProposalStatusCodec:()=>CV,getProposalStatusDecoder:()=>rc,getProposalStatusEncoder:()=>nc,getProposalTypeCodec:()=>vV,getProposalTypeDecoder:()=>ae,getProposalTypeEncoder:()=>se,getProtocolConfigCodec:()=>FX,getProtocolConfigDecoder:()=>Bl,getProtocolConfigDiscriminatorBytes:()=>OX,getProtocolConfigEncoder:()=>bI,getProtocolConfigSize:()=>NX,getProtocolConfigUpdatedEventCodec:()=>WV,getProtocolConfigUpdatedEventDecoder:()=>DE,getProtocolConfigUpdatedEventEncoder:()=>xE,getQuorumMethodCodec:()=>LV,getQuorumMethodDecoder:()=>cc,getQuorumMethodEncoder:()=>ic,getQuorumRequirementsCodec:()=>XV,getQuorumRequirementsDecoder:()=>ac,getQuorumRequirementsEncoder:()=>sc,getRbacConfigCodec:()=>tZ,getRbacConfigDecoder:()=>ql,getRbacConfigDiscriminatorBytes:()=>eZ,getRbacConfigEncoder:()=>zI,getRbacConfigInitializedEventCodec:()=>rL,getRbacConfigInitializedEventDecoder:()=>ME,getRbacConfigInitializedEventEncoder:()=>vE,getRecordPayaiPaymentDiscriminatorBytes:()=>dse,getRecordPayaiPaymentInstruction:()=>Ase,getRecordPayaiPaymentInstructionAsync:()=>gse,getRecordPayaiPaymentInstructionDataCodec:()=>use,getRecordPayaiPaymentInstructionDataDecoder:()=>Y1,getRecordPayaiPaymentInstructionDataEncoder:()=>gd,getReentrancyGuardCodec:()=>hZ,getReentrancyGuardDecoder:()=>Xl,getReentrancyGuardDiscriminatorBytes:()=>EZ,getReentrancyGuardEncoder:()=>BI,getReentrancyGuardSize:()=>bZ,getReentrancyStateCodec:()=>sL,getReentrancyStateDecoder:()=>gc,getReentrancyStateEncoder:()=>uc,getRegisterAgentCompressedDiscriminatorBytes:()=>_se,getRegisterAgentCompressedInstruction:()=>Ose,getRegisterAgentCompressedInstructionAsync:()=>iy,getRegisterAgentCompressedInstructionDataCodec:()=>zse,getRegisterAgentCompressedInstructionDataDecoder:()=>oy,getRegisterAgentCompressedInstructionDataEncoder:()=>Rd,getRegisterAgentDiscriminatorBytes:()=>Pse,getRegisterAgentInstruction:()=>hse,getRegisterAgentInstructionAsync:()=>ny,getRegisterAgentInstructionDataCodec:()=>Ese,getRegisterAgentInstructionDataDecoder:()=>ty,getRegisterAgentInstructionDataEncoder:()=>fd,getReportDataCodec:()=>TL,getReportDataDecoder:()=>pc,getReportDataEncoder:()=>Ac,getReportEntryCodec:()=>kL,getReportEntryDecoder:()=>mc,getReportEntryEncoder:()=>lc,getReportStatusCodec:()=>WL,getReportStatusDecoder:()=>Ec,getReportStatusEncoder:()=>Pc,getReportSummaryCodec:()=>HL,getReportSummaryDecoder:()=>Tc,getReportSummaryEncoder:()=>yc,getReportTypeCodec:()=>JL,getReportTypeDecoder:()=>ce,getReportTypeEncoder:()=>ie,getReportingFrequencyCodec:()=>zL,getReportingFrequencyDecoder:()=>Yn,getReportingFrequencyEncoder:()=>Zn,getReputationMetricsCodec:()=>KZ,getReputationMetricsDecoder:()=>em,getReputationMetricsDiscriminatorBytes:()=>LZ,getReputationMetricsEncoder:()=>$I,getReputationMetricsInitializedEventCodec:()=>s5,getReputationMetricsInitializedEventDecoder:()=>HE,getReputationMetricsInitializedEventEncoder:()=>KE,getReputationPaymentRecordedEventCodec:()=>E5,getReputationPaymentRecordedEventDecoder:()=>qE,getReputationPaymentRecordedEventEncoder:()=>$E,getReputationRatingSubmittedEventCodec:()=>U5,getReputationRatingSubmittedEventDecoder:()=>YE,getReputationRatingSubmittedEventEncoder:()=>ZE,getReputationTagsUpdatedEventCodec:()=>B5,getReputationTagsUpdatedEventDecoder:()=>nh,getReputationTagsUpdatedEventEncoder:()=>th,getResetReentrancyGuardDiscriminatorBytes:()=>Hse,getResetReentrancyGuardInstruction:()=>qse,getResetReentrancyGuardInstructionAsync:()=>$se,getResetReentrancyGuardInstructionDataCodec:()=>jse,getResetReentrancyGuardInstructionDataDecoder:()=>ay,getResetReentrancyGuardInstructionDataEncoder:()=>bd,getResolveDidDocumentDiscriminatorBytes:()=>oae,getResolveDidDocumentInstruction:()=>sae,getResolveDidDocumentInstructionAsync:()=>cae,getResolveDidDocumentInstructionDataCodec:()=>iae,getResolveDidDocumentInstructionDataDecoder:()=>gy,getResolveDidDocumentInstructionDataEncoder:()=>Id,getResourceConstraintsCodec:()=>YL,getResourceConstraintsDecoder:()=>Mc,getResourceConstraintsEncoder:()=>vc,getReviewScheduleCodec:()=>t3,getReviewScheduleDecoder:()=>Ni,getReviewScheduleEncoder:()=>Wi,getRevokeAuthorizationDiscriminatorBytes:()=>Wk,getRevokeAuthorizationInstruction:()=>Bk,getRevokeAuthorizationInstructionDataCodec:()=>Nk,getRevokeAuthorizationInstructionDataDecoder:()=>kd,getRevokeAuthorizationInstructionDataEncoder:()=>Md,getRevokeCredentialDiscriminatorBytes:()=>vae,getRevokeCredentialInstruction:()=>kae,getRevokeCredentialInstructionDataCodec:()=>Mae,getRevokeCredentialInstructionDataDecoder:()=>my,getRevokeCredentialInstructionDataEncoder:()=>ly,getRiskAcceptanceCodec:()=>m3,getRiskAcceptanceDecoder:()=>_c,getRiskAcceptanceEncoder:()=>Uc,getRiskAssessmentCodec:()=>b3,getRiskAssessmentDecoder:()=>wi,getRiskAssessmentEncoder:()=>ki,getRiskCategoryCodec:()=>k3,getRiskCategoryDecoder:()=>Wc,getRiskCategoryEncoder:()=>Gc,getRiskFactorCodec:()=>B3,getRiskFactorDecoder:()=>Oc,getRiskFactorEncoder:()=>zc,getRiskIndicatorCodec:()=>$3,getRiskIndicatorDecoder:()=>Sc,getRiskIndicatorEncoder:()=>fc,getRiskLevelCodec:()=>X3,getRiskLevelDecoder:()=>jc,getRiskLevelEncoder:()=>Hc,getRoleCodec:()=>t9,getRoleConstraintsCodec:()=>s9,getRoleConstraintsDecoder:()=>qc,getRoleConstraintsEncoder:()=>$c,getRoleDecoder:()=>st,getRoleEncoder:()=>ct,getRoleMetadataCodec:()=>p9,getRoleMetadataDecoder:()=>Qc,getRoleMetadataEncoder:()=>Jc,getRoleStatusCodec:()=>T9,getRoleStatusDecoder:()=>Zc,getRoleStatusEncoder:()=>Xc,getRoleTypeCodec:()=>D9,getRoleTypeDecoder:()=>es,getRoleTypeEncoder:()=>Yc,getRuleConditionCodec:()=>b9,getRuleConditionDecoder:()=>Ki,getRuleConditionEncoder:()=>Li,getRuleEffectCodec:()=>C9,getRuleEffectDecoder:()=>Vi,getRuleEffectEncoder:()=>Bi,getScopeBoundariesCodec:()=>k9,getScopeBoundariesDecoder:()=>_i,getScopeBoundariesEncoder:()=>Ui,getScopeInheritanceCodec:()=>z9,getScopeInheritanceDecoder:()=>ji,getScopeInheritanceEncoder:()=>Hi,getScopeTypeCodec:()=>W9,getScopeTypeDecoder:()=>Oi,getScopeTypeEncoder:()=>zi,getSecurityEventTypeCodec:()=>L9,getSecurityEventTypeDecoder:()=>Yo,getSecurityEventTypeEncoder:()=>Zo,getSecurityPoliciesCodec:()=>$9,getSecurityPoliciesDecoder:()=>Ps,getSecurityPoliciesEncoder:()=>Ds,getServiceEndpointCodec:()=>X9,getServiceEndpointDecoder:()=>ye,getServiceEndpointEncoder:()=>me,getServiceEndpointTypeCodec:()=>tK,getServiceEndpointTypeDecoder:()=>Rs,getServiceEndpointTypeEncoder:()=>Cs,getSessionConstraintsCodec:()=>iK,getSessionConstraintsDecoder:()=>ns,getSessionConstraintsEncoder:()=>ts,getSessionPoliciesCodec:()=>gK,getSessionPoliciesDecoder:()=>hs,getSessionPoliciesEncoder:()=>Es,getSlashReasonCodec:()=>mK,getSlashReasonDecoder:()=>Xe,getSlashReasonEncoder:()=>Qe,getSlashStakeDiscriminatorBytes:()=>Kae,getSlashStakeInstruction:()=>$ae,getSlashStakeInstructionAsync:()=>jae,getSlashStakeInstructionDataCodec:()=>Hae,getSlashStakeInstructionDataDecoder:()=>Sy,getSlashStakeInstructionDataEncoder:()=>wd,getSodConstraintCodec:()=>SK,getSodConstraintDecoder:()=>os,getSodConstraintEncoder:()=>rs,getSodConstraintTypeCodec:()=>EK,getSodConstraintTypeDecoder:()=>Ms,getSodConstraintTypeEncoder:()=>vs,getSourceReputationUpdatedEventCodec:()=>BK,getSourceReputationUpdatedEventDecoder:()=>mC,getSourceReputationUpdatedEventEncoder:()=>lC,getSourceScoreCodec:()=>XK,getSourceScoreDecoder:()=>Us,getSourceScoreEncoder:()=>ws,getStakeGhostDiscriminatorBytes:()=>ide,getStakeGhostInstruction:()=>sde,getStakeGhostInstructionAsync:()=>Py,getStakeGhostInstructionDataCodec:()=>cde,getStakeGhostInstructionDataDecoder:()=>Dy,getStakeGhostInstructionDataEncoder:()=>_d,getStakingAccountCodec:()=>pY,getStakingAccountDecoder:()=>im,getStakingAccountDiscriminatorBytes:()=>AY,getStakingAccountEncoder:()=>tv,getStakingAccountSize:()=>yY,getStakingConfigCodec:()=>zY,getStakingConfigDecoder:()=>am,getStakingConfigDiscriminatorBytes:()=>_Y,getStakingConfigEncoder:()=>gv,getStakingConfigSize:()=>GY,getStepUpTriggerCodec:()=>tH,getStepUpTriggerDecoder:()=>Sr,getStepUpTriggerEncoder:()=>fr,getSubmissionDetailsCodec:()=>sH,getSubmissionDetailsDecoder:()=>Os,getSubmissionDetailsEncoder:()=>zs,getSubmitDeliveryDiscriminatorBytes:()=>Dde,getSubmitDeliveryInstruction:()=>Ede,getSubmitDeliveryInstructionDataCodec:()=>Pde,getSubmitDeliveryInstructionDataDecoder:()=>Cy,getSubmitDeliveryInstructionDataEncoder:()=>hy,getSubmitServiceRatingDiscriminatorBytes:()=>Bde,getSubmitServiceRatingInstruction:()=>Kde,getSubmitServiceRatingInstructionAsync:()=>Lde,getSubmitServiceRatingInstructionDataCodec:()=>Vde,getSubmitServiceRatingInstructionDataDecoder:()=>Iy,getSubmitServiceRatingInstructionDataEncoder:()=>zd,getTagDecayAppliedEventCodec:()=>mH,getTagDecayAppliedEventDecoder:()=>vC,getTagDecayAppliedEventEncoder:()=>IC,getTagScoreCodec:()=>bH,getTagScoreDecoder:()=>dt,getTagScoreEncoder:()=>at,getTierUpdatedEventCodec:()=>zH,getTierUpdatedEventDecoder:()=>FC,getTierUpdatedEventEncoder:()=>OC,getTimeConstraintsCodec:()=>BH,getTimeConstraintsDecoder:()=>cs,getTimeConstraintsEncoder:()=>is,getTimeLockCodec:()=>JH,getTimeLockDecoder:()=>di,getTimeLockEncoder:()=>ai,getTimeLockTypeCodec:()=>YH,getTimeLockTypeDecoder:()=>Gs,getTimeLockTypeEncoder:()=>Fs,getTransactionPriorityCodec:()=>r7,getTransactionPriorityDecoder:()=>gi,getTransactionPriorityEncoder:()=>ui,getTransactionStatusCodec:()=>s7,getTransactionStatusDecoder:()=>pi,getTransactionStatusEncoder:()=>Ai,getTransactionTypeCodec:()=>g7,getTransactionTypeDecoder:()=>ue,getTransactionTypeEncoder:()=>de,getTrendDirectionCodec:()=>m7,getTrendDirectionDecoder:()=>Bc,getTrendDirectionEncoder:()=>Nc,getUnlockMethodCodec:()=>S7,getUnlockMethodDecoder:()=>vn,getUnlockMethodEncoder:()=>In,getUnstakeGhostDiscriminatorBytes:()=>Zde,getUnstakeGhostInstruction:()=>eue,getUnstakeGhostInstructionAsync:()=>wy,getUnstakeGhostInstructionDataCodec:()=>Yde,getUnstakeGhostInstructionDataDecoder:()=>ky,getUnstakeGhostInstructionDataEncoder:()=>Od,getUpdateAgentDiscriminatorBytes:()=>Aue,getUpdateAgentInstruction:()=>Gy,getUpdateAgentInstructionAsync:()=>lue,getUpdateAgentInstructionDataCodec:()=>pue,getUpdateAgentInstructionDataDecoder:()=>Fy,getUpdateAgentInstructionDataEncoder:()=>Vd,getUpdateAgentReputationDiscriminatorBytes:()=>kue,getUpdateAgentReputationInstruction:()=>_ue,getUpdateAgentReputationInstructionAsync:()=>Uue,getUpdateAgentReputationInstructionDataCodec:()=>wue,getUpdateAgentReputationInstructionDataDecoder:()=>By,getUpdateAgentReputationInstructionDataEncoder:()=>Ld,getUpdateAgentServiceDiscriminatorBytes:()=>Zue,getUpdateAgentServiceInstruction:()=>tge,getUpdateAgentServiceInstructionAsync:()=>ege,getUpdateAgentServiceInstructionDataCodec:()=>Yue,getUpdateAgentServiceInstructionDataDecoder:()=>Qy,getUpdateAgentServiceInstructionDataEncoder:()=>Kd,getUpdateCrosschainStatusDiscriminatorBytes:()=>mge,getUpdateCrosschainStatusInstruction:()=>Tge,getUpdateCrosschainStatusInstructionDataCodec:()=>yge,getUpdateCrosschainStatusInstructionDataDecoder:()=>Yy,getUpdateCrosschainStatusInstructionDataEncoder:()=>Zy,getUpdateDidDocumentDiscriminatorBytes:()=>bge,getUpdateDidDocumentInstruction:()=>Mge,getUpdateDidDocumentInstructionAsync:()=>vge,getUpdateDidDocumentInstructionDataCodec:()=>Ige,getUpdateDidDocumentInstructionDataDecoder:()=>nT,getUpdateDidDocumentInstructionDataEncoder:()=>$d,getUpdateProtocolConfigDiscriminatorBytes:()=>Bge,getUpdateProtocolConfigInstruction:()=>Kge,getUpdateProtocolConfigInstructionAsync:()=>Lge,getUpdateProtocolConfigInstructionDataCodec:()=>Vge,getUpdateProtocolConfigInstructionDataDecoder:()=>sT,getUpdateProtocolConfigInstructionDataEncoder:()=>qd,getUpdateReputationTagsDiscriminatorBytes:()=>eAe,getUpdateReputationTagsInstruction:()=>rAe,getUpdateReputationTagsInstructionAsync:()=>nAe,getUpdateReputationTagsInstructionDataCodec:()=>tAe,getUpdateReputationTagsInstructionDataDecoder:()=>yT,getUpdateReputationTagsInstructionDataEncoder:()=>Xd,getUpdateReputationWithAuthDiscriminatorBytes:()=>Fw,getUpdateReputationWithAuthInstruction:()=>Nw,getUpdateReputationWithAuthInstructionAsync:()=>Ww,getUpdateReputationWithAuthInstructionDataCodec:()=>Gw,getUpdateReputationWithAuthInstructionDataDecoder:()=>ru,getUpdateReputationWithAuthInstructionDataEncoder:()=>Jt,getUpdateSourceReputationDiscriminatorBytes:()=>CAe,getUpdateSourceReputationInstruction:()=>IAe,getUpdateSourceReputationInstructionAsync:()=>bAe,getUpdateSourceReputationInstructionDataCodec:()=>RAe,getUpdateSourceReputationInstructionDataDecoder:()=>bT,getUpdateSourceReputationInstructionDataEncoder:()=>ou,getUserRegistryCodec:()=>iee,getUserRegistryDecoder:()=>gm,getUserRegistryDiscriminatorBytes:()=>oee,getUserRegistryEncoder:()=>Tv,getUserRegistrySize:()=>aee,getValueTypeCodec:()=>E7,getValueTypeDecoder:()=>Lr,getValueTypeEncoder:()=>Vr,getVerificationMethodCodec:()=>U7,getVerificationMethodDecoder:()=>fe,getVerificationMethodEncoder:()=>Te,getVerificationMethodTypeCodec:()=>F7,getVerificationMethodTypeDecoder:()=>$s,getVerificationMethodTypeEncoder:()=>js,getVerificationRelationshipCodec:()=>B7,getVerificationRelationshipDecoder:()=>Js,getVerificationRelationshipEncoder:()=>qs,getVerifyAgentDiscriminatorBytes:()=>QAe,getVerifyAgentInstruction:()=>ZAe,getVerifyAgentInstructionAsync:()=>wT,getVerifyAgentInstructionDataCodec:()=>XAe,getVerifyAgentInstructionDataDecoder:()=>kT,getVerifyAgentInstructionDataEncoder:()=>iu,getVerifyAuthorizationDiscriminatorBytes:()=>lpe,getVerifyAuthorizationInstruction:()=>ype,getVerifyAuthorizationInstructionDataCodec:()=>mpe,getVerifyAuthorizationInstructionDataDecoder:()=>zT,getVerifyAuthorizationInstructionDataEncoder:()=>_T,getViolationSeverityCodec:()=>H7,getViolationSeverityDecoder:()=>Lc,getViolationSeverityEncoder:()=>Vc,getVoteChoiceCodec:()=>gj,getVoteChoiceDecoder:()=>na,getVoteChoiceEncoder:()=>ta,getVoteCodec:()=>sj,getVoteDecoder:()=>ea,getVoteEncoder:()=>Ys,getVotingResultsCodec:()=>Sj,getVotingResultsDecoder:()=>sa,getVotingResultsEncoder:()=>ca,identifyGhostspeakMarketplaceAccount:()=>dee,identifyGhostspeakMarketplaceInstruction:()=>uee,isArbitratorDecision:()=>Dz,isDelegationScope:()=>mG,isGhostspeakMarketplaceError:()=>pee,parseActivateAgentInstruction:()=>wee,parseApproveDeliveryInstruction:()=>Vee,parseArbitrateDisputeInstruction:()=>Zee,parseCreateAgentAuthorizationInstruction:()=>oM,parseCreateCredentialTemplateInstruction:()=>vte,parseCreateCredentialTypeInstruction:()=>Bte,parseCreateDidDocumentInstruction:()=>cne,parseCreateEscrowInstruction:()=>bne,parseCreateMultisigInstruction:()=>Hne,parseDeactivateAgentInstruction:()=>are,parseDeactivateCredentialTemplateInstruction:()=>fre,parseDeactivateCredentialTypeInstruction:()=>Ire,parseDeactivateDidDocumentInstruction:()=>Bre,parseEnableProtocolFeesInstruction:()=>Yre,parseFileDisputeInstruction:()=>moe,parseGenerateComplianceReportInstruction:()=>Ioe,parseInitReentrancyGuardInstruction:()=>fce,parseInitializeAuditTrailInstruction:()=>$oe,parseInitializeGovernanceProposalInstruction:()=>iie,parseInitializeProtocolConfigInstruction:()=>Tie,parseInitializeRbacConfigInstruction:()=>wie,parseInitializeReputationMetricsInstruction:()=>Hie,parseInitializeStakingConfigInstruction:()=>cce,parseIssueCredentialInstruction:()=>kce,parseManageAgentStatusInstruction:()=>jce,parseRecordPayaiPaymentInstruction:()=>pse,parseRegisterAgentCompressedInstruction:()=>Fse,parseRegisterAgentInstruction:()=>Cse,parseResetReentrancyGuardInstruction:()=>Jse,parseResolveDidDocumentInstruction:()=>aae,parseRevokeAuthorizationInstruction:()=>Vk,parseRevokeCredentialInstruction:()=>wae,parseSlashStakeInstruction:()=>qae,parseStakeGhostInstruction:()=>ade,parseSubmitDeliveryInstruction:()=>hde,parseSubmitServiceRatingInstruction:()=>Hde,parseUnstakeGhostInstruction:()=>tue,parseUpdateAgentInstruction:()=>mue,parseUpdateAgentReputationInstruction:()=>zue,parseUpdateAgentServiceInstruction:()=>nge,parseUpdateCrosschainStatusInstruction:()=>fge,parseUpdateDidDocumentInstruction:()=>kge,parseUpdateProtocolConfigInstruction:()=>Hge,parseUpdateReputationTagsInstruction:()=>oAe,parseUpdateReputationWithAuthInstruction:()=>Bw,parseUpdateSourceReputationInstruction:()=>vAe,parseVerifyAgentInstruction:()=>YAe,parseVerifyAuthorizationInstruction:()=>Tpe});var te=a(()=>{Dv();Fv();Zw();E();m();});var su,au,du,_,OT,FT=a(()=>{su=(p=>(p.CodeGeneration="code-generation",p.DataAnalysis="data-analysis",p.ContentCreation="content-creation",p.ImageGeneration="image-generation",p.AudioProcessing="audio-processing",p.VideoProcessing="video-processing",p.NaturalLanguageProcessing="nlp-specialist",p.ComputerVision="computer-vision",p.ReinforcementLearning="reinforcement-learning",p.DeFiExpert="defi-expert",p.NFTSpecialist="nft-specialist",p.SmartContractAudit="smart-contract-audit",p.BlockchainDevelopment="blockchain-dev",p.DAOGovernance="dao-governance",p.GameDevelopment="game-dev",p.WebDevelopment="web-dev",p.MobileDevelopment="mobile-dev",p.APIIntegration="api-integration",p.DatabaseManagement="database-management",p.DevOpsAutomation="devops-automation",p.FinancialAnalysis="financial-analysis",p.MarketResearch="market-research",p.LegalCompliance="legal-compliance",p.CustomerSupport="customer-support",p.TranslationServices="translation-services",p.SecurityAudit="security-audit",p.PenetrationTesting="penetration-testing",p.ThreatDetection="threat-detection",p.IncidentResponse="incident-response",p.DataEngineering="data-engineering",p.DataVisualization="data-visualization",p.PredictiveModeling="predictive-modeling",p.StatisticalAnalysis="statistical-analysis",p))(su||{}),au=(M=>(M.FastResponder="fast-responder",M.QuickResponder="quick-responder",M.SameDay="same-day",M.ConsistentQuality="consistent-quality",M.HighQuality="high-quality",M.TopRated="top-rated",M.PerfectRecord="perfect-record",M.HighVolume="high-volume",M.VeryHighVolume="very-high-volume",M.MegaVolume="mega-volume",M.LongTermActive="long-term-active",M.MultiYear="multi-year",M.CategorySpecialist="category-specialist",M.MultiDomain="multi-domain",M.Generalist="generalist",M.DisputeFree="dispute-free",M.LowDispute="low-dispute",M.HighResolution="high-resolution",M.PlatinumTier="platinum-tier",M.GoldTier="gold-tier",M.SilverTier="silver-tier",M.BronzeTier="bronze-tier",M.Responsive="responsive",M.Communicative="communicative",M.Proactive="proactive",M.DetailOriented="detail-oriented",M.VerifiedIdentity="verified-identity",M.LongStanding="long-standing",M.CommunityTrusted="community-trusted",M.ClientFavorite="client-favorite",M))(au||{}),du=(U=>(U.KYCVerified="kyc-verified",U.KYBVerified="kyb-verified",U.AccreditedInvestor="accredited-investor",U.SOC2Compliant="soc2-compliant",U.ISO27001="iso-27001",U.GDPR="gdpr-compliant",U.HIPAA="hipaa-compliant",U.PCI_DSS="pci-dss",U.AuditedCode="audited-code",U.BugBounty="bug-bounty",U.OpenSource="open-source",U.InsuredService="insured-service",U.BondedAgent="bonded-agent",U.LicensedProfessional="licensed-professional",U.RegulatedEntity="regulated-entity",U.PublicAuditTrail="public-audit-trail",U.TransparentPricing="transparent-pricing",U.VerifiedMetrics="verified-metrics",U))(du||{}),_={MAX_SKILL_TAGS:20,MAX_BEHAVIOR_TAGS:20,MAX_COMPLIANCE_TAGS:10,MAX_TAG_SCORES:50,MAX_TAG_NAME_LENGTH:32,STALE_TAG_THRESHOLD:7776e3,MIN_TAG_CONFIDENCE:5e3,MAX_TAG_CONFIDENCE:1e4,BASIS_POINTS_MAX:1e4},OT={decayRatePerDay:10,minConfidence:2e3,maxAgeSeconds:2160*60*60};});var $T={};ne($T,{batchGetAccounts:()=>Su,batchGetAccountsWithRetry:()=>s0,batchGetAndMap:()=>c0,batchGetExistingAccounts:()=>i0,createBatchFetcher:()=>Upe});function o0(n,e){let t=[];for(let o=0;o<n.length;o+=e)t.push(n.slice(o,o+e));return t}async function Su(n,e,t={}){let o=Math.min(t.batchSize??100,100);if(e.length===0)return [];if(e.length<=o)return (await n.getMultipleAccounts(e).send()).value;let r=o0(e,o),c=[],i=0,d=r.map(async s=>{let A=await n.getMultipleAccounts(s).send();return i+=s.length,t.onProgress?.(i,e.length),A.value});return c.push(...await Promise.all(d)),c.flat()}async function i0(n,e,t={}){let o=await Su(n,e,t),r=[];for(let c=0;c<o.length;c++){let i=o[c];i!==null&&r.push({address:e[c],account:i});}return r}async function c0(n,e,t,o={}){return (await Su(n,e,o)).map((c,i)=>t(c,e[i],i))}async function s0(n,e,t={},o=3){let r=Math.min(t.batchSize??100,100);if(e.length===0)return [];let c=o0(e,r),i=new Array(e.length),d=0;return await Promise.all(c.map(async(s,A)=>{let y=0,R=false;for(;!R&&y<=o;)try{(await n.getMultipleAccounts(s).send()).value.forEach((P,w)=>{i[A*r+w]=P;}),d+=s.length,t.onProgress?.(d,e.length),R=!0;}catch(D){if(y++,y>o)throw new Error(`Batch ${A} failed after ${o} retries: ${D}`);await new Promise(k=>setTimeout(k,100*Math.pow(2,y-1)));}})),i}function Upe(n,e={}){return {getAccounts:(t,o)=>Su(n,t,{...e,...o}),getExisting:(t,o)=>i0(n,t,{...e,...o}),getAndMap:(t,o,r)=>c0(n,t,o,{...e,...r}),getWithRetry:(t,o,r)=>s0(n,t,{...e,...o},r)}}var qT=a(()=>{});var Du={};ne(Du,{deriveA2AMessagePda:()=>Gpe,deriveA2ASessionPda:()=>Fpe,deriveA2ASessionPdaOriginal:()=>Ope,deriveAgentPda:()=>zpe,deriveAgentPdaOriginal:()=>_pe,deriveAgentTreeConfigPda:()=>Bpe,deriveAgentVerificationPda:()=>Npe,deriveEscrowPDA:()=>Kpe,deriveEscrowPDAOriginal:()=>Lpe,deriveEscrowPda:()=>Hpe,deriveMessagePda:()=>$pe,deriveTokenAccountPda:()=>jpe,deriveUserRegistryPda:()=>Wpe,findProgramDerivedAddress:()=>Vpe});async function _pe(n,e,t){let[o]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(e),getUtf8Encoder().encode(t)]});return o}async function zpe(n){let[e,t]=await getProgramDerivedAddress({programAddress:n.programAddress,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(n.owner),getUtf8Encoder().encode(n.agentId)]});return [e,t]}async function Ope(n,e){let[t]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([97,50,97,95,115,101,115,115,105,111,110])),getAddressEncoder().encode(e)]});return t}async function Fpe(n){let e=await getProgramDerivedAddress({programAddress:n.programAddress,seeds:[getBytesEncoder().encode(new Uint8Array([97,50,97,95,115,101,115,115,105,111,110])),getAddressEncoder().encode(n.initiator)]});return [e[0],e[1]]}async function Gpe(n,e,t){let o=new Uint8Array(8);new DataView(o.buffer).setBigInt64(0,t,true);let[c]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([97,50,97,95,109,101,115,115,97,103,101])),getAddressEncoder().encode(e),o]});return c}async function Wpe(n,e){let[t]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114,95,114,101,103,105,115,116,114,121])),getAddressEncoder().encode(e)]});return t}async function Npe(n,e,t){let[o]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116,95,118,101,114,105,102,105,99,97,116,105,111,110])),getAddressEncoder().encode(e),getAddressEncoder().encode(t)]});return o}async function Bpe(n,e){let[t]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116,95,116,114,101,101,95,99,111,110,102,105,103])),getAddressEncoder().encode(e)]});return t}async function Vpe(n,e){let t=n.map(r=>typeof r=="string"?getUtf8Encoder().encode(r):typeof r=="object"&&r.constructor===Uint8Array?r:getAddressEncoder().encode(r)),o=await getProgramDerivedAddress({programAddress:e,seeds:t});return [o[0],o[1]]}async function Lpe(n,e){let t=[getBytesEncoder().encode(new Uint8Array([101,115,99,114,111,119])),getAddressEncoder().encode(n)],o=await getProgramDerivedAddress({programAddress:e,seeds:t});return [o[0],o[1]]}async function Kpe(n){let e=[getBytesEncoder().encode(new Uint8Array([101,115,99,114,111,119])),getUtf8Encoder().encode(n.escrowId)],t=await getProgramDerivedAddress({programAddress:n.programAddress,seeds:e});return [t[0],t[1]]}async function Hpe(n,e,t,o){let r=new Uint8Array(8);new DataView(r.buffer).setUint32(0,o,true);let[i]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([101,115,99,114,111,119])),getAddressEncoder().encode(e),getAddressEncoder().encode(t),r.slice(0,4)]});return i}async function jpe(n,e){let t="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",o="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",[r]=await getProgramDerivedAddress({programAddress:t,seeds:[getAddressEncoder().encode(n),getAddressEncoder().encode(o),getAddressEncoder().encode(e)]});return r}async function $pe(n,e,t){let o=new Uint8Array(4);new DataView(o.buffer).setUint32(0,t,true);let[c]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([109,101,115,115,97,103,101])),getAddressEncoder().encode(e),o]});return c}var Pu=a(()=>{});var m0={};ne(m0,{ReputationTagEngine:()=>sn});var sn,XT=a(()=>{FT();sn=class{tagCriteria=[];decayConfig;constructor(e=OT){this.decayConfig=e,this.initializeTagCriteria();}initializeTagCriteria(){this.tagCriteria=[{tag:"fast-responder",category:"behavior",minConfidence:_.MIN_TAG_CONFIDENCE,evaluate:e=>{if(e.responseTimeCount===0n)return {shouldAssign:false,confidence:0,evidenceCount:0};let t=e.avgResponseTime,o=Number(e.responseTimeCount);return t<6e4?{shouldAssign:true,confidence:Math.min(1e4,1e4-Math.floor(t/6e4*2e3)),evidenceCount:o,reason:`Average response time ${t}ms`}:{shouldAssign:false,confidence:0,evidenceCount:o}}},{tag:"quick-responder",category:"behavior",minConfidence:_.MIN_TAG_CONFIDENCE,evaluate:e=>{if(e.responseTimeCount===0n)return {shouldAssign:false,confidence:0,evidenceCount:0};let t=e.avgResponseTime,o=Number(e.responseTimeCount);return t<3e5?{shouldAssign:true,confidence:Math.min(1e4,1e4-Math.floor(t/3e5*3e3)),evidenceCount:o,reason:`Average response time ${t}ms`}:{shouldAssign:false,confidence:0,evidenceCount:o}}},{tag:"dispute-free",category:"behavior",minConfidence:_.MIN_TAG_CONFIDENCE,evaluate:e=>{let t=Number(e.successfulPayments+e.failedPayments);return t<10?{shouldAssign:false,confidence:0,evidenceCount:0}:e.totalDisputes===0?{shouldAssign:true,confidence:Math.min(1e4,7e3+t*10),evidenceCount:t,reason:`0 disputes over ${t} transactions`}:{shouldAssign:false,confidence:0,evidenceCount:t}}},{tag:"low-dispute",category:"behavior",minConfidence:_.MIN_TAG_CONFIDENCE,evaluate:e=>{let t=Number(e.successfulPayments+e.failedPayments);if(t<100)return {shouldAssign:false,confidence:0,evidenceCount:0};let o=e.totalDisputes/t*100;return o<1?{shouldAssign:true,confidence:Math.min(1e4,1e4-Math.floor(o*1e3)),evidenceCount:t,reason:`${o.toFixed(2)}% dispute rate`}:{shouldAssign:false,confidence:0,evidenceCount:t}}},{tag:"high-volume",category:"behavior",minConfidence:_.MIN_TAG_CONFIDENCE,evaluate:e=>{let t=Number(e.successfulPayments);return t>=1e3?{shouldAssign:true,confidence:Math.min(1e4,6e3+Math.floor(t/100)),evidenceCount:t,reason:`${t} successful transactions`}:{shouldAssign:false,confidence:0,evidenceCount:t}}},{tag:"very-high-volume",category:"behavior",minConfidence:_.MIN_TAG_CONFIDENCE,evaluate:e=>{let t=Number(e.successfulPayments);return t>=1e4?{shouldAssign:true,confidence:Math.min(1e4,8e3+Math.floor(t/1e3)),evidenceCount:t,reason:`${t} successful transactions`}:{shouldAssign:false,confidence:0,evidenceCount:t}}},{tag:"top-rated",category:"behavior",minConfidence:_.MIN_TAG_CONFIDENCE,evaluate:e=>{if(e.totalRatingsCount<10)return {shouldAssign:false,confidence:0,evidenceCount:0};let t=e.avgRating/20,o=e.totalRatingsCount;return t>4.8?{shouldAssign:true,confidence:Math.min(1e4,Math.floor((t-4.8)*5e4)+8e3),evidenceCount:o,reason:`Average rating ${t.toFixed(2)}/5.0`}:{shouldAssign:false,confidence:0,evidenceCount:o}}},{tag:"high-quality",category:"behavior",minConfidence:_.MIN_TAG_CONFIDENCE,evaluate:e=>{if(e.totalRatingsCount<5)return {shouldAssign:false,confidence:0,evidenceCount:0};let t=e.avgRating/20,o=e.totalRatingsCount;return t>4.5?{shouldAssign:true,confidence:Math.min(1e4,Math.floor((t-4.5)*2e4)+7e3),evidenceCount:o,reason:`Average rating ${t.toFixed(2)}/5.0`}:{shouldAssign:false,confidence:0,evidenceCount:o}}},{tag:"consistent-quality",category:"behavior",minConfidence:_.MIN_TAG_CONFIDENCE,evaluate:e=>{if(e.totalRatingsCount<20)return {shouldAssign:false,confidence:0,evidenceCount:0};let t=e.avgRating/20,o=e.totalRatingsCount;return t>4.3?{shouldAssign:true,confidence:Math.min(1e4,Math.floor((t-4)*1e4)+5e3),evidenceCount:o,reason:`Consistent high ratings (${t.toFixed(2)}/5.0)`}:{shouldAssign:false,confidence:0,evidenceCount:o}}},{tag:"perfect-record",category:"behavior",minConfidence:_.MIN_TAG_CONFIDENCE,evaluate:e=>{let t=Number(e.successfulPayments+e.failedPayments);return t<50?{shouldAssign:false,confidence:0,evidenceCount:0}:e.successRate/100===100&&e.failedPayments===0n?{shouldAssign:true,confidence:Math.min(1e4,8e3+Math.floor(t/10)),evidenceCount:t,reason:`100% success rate over ${t} transactions`}:{shouldAssign:false,confidence:0,evidenceCount:t}}},{tag:"high-resolution",category:"behavior",minConfidence:_.MIN_TAG_CONFIDENCE,evaluate:e=>{if(e.totalDisputes<5)return {shouldAssign:false,confidence:0,evidenceCount:0};let t=e.disputesResolved/e.totalDisputes*100,o=e.totalDisputes;return t>90?{shouldAssign:true,confidence:Math.min(1e4,Math.floor((t-90)*1e3)+8e3),evidenceCount:o,reason:`${t.toFixed(1)}% disputes resolved favorably`}:{shouldAssign:false,confidence:0,evidenceCount:o}}},{tag:"long-term-active",category:"behavior",minConfidence:_.MIN_TAG_CONFIDENCE,evaluate:e=>{let r=(Math.floor(Date.now()/1e3)-e.createdAt)/(365*24*60*60);return r>=1?{shouldAssign:true,confidence:Math.min(1e4,Math.floor(r*2e3)+6e3),evidenceCount:Math.floor(r),reason:`Active for ${r.toFixed(1)} years`}:{shouldAssign:false,confidence:0,evidenceCount:0}}},{tag:"multi-year",category:"behavior",minConfidence:_.MIN_TAG_CONFIDENCE,evaluate:e=>{let r=(Math.floor(Date.now()/1e3)-e.createdAt)/(365*24*60*60);return r>=3?{shouldAssign:true,confidence:Math.min(1e4,Math.floor(r*1e3)+7e3),evidenceCount:Math.floor(r),reason:`Active for ${r.toFixed(1)} years`}:{shouldAssign:false,confidence:0,evidenceCount:0}}}];}async calculateTags(e){let t=[],o=Math.floor(Date.now()/1e3);for(let r of this.tagCriteria){let c=r.evaluate(e);c.shouldAssign&&c.confidence>=r.minConfidence&&t.push({tagName:r.tag,confidence:c.confidence,evidenceCount:c.evidenceCount,lastUpdated:o});}return t}applyTagDecay(e,t){let o=t||Math.floor(Date.now()/1e3),r=[];for(let c of e){let i=o-c.lastUpdated,d=i/(1440*60),s=Math.floor(d*this.decayConfig.decayRatePerDay),A=Math.max(0,c.confidence-s);A>=this.decayConfig.minConfidence&&i<=this.decayConfig.maxAgeSeconds&&r.push({...c,confidence:A});}return r}mergeTags(e,t){let o=new Map;for(let r of e)o.set(r.tagName,r);for(let r of t){let c=o.get(r.tagName);c?(r.confidence>c.confidence||r.evidenceCount>c.evidenceCount)&&o.set(r.tagName,r):o.set(r.tagName,r);}return Array.from(o.values())}filterTags(e,t){let o=[...e],r=Math.floor(Date.now()/1e3);return t.category&&(o=o.filter(c=>this.getTagCategory(c.tagName)===t.category)),t.minConfidence!==void 0&&(o=o.filter(c=>c.confidence>=t.minConfidence)),t.maxAge!==void 0&&(o=o.filter(c=>r-c.lastUpdated<=t.maxAge)),t.activeOnly&&(o=o.filter(c=>r-c.lastUpdated<=_.STALE_TAG_THRESHOLD&&c.confidence>=this.decayConfig.minConfidence)),o}getTagCategory(e){return Object.values(su).includes(e)?"skill":Object.values(au).includes(e)?"behavior":Object.values(du).includes(e)?"compliance":"behavior"}validateTagName(e){return e.length>0&&e.length<=_.MAX_TAG_NAME_LENGTH}validateConfidence(e){return e>=0&&e<=_.MAX_TAG_CONFIDENCE}getConfidenceLevel(e){return e>=1e4?"Absolute":e>=9500?"Very High":e>=8e3?"High":e>=6e3?"Medium":e>=4e3?"Low":"Very Low"}sortByConfidence(e){return [...e].sort((t,o)=>o.confidence-t.confidence)}sortByEvidence(e){return [...e].sort((t,o)=>o.evidenceCount-t.evidenceCount)}sortByRecent(e){return [...e].sort((t,o)=>o.lastUpdated-t.lastUpdated)}getTopTags(e,t){return this.sortByConfidence(e).slice(0,t)}categorizeTags(e){let t=[],o=[],r=[],c=[];for(let i of e)switch(c.push(i.tagName),this.getTagCategory(i.tagName)){case "skill":t.push(i.tagName);break;case "behavior":o.push(i.tagName);break;case "compliance":r.push(i.tagName);break}return {allTags:c,skillTags:t,behaviorTags:o,complianceTags:r,tagScores:e,lastUpdated:e.length>0?Math.max(...e.map(i=>i.lastUpdated)):0}}};});var I0={};ne(I0,{MultiSourceAggregator:()=>YT});var YT,v0=a(()=>{YT=class{adapters=new Map;configs=new Map;CONFLICT_THRESHOLD=300;constructor(){}addSource(e,t){t.enabled&&(this.adapters.set(e.source,e),this.configs.set(e.source,t));}removeSource(e){this.adapters.delete(e),this.configs.delete(e);}updateSourceWeight(e,t){let o=this.configs.get(e);o&&(o.weight=t);}updateSourceReliability(e,t){let o=this.configs.get(e);o&&(o.reliability=t);}async aggregateReputation(e){let t=[];for(let[s,A]of this.adapters.entries())try{let y=await A.fetchReputationData(e.toString());A.validateData(y)&&t.push(y);}catch(y){console.warn(`Failed to fetch reputation from ${s}:`,y);}let o=this.calculateWeightedScore(t),{hasConflicts:r,conflicts:c}=this.detectConflicts(t),i=this.buildSourceBreakdowns(t),d=t.reduce((s,A)=>s+A.dataPoints,0);return {agentId:e,aggregateScore:o,sourceScores:i,hasConflicts:r,conflicts:c,totalDataPoints:d,timestamp:new Date}}calculateWeightedScore(e){if(e.length===0)return 0;let t=0,o=0;for(let r of e){let c=this.configs.get(r.source);if(!c)continue;let i=c.weight/1e4,d=r.reliability,s=r.score*i*d,A=i*d;t+=s,o+=A;}return o===0?0:Math.round(t/o)}detectConflicts(e){if(e.length<2)return {hasConflicts:false,conflicts:[]};let t=e.map(d=>d.score),o=Math.max(...t),r=Math.min(...t),c=o-r,i=[];if(c>this.CONFLICT_THRESHOLD){let d=e.find(A=>A.score===o)?.source,s=e.find(A=>A.score===r)?.source;return i.push(`High variance detected: ${c} (${(c/1e3*100).toFixed(1)}%) between ${d} (${o}) and ${s} (${r})`),{hasConflicts:true,conflicts:i}}return {hasConflicts:false,conflicts:[]}}buildSourceBreakdowns(e){return e.map(t=>{let o=this.configs.get(t.source);if(!o)throw new Error(`No config found for source: ${t.source}`);let r=o.weight,c=t.reliability*1e4,i=t.score*(r/1e4)*(c/1e4)/this.calculateNormalizationFactor(e);return {source:t.source,score:t.score,weight:r,reliability:Math.round(c),dataPoints:t.dataPoints,contribution:Math.round(i),lastUpdated:t.timestamp}})}calculateNormalizationFactor(e){let t=0;for(let o of e){let r=this.configs.get(o.source);if(!r)continue;let c=r.weight/1e4,i=o.reliability;t+=c*i;}return t||1}async getSourceBreakdown(e){return (await this.aggregateReputation(e)).sourceScores}getRegisteredSources(){return Array.from(this.adapters.keys())}getSourceConfig(e){return this.configs.get(e)}enableSource(e){let t=this.configs.get(e);t&&(t.enabled=true);}disableSource(e){let t=this.configs.get(e);t&&(t.enabled=false);}isSourceEnabled(e){return this.configs.get(e)?.enabled??false}};});te();FT();var GT={CONSERVATIVE:{name:"Conservative",mode:"TierOnly",metricVisibility:{showScore:"Private",showJobsCompleted:"Private",showSuccessRate:"Private",showResponseTime:"Private",showDisputes:"Private",showEarnings:"Private",showRatings:"Private",showBadges:"Public"},autoGrantClients:false},BALANCED:{name:"Balanced",mode:"Custom",metricVisibility:{showScore:"Private",showJobsCompleted:"Public",showSuccessRate:"Public",showResponseTime:"Public",showDisputes:"Private",showEarnings:"Private",showRatings:"Public",showBadges:"Public"},autoGrantClients:true},OPEN:{name:"Open",mode:"Public",metricVisibility:{showScore:"Public",showJobsCompleted:"Public",showSuccessRate:"Public",showResponseTime:"Public",showDisputes:"Public",showEarnings:"Public",showRatings:"Public",showBadges:"Public"},autoGrantClients:true}},Ee={SCORE_RANGES:{LOW:{min:2e3},MEDIUM:{min:5e3},HIGH:{min:7500},VERY_HIGH:{min:9e3}},TIER_THRESHOLDS:{BRONZE:2e3,SILVER:5e3,GOLD:7500,PLATINUM:9e3},MAX_AUTHORIZED_VIEWERS:100};E();function Yw(n){return typeof n!="object"||n===null?false:typeof n.IpfsHash=="string"}var At=class{rpc;rpcSubscriptions;commitment;endpoint;maxRetries;retryDelay;timeout;constructor(e){this.endpoint=e.endpoint,this.rpc=createSolanaRpc(e.endpoint),this.commitment=e.commitment??"confirmed",this.maxRetries=e.maxRetries??3,this.retryDelay=e.retryDelay??1e3,this.timeout=e.timeout??6e4,e.wsEndpoint&&(this.rpcSubscriptions=createSolanaRpcSubscriptions(e.wsEndpoint));}async getAccountInfo(e,t){return this.withRetry(async()=>{let o=await this.rpc.getAccountInfo(e,{commitment:t?.commitment??this.commitment,encoding:"base64"}).send();return o.value?this.parseAccountInfo(o.value):null})}async getMultipleAccounts(e,t){return this.withRetry(async()=>(await this.rpc.getMultipleAccounts(e,{commitment:t?.commitment??this.commitment,encoding:"base64"}).send()).value.map(r=>r?this.parseAccountInfo(r):null))}async getProgramAccounts(e,t){return this.withRetry(async()=>(await this.rpc.getProgramAccounts(e,{commitment:t?.commitment??this.commitment,encoding:"base64",filters:t?.filters}).send()).map(r=>{let c=r;return {pubkey:c.pubkey,account:this.parseAccountInfo(c.account)}}))}blockhashCache=null;async getLatestBlockhash(){let e=Date.now();if(this.blockhashCache&&e-this.blockhashCache.timestamp<1e3)return this.blockhashCache.value;let t=await this.withRetry(async()=>{let o=await this.rpc.getLatestBlockhash({commitment:this.commitment}).send();return {blockhash:o.value.blockhash,lastValidBlockHeight:BigInt(o.value.lastValidBlockHeight)}});return this.blockhashCache={value:t,timestamp:e},t}async sendTransaction(e,t){return this.withRetry(async()=>await this.rpc.sendTransaction(e,{encoding:"base64",skipPreflight:t?.skipPreflight??false,preflightCommitment:t?.preflightCommitment??this.commitment,maxRetries:t?.maxRetries?BigInt(t.maxRetries):void 0}).send())}async getSignatureStatuses(e){return this.withRetry(async()=>(await this.rpc.getSignatureStatuses(e).send()).value.map(o=>{if(!o)return null;let r=o;return {slot:r.slot,confirmations:r.confirmations,err:r.err,confirmationStatus:r.confirmationStatus}}))}async simulateTransaction(e,t){return this.withRetry(async()=>{let o=await this.rpc.simulateTransaction(e,{encoding:"base64",commitment:t?.commitment??this.commitment,replaceRecentBlockhash:t?.replaceRecentBlockhash??false}).send();return {err:o.value.err,logs:o.value.logs??[],unitsConsumed:o.value.unitsConsumed?BigInt(o.value.unitsConsumed):void 0,returnData:o.value.returnData}})}async getFeeForMessage(e){return this.withRetry(async()=>{let t=await this.rpc.getFeeForMessage(e,{commitment:this.commitment}).send();return t.value?BigInt(t.value):null})}async isHealthy(){try{return await this.rpc.getHealth().send(),!0}catch{return false}}async getVersion(){return await this.rpc.getVersion().send()}async subscribeToAccount(e,t){if(!this.rpcSubscriptions)throw new Error("WebSocket endpoint not configured");console.warn("Account subscription is not fully implemented in this version");let o=setInterval(async()=>{try{let r=await this.getAccountInfo(e);t(r);}catch(r){console.error("Subscription polling error:",r);}},5e3);return ()=>{clearInterval(o);}}async withRetry(e,t=this.maxRetries){let o;for(let r=0;r<=t;r++)try{return await e()}catch(c){o=c,r<t&&await new Promise(i=>setTimeout(i,this.retryDelay*Math.pow(2,r)));}throw o}parseAccountInfo(e){let t=e,o=t.data,r=Array.isArray(o)?o[0]:o;return {executable:t.executable,lamports:typeof t.lamports=="number"?lamports(BigInt(t.lamports)):t.lamports,owner:t.owner,rentEpoch:t.rentEpoch!==void 0?typeof t.rentEpoch=="number"?BigInt(t.rentEpoch):t.rentEpoch:BigInt(0),data:Buffer.from(r,"base64"),space:t.space?typeof t.space=="number"?BigInt(t.space):t.space:void 0}}};function Cpe(n,e="mainnet-beta"){let t="https://explorer.solana.com/tx";switch(e){case "devnet":return `${t}/${n}?cluster=devnet`;case "testnet":return `${t}/${n}?cluster=testnet`;case "localnet":return `${t}/${n}?cluster=custom&customUrl=http://localhost:8899`;default:return `${t}/${n}`}}function Rpe(n,e="mainnet-beta"){let t="https://solscan.io/tx";switch(e){case "devnet":return `${t}/${n}?cluster=devnet`;case "testnet":return `${t}/${n}?cluster=testnet`;case "localnet":return `Local transaction: ${n} (not viewable on Solscan)`;default:return `${t}/${n}`}}function bpe(n,e="mainnet-beta"){let t="https://solana.fm/tx";switch(e){case "devnet":return `${t}/${n}?cluster=devnet-solana`;case "testnet":return `${t}/${n}?cluster=testnet-solana`;case "localnet":return `Local transaction: ${n} (not viewable on SolanaFM)`;default:return `${t}/${n}`}}function Ipe(n,e="mainnet-beta"){let t="https://xray.helius.xyz/tx";switch(e){case "devnet":return `${t}/${n}?network=devnet`;case "testnet":return `${t}/${n}?network=testnet`;case "localnet":return `Local transaction: ${n} (not viewable on XRAY)`;default:return `${t}/${n}`}}function vpe(n,e="mainnet-beta"){return {solanaExplorer:Cpe(n,e),solscan:Rpe(n,e),solanaFM:bpe(n,e),xray:Ipe(n,e)}}function WT(n,e,t="confirmed"){return {signature:n,cluster:e,urls:vpe(n,e),commitment:t,timestamp:Date.now()}}function NT(n,e){console.error("\u{1F6A8} GhostSpeak SDK Error:",n.message),e&&(e.operation&&console.error("\u{1F527} Operation:",e.operation),e.instructionName&&console.error("\u{1F4CB} Instruction:",e.instructionName),e.accounts&&(console.error("\u{1F3E6} Accounts provided:",e.accounts.length),e.accounts.forEach((t,o)=>{if(typeof t=="string")console.error(` ${o+1}. ${t}`);else if(typeof t=="object"){let r="address"in t?t.address:t,c="name"in t?t.name:void 0;console.error(` ${o+1}. ${r}${c?` (${c})`:""}`);}else console.error(` ${o+1}. ${String(t)}`);})),e.params&&console.error("\u2699\uFE0F Parameters:",e.params)),console.error(`
|
|
2
|
-
\u{1F4A1} Troubleshooting tips:`),console.error(" 1. Check that all required accounts are provided"),console.error(" 2. Verify account addresses are correct"),console.error(" 3. Ensure signers have sufficient SOL for transaction fees"),console.error(" 4. Confirm the program is deployed on the target network");}function
|
|
3
|
-
`)}exportLogs(){return [...this.logs]}clearLogs(){this.logs=[],this.timings.clear();}};function
|
|
4
|
-
`)}async estimateCost(e){try{let t=await Promise.all(e.map(async A=>{let y=await Promise.resolve(A());return pu(y),y})),o=await this.rpcClient.getLatestBlockhash(),r={blockhash:o.blockhash,lastValidBlockHeight:o.lastValidBlockHeight},c=pipe(createTransactionMessage({version:0}),A=>setTransactionMessageFeePayer(this.config.defaultFeePayer,A),A=>setTransactionMessageLifetimeUsingBlockhash(r,A),A=>appendTransactionMessageInstructions(t,A)),i=compileTransactionMessage(c),d=Buffer.from(i).toString("base64"),s=await this.rpcClient.getFeeForMessage(d);return BigInt(s??0)}catch{return 5000n+BigInt(e.length)*1000n}}async sendAndConfirm(e,t,o=30){let r=getBase64EncodedWireTransaction(e),c=await this.rpcClient.sendTransaction(r,{skipPreflight:t,preflightCommitment:this.config.commitment});console.log("\u{1F50D} Transaction sent, signature:",c),console.log("\u{1F50D} Signature length:",c.length),console.log("\u{1F50D} Signature type:",typeof c);let i=false,d=0,s=1e3,A=3e4,y=Date.now();for(;!i&&d<o&&Date.now()-y<A;)try{console.log(`\u{1F50D} Confirmation attempt ${d+1}/${o}`);let R=await this.rpcClient.getSignatureStatuses([c]);if(R[0]){if(console.log("\u{1F50D} Status found:",R[0]),R[0].err)throw new Error(`Transaction failed: ${JSON.stringify(R[0].err,(k,P)=>typeof P=="bigint"?P.toString():P)}`);let D=R[0].confirmationStatus;if(D===this.config.commitment||this.config.commitment==="confirmed"&&D==="finalized"){i=!0,console.log("\u2705 Transaction confirmed via status check");break}}else {console.log("\u{1F50D} No status found, trying transaction details...");try{let{createSolanaRpc:D}=await import('@solana/kit'),P=await D(this.config.rpcEndpoint??"https://api.devnet.solana.com").getTransaction(c,{commitment:this.config.commitment??"confirmed",encoding:"json",maxSupportedTransactionVersion:0}).send();if(P&&P.meta){if(P.meta.err)throw new Error(`Transaction failed: ${JSON.stringify(P.meta.err,(w,F)=>typeof F=="bigint"?F.toString():F)}`);i=!0,console.log("\u2705 Transaction confirmed via direct lookup");break}}catch{console.log("\u{1F50D} Transaction details not yet available");}}d++,await new Promise(D=>setTimeout(D,s)),s=Math.min(s*1.5,5e3);}catch(R){if(R instanceof Error&&R.message.includes("Transaction failed"))throw R;console.log("\u{1F50D} Confirmation attempt failed:",R.message),d++,await new Promise(D=>setTimeout(D,s*2));}if(!i){console.log("\u{1F50D} Final confirmation attempt via transaction lookup...");try{let{createSolanaRpc:R}=await import('@solana/kit'),k=await R(this.config.rpcEndpoint??"https://api.devnet.solana.com").getTransaction(c,{commitment:this.config.commitment??"confirmed",encoding:"json",maxSupportedTransactionVersion:0}).send();if(k&&k.meta){if(k.meta.err)throw new Error(`Transaction failed: ${JSON.stringify(k.meta.err,(P,w)=>typeof w=="bigint"?w.toString():w)}`);return console.log("\u2705 Transaction confirmed on final check - returning success"),c}}catch(R){console.log("\u{1F50D} Final check failed:",R.message);}return console.log("\u26A0\uFE0F Transaction confirmation timed out, but transaction was sent"),console.log(` Check status at: https://explorer.solana.com/tx/${c}?cluster=${this.config.cluster||"devnet"}`),c}return c}async simulateInstruction(e,t){let o=await this.rpcClient.getLatestBlockhash(),r={blockhash:o.blockhash,lastValidBlockHeight:o.lastValidBlockHeight},c=pipe(createTransactionMessage({version:0}),s=>setTransactionMessageFeePayerSigner(t[0],s),s=>setTransactionMessageLifetimeUsingBlockhash(r,s),s=>appendTransactionMessageInstructions([e],s)),i=await signTransactionMessageWithSigners(c),d=getBase64EncodedWireTransaction(i);return this.rpcClient.simulateTransaction(d,{commitment:this.config.commitment,replaceRecentBlockhash:true})}async simulateBatch(e,t){let o=await this.rpcClient.getLatestBlockhash(),r={blockhash:o.blockhash,lastValidBlockHeight:o.lastValidBlockHeight},c=pipe(createTransactionMessage({version:0}),s=>setTransactionMessageFeePayerSigner(t[0],s),s=>setTransactionMessageLifetimeUsingBlockhash(r,s),s=>appendTransactionMessageInstructions(e,s)),i=await signTransactionMessageWithSigners(c),d=getBase64EncodedWireTransaction(i);return this.rpcClient.simulateTransaction(d,{commitment:this.config.commitment,replaceRecentBlockhash:true})}estimateTransactionSize(e){let t=64;for(let o of e)t+=32,t+=(o.accounts?.length??0)*32,t+=o.data.length;return t}extractRawData(e){if(Buffer.isBuffer(e)||e instanceof Uint8Array)return new Uint8Array(e);if(typeof e=="object"&&e!==null&&"data"in e)return Buffer.from(e.data,"base64");if(typeof e=="string")return Buffer.from(e,"base64");throw new Error("Invalid account data format")}async createCommunicationSession(e){return {programAddress:this.config.programId,accounts:[],data:new Uint8Array(0)}}async sendCommunicationMessage(e,t){return {programAddress:this.config.programId,accounts:[],data:new Uint8Array(0)}}async updateParticipantStatus(e){return {programAddress:this.config.programId,accounts:[],data:new Uint8Array(0)}}};var mu={processed:500,confirmed:2e3,finalized:3e4},yu=class{accountCache;pdaCache;config;ttls;constructor(e={}){this.config={enabled:e.enabled??false,maxSize:e.maxSize??1e3,ttlOverrides:e.ttlOverrides??{}},this.ttls={processed:e.ttlOverrides?.processed??mu.processed,confirmed:e.ttlOverrides?.confirmed??mu.confirmed,finalized:e.ttlOverrides?.finalized??mu.finalized},this.accountCache=new LRUCache({max:this.config.maxSize,ttl:mu.finalized}),this.pdaCache=new LRUCache({max:this.config.maxSize});}isEnabled(){return this.config.enabled}getAccount(e,t,o){if(!this.config.enabled)return;let r=`${e}:${t}`,c=this.accountCache.get(r);if(c){if(o!==void 0&&c.slot<o){this.accountCache.delete(r);return}return c.data}}setAccount(e,t,o,r){if(!this.config.enabled)return;let c=`${e}:${o}`,i={data:t,slot:r,commitment:o,timestamp:Date.now()};this.accountCache.set(c,i,{ttl:this.ttls[o]});}getPDA(e){if(this.config.enabled)return this.pdaCache.get(e)}setPDA(e,t){this.config.enabled&&this.pdaCache.set(e,t);}invalidateAccount(e,t){this.config.enabled&&(t?this.accountCache.delete(`${e}:${t}`):["processed","confirmed","finalized"].forEach(o=>{this.accountCache.delete(`${e}:${o}`);}));}clear(){this.accountCache.clear(),this.pdaCache.clear();}getStats(){return {accountCache:{size:this.accountCache.size,max:this.config.maxSize},pdaCache:{size:this.pdaCache.size,max:this.config.maxSize}}}};var z=class{builder;config;logger;cacheManager;_debugMode=false;constructor(e){this.config=e,this.builder=new lu(e),this.cacheManager=new yu(e.cache),this.logger=e.logger;}debug(){return this._debugMode=true,this.builder.enableDebug(),this}async execute(e,t,o){return this.builder.execute(e,t,o)}async executeWithDetails(e,t,o){return this.builder.execute(e,t,o,{returnDetails:true})}async executeBatch(e,t,o){return this.builder.executeBatch(e,t.map(r=>()=>Promise.resolve(r())),o)}async simulate(e,t,o){return this.builder.execute(e,()=>Promise.resolve(t()),o,{simulate:true})}async simulateInstruction(e,t,o){return this.simulate(e,t,o)}async estimateCost(e){return this.builder.estimateCost(e)}async getCost(e,t){return this.builder.estimateCost([t])}async explain(e,t){return this.builder.explain(e,[t])}async analyze(e,t){return this.builder.debug(e,[t])}async getAccount(e,t){if(this.cacheManager.isEnabled()){let r=this.cacheManager.getAccount(e,this.commitment);if(r!==void 0)return this.logger?.info(`[Cache HIT] ${e}`),r}let o=await this.builder.getAccount(e,t);return this.cacheManager.isEnabled()&&o!==null&&(this.cacheManager.setAccount(e,o,this.commitment,0),this.logger?.info(`[Cache SET] ${e}`)),o}async getAccounts(e,t){if(!this.cacheManager.isEnabled())return this.builder.getAccounts(e,t);let o=new Array(e.length),r=[],c=[];for(let i=0;i<e.length;i++){let d=this.cacheManager.getAccount(e[i],this.commitment);d!==void 0?(o[i]=d,this.logger?.info(`[Cache HIT] ${e[i]}`)):(r.push(i),c.push(e[i]));}if(c.length>0){this.logger?.info(`[Cache MISS] Fetching ${c.length}/${e.length} accounts`);let i=await this.builder.getAccounts(c,t),d=0;for(let s=0;s<i.length;s++){let A=r[s],y=i[s];o[A]=y,y!==null&&this.cacheManager.setAccount(c[s],y,this.commitment,d);}}return o}async getProgramAccounts(e,t){return this.builder.getProgramAccounts(e,t)}get programId(){return this.config.programId}getProgramId(){return this.config.programId}get commitment(){return this.config.commitment??"confirmed"}getCommitment(){return this.config.commitment??"confirmed"}invalidateCache(e){this.cacheManager.invalidateAccount(e),this.logger?.info(`[Cache INVALIDATE] ${e}`);}clearCache(){this.cacheManager.clear(),this.logger?.info("[Cache CLEAR] All caches cleared");}getCacheStats(){return this.cacheManager.getStats()}};var t0=new Map,LT=0,Tu=class{constructor(e){this.config=e;console.log("\u{1F9EA} Initialized TestIPFSProvider for local testing (shared storage)");}storage=t0;uploadCount=0;async upload(e,t){LT++;let o=typeof e=="string"?e:new TextDecoder().decode(e),r=`Qm${this.generateHash(o)}_test_${LT}`;this.storage.set(r,{content:e,pinned:t?.pin!==false});let c=typeof e=="string"?new TextEncoder().encode(e).length:e.length;return console.log(`\u{1F4E6} Test IPFS upload: ${r} (${c} bytes)`),{hash:r,uri:`ipfs://${r}`,size:c,timestamp:Date.now(),pinned:t?.pin!==false,gateways:[`http://localhost:8080/ipfs/${r}`,`https://test.ipfs.io/ipfs/${r}`]}}async retrieve(e){let t=this.storage.get(e);if(!t)throw new Error(`Test IPFS: Content not found for hash ${e}`);return console.log(`\u{1F4E5} Test IPFS retrieve: ${e}`),await new Promise(o=>setTimeout(o,100)),t.content}async pin(e){let t=this.storage.get(e);return t?(t.pinned=true,console.log(`\u{1F4CC} Test IPFS pin: ${e}`),{hash:e,success:true,status:"pinned"}):{hash:e,success:false,status:"failed",error:`Content not found: ${e}`}}async unpin(e){let t=this.storage.get(e);return t?(t.pinned=false,console.log(`\u{1F4CC} Test IPFS unpin: ${e}`),{hash:e,success:true,status:"pinned"}):{hash:e,success:false,status:"failed",error:`Content not found: ${e}`}}generateHash(e){let t=0;for(let i=0;i<e.length;i++){let d=e.charCodeAt(i);t=(t<<5)-t+d,t=t&t;}let o="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",r="",c=Math.abs(t);for(;c>0&&r.length<40;)r=o[c%o.length]+r,c=Math.floor(c/o.length);for(;r.length<40;)r=o[Math.floor(Math.random()*o.length)]+r;return r}getStats(){let e=0,t=0;for(let o of this.storage.values()){let r=typeof o.content=="string"?new TextEncoder().encode(o.content).length:o.content.length;e+=r,o.pinned&&t++;}return {count:this.storage.size,totalSize:e,pinned:t}}clear(){this.storage.clear(),LT=0,console.log("\u{1F9F9} Test IPFS storage cleared");}static getSharedStorage(){return t0}};var KT=class{constructor(e){this.config=e;}async upload(e,t){let o=this.config.endpoint??"https://api.pinata.cloud",r=new FormData,c=new Blob([e],{type:t?.contentType??"application/octet-stream"});r.append("file",c,t?.filename??"content"),t?.metadata&&r.append("pinataMetadata",JSON.stringify({name:t.filename??"ghostspeak-content",keyvalues:t.metadata}));let i=await fetch(`${o}/pinning/pinFileToIPFS`,{method:"POST",headers:{Authorization:`Bearer ${this.config.jwt??this.config.apiKey}`,...this.config.headers},body:r});if(!i.ok){let A=await i.text();throw new Error(`Pinata upload failed: ${i.status} ${A}`)}let d=await i.json(),s=typeof e=="string"?new TextEncoder().encode(e).length:e.length;if(!Yw(d))throw new Error("Invalid IPFS upload response format");return {hash:d.IpfsHash,uri:`ipfs://${d.IpfsHash}`,size:s,timestamp:Date.now(),pinned:true,gateways:[`https://gateway.pinata.cloud/ipfs/${d.IpfsHash}`,`https://ipfs.io/ipfs/${d.IpfsHash}`]}}async retrieve(e,t){let r=`${t?.gateway??"https://gateway.pinata.cloud"}/ipfs/${e}`,c=await fetch(r,{signal:t?.timeout?AbortSignal.timeout(t.timeout):void 0});if(!c.ok)throw new Error(`Failed to retrieve from IPFS: ${c.status} ${c.statusText}`);let i=c.headers.get("content-type");return i?.startsWith("text/")||i?.includes("json")?c.text():new Uint8Array(await c.arrayBuffer())}async pin(e){let t=this.config.endpoint??"https://api.pinata.cloud",o=await fetch(`${t}/pinning/pinByHash`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.config.jwt??this.config.apiKey}`,...this.config.headers},body:JSON.stringify({hashToPin:e})}),r=o.ok;return {hash:e,success:r,status:r?"pinned":"failed",error:r?void 0:`Pin failed: ${o.status}`}}async unpin(e){let t=this.config.endpoint??"https://api.pinata.cloud",o=await fetch(`${t}/pinning/unpin/${e}`,{method:"DELETE",headers:{Authorization:`Bearer ${this.config.jwt??this.config.apiKey}`,...this.config.headers}}),r=o.ok;return {hash:e,success:r,status:r?"pinned":"failed",error:r?void 0:`Unpin failed: ${o.status}`}}},HT=class{constructor(e){this.config=e;}async upload(e,t){let o=this.config.endpoint??"http://localhost:5001",r=new FormData,c=new Blob([e],{type:t?.contentType??"application/octet-stream"});r.append("file",c,t?.filename??"content");let i=await fetch(`${o}/api/v0/add`,{method:"POST",body:r});if(!i.ok)throw new Error(`IPFS HTTP upload failed: ${i.status}`);let d=await i.json(),s=typeof e=="string"?new TextEncoder().encode(e).length:e.length;if(typeof d!="object"||d===null)throw new Error("Invalid IPFS HTTP API response");let A=d;if(typeof A.Hash!="string")throw new Error("IPFS HTTP API response missing Hash field");let y=A.Hash;return {hash:y,uri:`ipfs://${y}`,size:s,timestamp:Date.now(),pinned:t?.pin!==false,gateways:[`${o}/ipfs/${y}`,`https://ipfs.io/ipfs/${y}`]}}async retrieve(e,t){let r=`${t?.gateway??this.config.endpoint?.replace("/api/v0","")??"https://ipfs.io"}/ipfs/${e}`,c=await fetch(r,{signal:t?.timeout?AbortSignal.timeout(t.timeout):void 0});if(!c.ok)throw new Error(`Failed to retrieve from IPFS: ${c.status}`);let i=c.headers.get("content-type");return i?.startsWith("text/")||i?.includes("json")?c.text():new Uint8Array(await c.arrayBuffer())}async pin(e){let t=this.config.endpoint??"http://localhost:5001",o=await fetch(`${t}/api/v0/pin/add?arg=${e}`,{method:"POST"}),r=o.ok;return {hash:e,success:r,status:r?"pinned":"failed",error:r?void 0:`Pin failed: ${o.status}`}}async unpin(e){let t=this.config.endpoint??"http://localhost:5001",o=await fetch(`${t}/api/v0/pin/rm?arg=${e}`,{method:"POST"}),r=o.ok;return {hash:e,success:r,status:r?"pinned":"failed",error:r?void 0:`Unpin failed: ${o.status}`}}},fu=class{constructor(e){this.config=e;this.initializeProviders();}providers=[];cache=new Map;initializeProviders(){if(this.providers.push(this.createProvider(this.config.provider)),this.config.fallbackProviders)for(let e of this.config.fallbackProviders)this.providers.push(this.createProvider(e));}createProvider(e){switch(e.name){case "pinata":return new KT(e);case "ipfs-http-client":case "custom":return new HT(e);case "test":return new Tu(e);default:throw new Error(`Unsupported IPFS provider: ${e.name}`)}}async upload(e,t){let o=Date.now(),r;for(let c=0;c<this.providers.length;c++){let i=this.providers[c];try{console.log(`\u{1F4E4} Attempting IPFS upload with provider ${c+1}/${this.providers.length}`);let d=await this.withRetry(()=>i.upload(e,t),this.config.maxRetries??3,this.config.retryDelay??1e3);return console.log(`\u2705 IPFS upload successful: ${d.hash}`),{success:!0,data:d,duration:Date.now()-o,provider:this.config.provider.name}}catch(d){console.warn(`\u274C Provider ${c+1} upload failed:`,d instanceof Error?d.message:String(d)),r=d instanceof Error?d:new Error(String(d));}}return {success:false,error:"UPLOAD_FAILED",message:`All providers failed. Last error: ${r?.message}`,duration:Date.now()-o}}async retrieve(e,t){let o=Date.now();if(this.config.enableCache&&t?.cache!==false){let i=this.cache.get(e);if(i&&Date.now()-i.timestamp<(this.config.cacheTTL??3e5))return {success:true,data:{content:i.content,size:(typeof i.content=="string",i.content.length),hash:e,gateway:"cache",fromCache:true},duration:Date.now()-o}}let r,c=t?.gateway?[t.gateway]:this.config.gateways??["https://ipfs.io"];for(let i of c)for(let d of this.providers)try{let s=await this.withRetry(()=>d.retrieve(e,{...t,gateway:i}),this.config.maxRetries??3,this.config.retryDelay??1e3);return this.config.enableCache&&this.cache.set(e,{content:s,timestamp:Date.now()}),{success:!0,data:{content:s,size:s.length,hash:e,gateway:i,fromCache:!1},duration:Date.now()-o}}catch(s){r=s instanceof Error?s:new Error(String(s));}return {success:false,error:"RETRIEVAL_FAILED",message:`Failed to retrieve from all gateways. Last error: ${r?.message}`,duration:Date.now()-o}}async pin(e){let t=Date.now();for(let o of this.providers)try{let r=await o.pin(e);return {success:r.success,data:r,duration:Date.now()-t}}catch(r){console.warn("Pin attempt failed:",r);}return {success:false,error:"PIN_FAILED",message:"All pin attempts failed",duration:Date.now()-t}}async storeContent(e,t,o){let r=new TextEncoder().encode(e).length,c=this.config.sizeThreshold??800;if(!(o?.forceIpfs??r>c))return {uri:`data:application/json;base64,${btoa(e)}`,useIpfs:false,size:r};let d=await this.upload(e,o);if(!d.success||!d.data)throw new Error(`IPFS upload failed: ${d.message}`);let s={type:t,originalSize:r,ipfsHash:d.data.hash,encoding:"utf8",compression:"none",mimeType:"application/json",uploadedAt:d.data.timestamp,pinned:d.data.pinned,checksum:await this.calculateChecksum(e)};return {uri:d.data.uri,useIpfs:true,ipfsMetadata:s,size:r}}async retrieveContent(e){if(e.startsWith("data:")){let t=e.split(",")[1];if(!t)throw new Error("Invalid data URI format");return atob(t)}if(e.startsWith("ipfs://")){let t=e.replace("ipfs://",""),o=await this.retrieve(t);if(!o.success||!o.data)throw new Error(`Failed to retrieve IPFS content: ${o.message}`);return typeof o.data.content=="string"?o.data.content:new TextDecoder().decode(o.data.content)}throw new Error(`Unsupported URI format: ${e}`)}async withRetry(e,t,o){let r;for(let c=0;c<=t;c++)try{return await e()}catch(i){r=i instanceof Error?i:new Error(String(i)),c<t&&(console.log(`\u23F3 Retrying in ${o}ms... (attempt ${c+1}/${t})`),await new Promise(d=>setTimeout(d,o)));}throw r}async calculateChecksum(e){let o=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",o);return Array.from(new Uint8Array(r)).map(i=>i.toString(16).padStart(2,"0")).join("")}clearCache(){this.cache.clear();}getCacheStats(){return {size:this.cache.size,keys:Array.from(this.cache.keys())}}};var en={provider:{name:"pinata",endpoint:"https://api.pinata.cloud"},gateways:["https://gateway.pinata.cloud","https://ipfs.io","https://cloudflare-ipfs.com","https://gateway.ipfs.io"],autoPinning:true,sizeThreshold:800,maxRetries:3,retryDelay:1e3,enableCache:true,cacheTTL:3e5},jT=class{client;constructor(e){this.client=new fu(e);}async storeAgentMetadata(e,t){let o=JSON.stringify({...e,createdAt:new Date().toISOString(),version:"1.0.0"});return this.client.storeContent(o,"agent-metadata",{filename:`agent-${e.agentId??"metadata"}.json`,metadata:{type:"agent-metadata",agentId:e.agentId,name:e.name},contentType:"application/json",...t})}async storeChannelMessage(e,t){let o=JSON.stringify({...e,timestamp:new Date().toISOString(),version:"1.0.0"});return this.client.storeContent(o,"channel-message",{filename:`message-${Date.now()}.json`,metadata:{type:"channel-message",channelId:e.channelId,messageType:e.messageType??0},contentType:"application/json",...t})}async storeFileAttachment(e,t,o,r){let c=typeof e=="string"?e:new TextDecoder().decode(e);return this.client.storeContent(c,"file-attachment",{filename:t,contentType:o,metadata:{type:"file-attachment",originalFilename:t,mimeType:o},...r})}async retrieveAgentMetadata(e){let t=await this.client.retrieveContent(e),o=JSON.parse(t);if(typeof o!="object"||o===null)throw new Error("Retrieved agent metadata is not a valid object");return o}async retrieveChannelMessage(e){let t=await this.client.retrieveContent(e),o=JSON.parse(t);if(typeof o!="object"||o===null)throw new Error("Retrieved channel message is not a valid object");return o}async batchUpload(e){return (await Promise.allSettled(e.map(o=>this.client.storeContent(o.content,o.type,{filename:o.filename,...o.options})))).map(o=>o.status==="fulfilled"?{success:true,data:o.value}:{success:false,error:"UPLOAD_FAILED",message:o.reason instanceof Error?o.reason.message:String(o.reason)})}async pinContent(e){let t=await this.client.pin(e);return {...t,data:t.success}}isIPFSUri(e){return e.startsWith("ipfs://")}extractIPFSHash(e){return this.isIPFSUri(e)?e.replace("ipfs://",""):null}getGatewayUrls(e,t){return (t??en.gateways??[]).map(r=>`${r}/ipfs/${e}`)}isValidIPFSHash(e){return e.length<44?false:e.startsWith("Qm")&&e.length===46?/^Qm[A-Za-z0-9]{44}$/.test(e):e.length>46?/^[A-Za-z0-9]+$/.test(e):false}shouldUseIPFS(e,t){let o=new TextEncoder().encode(e).length,r=t??en.sizeThreshold??800;return o>r}async compressContent(e){try{if(typeof CompressionStream<"u"){let t=new CompressionStream("gzip"),o=t.writable.getWriter(),r=t.readable.getReader(),i=new TextEncoder().encode(e),d=o.write(i).then(()=>o.close()),s=[],A=async()=>{let P=await r.read(),{done:w,value:F}=P;!w&&F&&(s.push(F),await A());};await Promise.all([d,A()]);let y=s.reduce((P,w)=>P+w.length,0),R=new Uint8Array(y),D=0;for(let P of s)R.set(P,D),D+=P.length;return {compressed:Buffer.from(R).toString("base64"),algorithm:"gzip"}}else return console.warn("Compression not available in this environment, storing uncompressed"),{compressed:e,algorithm:"none"}}catch(t){return console.warn("Compression failed, falling back to uncompressed:",t),{compressed:e,algorithm:"none"}}}async decompressContent(e,t){if(t==="none")return e;try{if(t==="gzip")if(typeof DecompressionStream<"u"){let o=new DecompressionStream("gzip"),r=o.writable.getWriter(),c=o.readable.getReader(),i=Buffer.from(e,"base64"),d=r.write(i).then(()=>r.close()),s=[],A=async()=>{let P=await c.read(),{done:w,value:F}=P;!w&&F&&(s.push(F),await A());};await Promise.all([d,A()]);let y=s.reduce((P,w)=>P+w.length,0),R=new Uint8Array(y),D=0;for(let P of s)R.set(P,D),D+=P.length;return new TextDecoder().decode(R)}else return console.warn("Decompression not available in this environment, returning compressed data"),e;else return console.warn(`Unknown compression algorithm: ${t}`),e}catch(o){return console.error("Decompression failed, returning compressed data:",o),e}}getStats(){return {cacheStats:this.client.getCacheStats(),config:en}}clearCache(){this.client.clearCache();}};function n0(n){let e={...en,...n,provider:{...en.provider,...n?.provider}};return new jT(e)}var r0=address("11111111111111111111111111111111");address("11111111111111111111111111111111");address("SysvarRecentB1ockHashes11111111111111111111");address("SysvarStakeHistory1111111111111111111111111");address("Sysvar1nstructions1111111111111111111111111");address("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");address("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");address("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");address("So11111111111111111111111111111111111111112");address("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");address("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s");te();var tn=class extends z{ipfsUtils=null;constructor(e){super(e),e.ipfsConfig&&(this.ipfsUtils=n0(e.ipfsConfig));}async register(e,t){let o=t.pricingModel??0,r=async()=>{let i=await this.deriveAgentPda(t.agentId,e.address);return await ny({agentAccount:i,signer:e,systemProgram:this.systemProgramId,agentType:t.agentType,name:t.name,description:t.description,metadataUri:t.metadataUri,agentId:t.agentId,pricingModel:o})},c=()=>{let i=new Uint8Array(5);return i[0]=1,new DataView(i.buffer).setUint32(1,256*1024,true),{programAddress:"ComputeBudget111111111111111111111111111111",accounts:[],data:i}};return this.debug(),t.skipSimulation?(console.log("\u{1F680} SKIPPING SIMULATION - Sending transaction directly"),this.builder.executeBatch("registerAgent",[c,r],[e],{simulate:false,skipPreflight:true})):this.builder.executeBatch("registerAgent",[c,r],[e])}async registerCompressed(e,t){let o=async()=>{let r=t.treeConfig||await this.deriveTreeConfigPda(e.address);return await iy({merkleTree:t.merkleTree,treeAuthority:r,signer:e,systemProgram:this.systemProgramId,compressionProgram:this.compressionProgramId,agentType:t.agentType,name:t.name,description:t.description,metadataUri:t.metadataUri,agentId:t.agentId,pricingModel:t.pricingModel??0,logWrapper:"noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV"})};return this.execute("registerAgentCompressed",o,[e])}async update(e,t){let o=()=>Gy({agentAccount:t.agentAddress,signer:e,metadataUri:t.metadataUri,agentType:t.agentType,agentId:t.agentId,name:t.name??null,description:t.description??null,pricingModel:t.pricingModel??0});return this.execute("updateAgent",o,[e])}async verify(e,t){let o=async()=>await wT({agent:t.agentAddress,verifier:e,agentPubkey:t.agentPubkey,serviceEndpoint:t.serviceEndpoint,supportedCapabilities:t.supportedCapabilities,verifiedAt:t.verifiedAt});return this.execute("verifyAgent",o,[e])}async deactivate(e,t){let o=()=>n1({agentAccount:t.agentAddress,signer:e,agentId:t.agentId});return this.execute("deactivateAgent",o,[e])}async activate(e,t){let o=()=>Tm({agentAccount:t.agentAddress,signer:e,agentId:t.agentId});return this.execute("activateAgent",o,[e])}async getAgentAccount(e){return super.getAccount(e,"getAgentDecoder")}async getAllAgents(){return this.getProgramAccounts("getAgentDecoder")}async getAgentsByType(e){let t=Buffer.alloc(1);t.writeUInt8(e,0);let o=[{memcmp:{offset:BigInt(8),bytes:t.toString("base64"),encoding:"base64"}}];return this.getProgramAccounts("getAgentDecoder",o)}async getUserAgents(e){let t=[{memcmp:{offset:BigInt(9),bytes:e,encoding:"base58"}}];return this.getProgramAccounts("getAgentDecoder",t)}async batchGetAgents(e,t){return super.getAccounts(e,"getAgentDecoder")}async batchGetExistingAgents(e,t){let{batchGetExistingAccounts:o}=await Promise.resolve().then(()=>(qT(),$T));return o(this.config.rpc,e,{onProgress:t})}async batchGetAndMapAgents(e,t){let{batchGetAndMap:o}=await Promise.resolve().then(()=>(qT(),$T));return o(this.config.rpc,e,t)}async deriveAgentPda(e,t){let{deriveAgentPda:o}=await Promise.resolve().then(()=>(Pu(),Du)),[r]=await o({programAddress:this.programId,owner:t,agentId:e});return r}async deriveUserRegistryPda(e){let{deriveUserRegistryPda:t}=await Promise.resolve().then(()=>(Pu(),Du));return t(this.programId,e)}async deriveTreeConfigPda(e){let{getProgramDerivedAddress:t,getAddressEncoder:o}=await import('@solana/addresses'),c=o().encode(e),[i]=await t({programAddress:this.programId,seeds:[new TextEncoder().encode("agent_tree_config"),c]});return i}get systemProgramId(){return r0}get compressionProgramId(){return "cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK"}};te();var nn=class extends z{getInitializeGovernanceProposalInstruction(e){return Kt(e)}async createProposal(e){let t=this.deriveProposalPda(e.signer.address,e.title),o=await this.getInitializeGovernanceProposalInstruction({proposal:t,proposer:e.signer,title:e.title,description:e.description,proposalType:{kind:e.proposalType,data:{}},executionParams:{instructions:[],accounts:[],targetProgram:t,executeAfter:BigInt(e.executionDelay??0)},proposalId:BigInt(Date.now())});return this.execute("createProposal",()=>o,[e.signer])}async getProposal(e){return super.getAccount(e,"getGovernanceProposalDecoder")}async getActiveProposals(){return this.getProgramAccounts("getGovernanceProposalDecoder")}async getProposalsByProposer(e){let t=[{memcmp:{offset:BigInt(8),bytes:e,encoding:"base58"}}];return this.getProgramAccounts("getGovernanceProposalDecoder",t)}async getProposalsByStatus(e){let t=await this.getProgramAccounts("getGovernanceProposalDecoder");return t.filter(o=>t.length>0)}deriveProposalPda(e,t){return `proposal_${e}_${t}`}};te();var rn=class extends z{async createMultisig(e){throw new Error("createMultisig: Instruction not available - requires IDL regeneration")}async createProposal(e){let t=await Kt({proposer:e.proposer,proposalId:e.proposalId,title:e.title,description:e.description,proposalType:e.proposalType,executionParams:e.executionParams},{programAddress:this.programId});return this.execute("createProposal",()=>t,[e.proposer])}async executeProposal(e){throw new Error("executeProposal: Use protocol_config instructions for execution")}};var qpe="https://staging.crossmint.com",Jpe="https://www.crossmint.com",JT={AGENT_IDENTITY:"GhostSpeakAgentIdentity",REPUTATION_SCORE:"GhostSpeakReputation",JOB_COMPLETION:"GhostSpeakJobCompletion"},Eu=class{apiKey;baseUrl;chain;constructor(e){this.apiKey=e.apiKey,this.baseUrl=e.environment==="production"?Jpe:qpe,this.chain=e.chain||"base-sepolia";}async createAgentIdentityType(){let e=JT.AGENT_IDENTITY,t={$schema:"https://json-schema.org/draft/2020-12/schema",title:"GhostSpeak Agent Identity",description:"Verified AI agent identity on the GhostSpeak Protocol",type:"object",properties:{credentialSubject:{type:"object",properties:{agentId:{type:"string"},owner:{type:"string"},capabilities:{type:"array",items:{type:"string"}},registeredAt:{type:"string"},reputationScore:{type:"number"},totalJobsCompleted:{type:"integer"},verified:{type:"boolean"},id:{type:"string"}},required:["agentId","owner","capabilities","registeredAt","verified"],additionalProperties:false}}};return this.createCredentialType(e,t)}async createReputationType(){let e=JT.REPUTATION_SCORE,t={$schema:"https://json-schema.org/draft/2020-12/schema",title:"GhostSpeak Reputation",description:"Verified reputation score for GhostSpeak users",type:"object",properties:{credentialSubject:{type:"object",properties:{userId:{type:"string"},walletAddress:{type:"string"},reputationScore:{type:"number"},totalTransactions:{type:"integer"},disputeRate:{type:"number"},memberSince:{type:"string"},id:{type:"string"}},required:["userId","walletAddress","reputationScore","memberSince"],additionalProperties:false}}};return this.createCredentialType(e,t)}async createJobCompletionType(){let e=JT.JOB_COMPLETION,t={$schema:"https://json-schema.org/draft/2020-12/schema",title:"GhostSpeak Job Completion",description:"Certificate of successful job completion on GhostSpeak",type:"object",properties:{credentialSubject:{type:"object",properties:{jobId:{type:"string"},agentId:{type:"string"},clientAddress:{type:"string"},completedAt:{type:"string"},amountPaid:{type:"string"},rating:{type:"integer"},review:{type:"string"},id:{type:"string"}},required:["jobId","agentId","clientAddress","completedAt","amountPaid","rating"],additionalProperties:false}}};return this.createCredentialType(e,t)}async initializeAllTypes(){let[e,t,o]=await Promise.all([this.createAgentIdentityType(),this.createReputationType(),this.createJobCompletionType()]);return {agentIdentity:e,reputation:t,jobCompletion:o}}async createAllTemplates(e){let[t,o,r]=await Promise.all([this.createTemplate(e.agentIdentity.id,{name:"GhostSpeak Agent Identity",description:"Verified AI agent identity on the GhostSpeak Protocol",imageUrl:"https://www.ghostspeak.io/assets/credential-agent.png"}),this.createTemplate(e.reputation.id,{name:"GhostSpeak Reputation",description:"Verified reputation score for GhostSpeak users",imageUrl:"https://www.ghostspeak.io/assets/credential-reputation.png"}),this.createTemplate(e.jobCompletion.id,{name:"GhostSpeak Job Completion Certificate",description:"Certificate of successful job completion on GhostSpeak",imageUrl:"https://www.ghostspeak.io/assets/credential-job.png"})]);return {agentIdentityTemplate:t,reputationTemplate:o,jobCompletionTemplate:r}}async issueAgentCredential(e,t,o,r){return this.issueCredential(e,t,o,r)}async issueReputationCredential(e,t,o,r){return this.issueCredential(e,t,o,r)}async issueJobCompletionCredential(e,t,o,r){return this.issueCredential(e,t,o,r)}async createCredentialType(e,t){let o=await fetch(`${this.baseUrl}/api/v1-alpha1/credentials/types/${e}`,{method:"PUT",headers:{"Content-Type":"application/json","X-API-KEY":this.apiKey},body:JSON.stringify(t)});if(!o.ok){let r=await o.json().catch(()=>({message:o.statusText}));throw new Error(`Failed to create credential type: ${JSON.stringify(r)}`)}return o.json()}async createTemplate(e,t){let o=await fetch(`${this.baseUrl}/api/v1-alpha1/credentials/templates/`,{method:"POST",headers:{"Content-Type":"application/json","X-API-KEY":this.apiKey},body:JSON.stringify({credentials:{type:e,encryption:"none",storage:"crossmint"},metadata:t,chain:this.chain})});if(!o.ok){let i=await o.text();try{let d=JSON.parse(i);throw new Error(`Failed to create template: ${JSON.stringify(d)}`)}catch{throw new Error(`Failed to create template (${o.status}): ${i}`)}}let r=await o.json(),c=await this.waitForAction(r.id);return c.data&&c.data.collection?c.data.collection:c.data||c}async waitForAction(e){let t=0;for(;t<60;){await new Promise(c=>setTimeout(c,2e3));let o=await fetch(`${this.baseUrl}/api/2022-06-09/actions/${e}`,{headers:{"X-API-KEY":this.apiKey}});if(!o.ok)throw new Error(`Failed to poll action: ${o.statusText}`);let r=await o.json();if(r.status==="succeeded")return r;if(r.status==="failed")throw new Error(`Action failed: ${JSON.stringify(r)}`);t++;}throw new Error("Action polling timed out")}async issueCredential(e,t,o,r){let c=await fetch(`${this.baseUrl}/api/v1-alpha1/credentials/templates/${e}/vcs`,{method:"POST",headers:{"Content-Type":"application/json","X-API-KEY":this.apiKey},body:JSON.stringify({recipient:`email:${t}:${this.chain}`,credential:{subject:o,expiresAt:r||this.getDefaultExpiry()}})});if(!c.ok){let i=await c.json().catch(()=>({message:c.statusText}));throw new Error(`Failed to issue credential: ${JSON.stringify(i)}`)}return c.json()}async getCredential(e){let t=await fetch(`${this.baseUrl}/api/v1-alpha1/credentials/${e}`,{headers:{"X-API-KEY":this.apiKey}});if(!t.ok){let o=await t.json().catch(()=>({message:t.statusText}));throw new Error(`Failed to get credential: ${JSON.stringify(o)}`)}return t.json()}async verifyCredential(e){let t=await fetch(`${this.baseUrl}/api/v1-alpha1/credentials/verification/verify`,{method:"POST",headers:{"Content-Type":"application/json","X-API-KEY":this.apiKey},body:JSON.stringify({credential:e})});if(!t.ok){let o=await t.json().catch(()=>({message:t.statusText}));throw new Error(`Failed to verify credential: ${JSON.stringify(o)}`)}return t.json()}async revokeCredential(e){let t=await fetch(`${this.baseUrl}/api/v1-alpha1/credentials/${e}`,{method:"DELETE",headers:{"X-API-KEY":this.apiKey}});if(!t.ok){let o=await t.json().catch(()=>({message:t.statusText}));throw new Error(`Failed to revoke credential: ${JSON.stringify(o)}`)}return t.json()}getDefaultExpiry(){let e=new Date;return e.setFullYear(e.getFullYear()+1),e.toISOString().split("T")[0]}};var a0="did_document";var ve=class extends Error{code;constructor(e,t){super(t||e),this.name="DidError",this.code=e;}};async function hu(n,e){let[t,o]=await getProgramDerivedAddress({programAddress:n,seeds:[new TextEncoder().encode(a0),getAddressEncoder().encode(e)]});return [t,o]}function he(n,e){return `did:sol:${n==="mainnet"?"mainnet-beta":n}:${e.toString()}`}function Cu(n){if(!n.startsWith("did:sol:"))throw new ve("InvalidDidFormat",'DID must start with "did:sol:"');let e=n.split(":");if(e.length!==4)throw new ve("InvalidDidFormat",'DID must have format "did:sol:network:identifier"');let t=["mainnet-beta","devnet","testnet","localnet"];if(!t.includes(e[2]))throw new ve("InvalidDidFormat",`Invalid network "${e[2]}". Must be one of: ${t.join(", ")}`);try{pt.decode(e[3]);}catch{throw new ve("InvalidDidFormat","DID identifier must be a valid base58-encoded Solana public key")}}function d0(n){Cu(n);let e=n.split(":");return {method:e[1],network:e[2],identifier:e[3]}}function QT(n){let e=n.verificationMethods.filter(s=>!s.revoked).map(s=>({id:`${n.did}#${s.id}`,type:s.methodType,controller:s.controller,publicKeyMultibase:s.publicKeyMultibase})),t=n.verificationMethods.filter(s=>!s.revoked&&s.relationships.includes("authentication")).map(s=>`${n.did}#${s.id}`),o=n.verificationMethods.filter(s=>!s.revoked&&s.relationships.includes("assertionMethod")).map(s=>`${n.did}#${s.id}`),r=n.verificationMethods.filter(s=>!s.revoked&&s.relationships.includes("keyAgreement")).map(s=>`${n.did}#${s.id}`),c=n.verificationMethods.filter(s=>!s.revoked&&s.relationships.includes("capabilityInvocation")).map(s=>`${n.did}#${s.id}`),i=n.verificationMethods.filter(s=>!s.revoked&&s.relationships.includes("capabilityDelegation")).map(s=>`${n.did}#${s.id}`),d=n.serviceEndpoints.map(s=>({id:`${n.did}#${s.id}`,type:s.serviceType,serviceEndpoint:s.serviceEndpoint,description:s.description||void 0}));return {"@context":n.context,id:n.did,controller:n.controller.toString(),verificationMethod:e,authentication:t.length>0?t:void 0,assertionMethod:o.length>0?o:void 0,keyAgreement:r.length>0?r:void 0,capabilityInvocation:c.length>0?c:void 0,capabilityDelegation:i.length>0?i:void 0,service:d.length>0?d:void 0,alsoKnownAs:n.alsoKnownAs.length>0?n.alsoKnownAs:void 0}}function u0(n,e,t,o=["authentication"]){let r=`z${t}`;return {id:n,methodType:"Ed25519VerificationKey2020",controller:e,publicKeyMultibase:r,relationships:o,createdAt:Math.floor(Date.now()/1e3),revoked:false}}function g0(n,e,t,o=""){return {id:n,serviceType:e,serviceEndpoint:t,description:o}}function A0(n){return !n.deactivated}function p0(n,e=true){let t=QT(n);return e?JSON.stringify(t,null,2):JSON.stringify(t)}var on=n=>pt.encode(n),ele="GHosT3wqDfNq9bKz8dNEQ1F5mLuN7bKdNYx3Z1111111";var cn=class{programId;didModule;constructor(e=ele,t){this.programId=e,this.didModule=t;}setDidModule(e){this.didModule=e;}hashSubjectData(e){let t=JSON.stringify(e,Object.keys(e).sort());return sha256(new TextEncoder().encode(t))}generateCredentialId(e,t){let o=Date.now(),r=`${e}-${t}-${o}`,c=sha256(new TextEncoder().encode(r)),i=on(c.slice(0,8));return `${e.toLowerCase()}-${i}`}exportAsW3CCredential(e,t,o,r,c){let i=c?.network||"mainnet",d=he(i,this.programId),s=he(i,e.subject),A=`solana:${this.programId}:credential:${e.credentialId}`;return {"@context":["https://www.w3.org/ns/credentials/v2","https://w3id.org/security/data-integrity/v2","https://ghostspeak.io/ns/credentials/v1"],type:["VerifiableCredential",`GhostSpeak${o.kind}Credential`],id:`urn:ghostspeak:${e.credentialId}`,issuer:{id:d,name:"GhostSpeak Protocol"},validFrom:new Date(e.issuedAt*1e3).toISOString(),validUntil:e.expiresAt?new Date(e.expiresAt*1e3).toISOString():void 0,credentialSubject:{id:s,...r},credentialSchema:{id:o.schemaUri,type:"JsonSchema"},credentialStatus:{id:A,type:"SolanaAccountStatus2025",statusPurpose:"revocation"},relatedResource:c?.includeRelatedResource?[{id:e.subjectDataUri,digestMultibase:`mEi${on(e.subjectDataHash)}`}]:void 0,proof:{type:"DataIntegrityProof",created:new Date(e.issuedAt*1e3).toISOString(),verificationMethod:`${d}#key-1`,cryptosuite:"eddsa-rdfc-2022",proofPurpose:"assertionMethod",proofValue:on(e.signature)}}}async exportWithDidResolution(e,t,o,r,c){if(!this.didModule)return this.exportAsW3CCredential(e,t,o,r,c);let i=c?.network||"mainnet",d=he(i,this.programId),s=he(i,e.subject),A=await this.didModule.resolve(this.programId).catch(()=>null);await this.didModule.resolve(e.subject).catch(()=>null);let R=`solana:${this.programId}:credential:${e.credentialId}`,D=A?.verificationMethods?.[0]?`${d}#${A.verificationMethods[0].id}`:`${d}#key-1`;return {"@context":["https://www.w3.org/ns/credentials/v2","https://w3id.org/security/data-integrity/v2","https://ghostspeak.io/ns/credentials/v1"],type:["VerifiableCredential",`GhostSpeak${o.kind}Credential`],id:`urn:ghostspeak:${e.credentialId}`,issuer:{id:d,name:"GhostSpeak Protocol"},validFrom:new Date(e.issuedAt*1e3).toISOString(),validUntil:e.expiresAt?new Date(e.expiresAt*1e3).toISOString():void 0,credentialSubject:{id:s,...r},credentialSchema:{id:o.schemaUri,type:"JsonSchema"},credentialStatus:{id:R,type:"SolanaAccountStatus2025",statusPurpose:"revocation"},relatedResource:c?.includeRelatedResource?[{id:e.subjectDataUri,digestMultibase:`mEi${on(e.subjectDataHash)}`}]:void 0,proof:{type:"DataIntegrityProof",created:new Date(e.issuedAt*1e3).toISOString(),verificationMethod:D,cryptosuite:"eddsa-rdfc-2022",proofPurpose:"assertionMethod",proofValue:on(e.signature)}}}static buildAgentIdentitySubject(e){return e}issueX402AgentCredential(e){let t=Math.floor(Date.now()/1e3),o={agentId:e.agentId,owner:e.owner,name:e.name,capabilities:e.capabilities||[],serviceEndpoint:e.serviceEndpoint,frameworkOrigin:e.frameworkOrigin,x402Enabled:true,x402PaymentAddress:e.x402PaymentAddress,x402AcceptedTokens:e.x402AcceptedTokens,x402PricePerCall:e.x402PricePerCall,registeredAt:t,verifiedAt:t,type:"external-x402-agent",verificationResponseTimeMs:e.verificationResponseTimeMs},r=this.generateCredentialId("AgentIdentity",e.agentAddress),c=this.hashSubjectData(o),i={template:"x402-agent-identity-template",subject:e.agentAddress,issuer:this.programId,credentialId:r,subjectDataHash:c,subjectDataUri:`data:application/json;base64,${Buffer.from(JSON.stringify(o)).toString("base64")}`,status:"Active",signature:c,issuedAt:t},d={authority:this.programId,name:"x402 Agent Identity",kind:"AgentIdentity",schemaUri:"https://ghostspeak.io/schemas/x402-agent-identity-v1.json",description:"Verifiable credential for x402-compatible AI agents registered with GhostSpeak",isActive:true,totalIssued:1,createdAt:t},s={credentialType:d.authority,name:"x402 Agent Identity",imageUri:"https://ghostspeak.io/assets/credential-badge-x402.png",issuer:this.programId,isActive:true,totalIssued:1,createdAt:t},A=this.exportAsW3CCredential(i,s,d,o,{network:e.network||"devnet",includeRelatedResource:true});return {credentialId:r,credential:i,w3cCredential:A,subjectData:o}}exportCredentialToJSON(e,t,o){let r={credentialType:"x402-agent",name:e.credentialId.includes("agentidentity")?"Agent Identity":"Custom",imageUri:"https://ghostspeak.io/assets/credential-badge.png",issuer:e.issuer,isActive:true,totalIssued:1,createdAt:e.issuedAt},c={authority:e.issuer,name:"GhostSpeak Credential",kind:"AgentIdentity",schemaUri:"https://ghostspeak.io/schemas/credential-v1.json",description:"GhostSpeak verifiable credential",isActive:true,totalIssued:1,createdAt:e.issuedAt},i=this.exportAsW3CCredential(e,r,c,t,{network:o?.network||"devnet",includeRelatedResource:true});return o?.pretty?JSON.stringify(i,null,2):JSON.stringify(i)}};var Ru=class{constructor(e){this.config=e;this.credentialModule=new cn(e.programId),e.crossmint&&(this.crossmintClient=new Eu(e.crossmint));}credentialModule;crossmintClient;async issueAgentIdentityCredential(e){let t=cn.buildAgentIdentitySubject({agentId:e.agentId,owner:e.owner,name:e.name,capabilities:e.capabilities,serviceEndpoint:e.serviceEndpoint,frameworkOrigin:e.frameworkOrigin,x402Enabled:e.x402Enabled,registeredAt:e.registeredAt,verifiedAt:e.verifiedAt}),o=this.credentialModule.generateCredentialId("AgentIdentity",e.owner),r=this.credentialModule.hashSubjectData(t),c={template:"11111111111111111111111111111111",subject:e.owner,issuer:e.owner,credentialId:o,subjectDataHash:r,subjectDataUri:`ipfs://placeholder/${o}`,status:"Active",signature:e.signature,issuedAt:Math.floor(Date.now()/1e3),expiresAt:void 0,revokedAt:void 0,crossmintCredentialId:void 0},i={authority:"11111111111111111111111111111111",name:"AgentIdentity",kind:"AgentIdentity",schemaUri:"https://ghostspeak.io/schemas/agent-identity.json",description:"Verified AI agent identity on GhostSpeak Protocol",isActive:true,totalIssued:1,createdAt:Math.floor(Date.now()/1e3)},d={credentialType:"11111111111111111111111111111111",name:"GhostSpeak Agent Identity",imageUri:"https://www.ghostspeak.io/assets/credential-agent.png",issuer:e.owner,isActive:true,totalIssued:1,createdAt:Math.floor(Date.now()/1e3),crossmintTemplateId:this.config.crossmintTemplates?.agentIdentity},s=this.credentialModule.exportAsW3CCredential(c,d,i,t),A={solanaCredential:{credentialId:o},w3cCredential:s};if(e.syncToCrossmint&&this.crossmintClient&&e.recipientEmail)if(!d.crossmintTemplateId)A.crossmintSync={status:"failed",error:"No template ID configured"};else try{let y=await this.crossmintClient.issueCredential(d.crossmintTemplateId,e.recipientEmail,t);A.crossmintSync={status:"synced",credentialId:y.credentialId,chain:this.config.crossmint?.chain};}catch(y){A.crossmintSync={status:"failed",error:y instanceof Error?y.message:"Unknown error"};}return A}};var nle="https://facilitator.payai.network",rle=3e4,ole={attempts:3,delayMs:1e3};function ile(n){return n.status===402}async function cle(n){let e=await n.text();try{let o=JSON.parse(e);if(o.accepts&&Array.isArray(o.accepts))return o.accepts;if(o.paymentRequirements&&Array.isArray(o.paymentRequirements))return o.paymentRequirements;if(o.scheme&&o.payTo)return [o]}catch{}let t=n.headers.get("x-payment-required");if(t)try{return JSON.parse(t)}catch{}return []}var bu=class extends EventEmitter{config;localRecords=[];constructor(e){super(),this.config={facilitatorUrl:e.facilitatorUrl??nle,rpcUrl:e.rpcUrl,wallet:e.wallet,timeout:e.timeout??rle,retry:e.retry??ole};}async fetch(e,t){this.emit("request:started",e);let o=Date.now();try{let r=await this.fetchWithTimeout(e,t);if(ile(r)){let i=await cle(r);if(this.emit("payment:required",i),i.length===0)throw new Error("Payment required but no payment options provided");let d=this.selectPaymentOption(i);if(!d)throw new Error("No compatible payment option found");r=await this.makePaymentAndRetry(e,t??{},d);}let c=Date.now()-o;return this.emit("request:completed",e,r.ok,c),r}catch(r){let c=Date.now()-o;throw this.emit("request:completed",e,false,c),r instanceof Error&&this.emit("payment:failed",r),r}}async verifyPayment(e,t){return (await this.fetchWithTimeout(`${this.config.facilitatorUrl}/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentHeader:e,paymentRequirements:t})})).json()}async settlePayment(e,t){return (await this.fetchWithTimeout(`${this.config.facilitatorUrl}/settle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentHeader:e,paymentRequirements:t})})).json()}async listResources(e){let t=new URLSearchParams;return e?.network&&t.set("network",e.network),e?.capability&&t.set("capability",e.capability),e?.maxPrice&&t.set("maxPrice",e.maxPrice.toString()),(await this.fetchWithTimeout(`${this.config.facilitatorUrl}/list?${t.toString()}`)).json()}getLocalReputationRecords(){return [...this.localRecords]}clearLocalReputationRecords(){this.localRecords.length=0;}selectPaymentOption(e){let t=e.find(o=>o.network==="solana");return t||(e[0]??null)}async makePaymentAndRetry(e,t,o){this.emit("payment:started",o);let r=await this.createPaymentHeader(o),c=await this.verifyPayment(r,o);if(!c.valid)throw new Error(`Payment verification failed: ${c.error??"Unknown error"}`);let i=await this.settlePayment(r,o);if(!i.success)throw new Error(`Payment settlement failed: ${i.error??"Unknown error"}`);this.emit("payment:completed",{success:true,transactionSignature:i.transaction,paymentId:`pay_${Date.now()}`});let d=Date.now(),s=await this.fetchWithTimeout(e,{...t,headers:{...t.headers,"X-Payment":r,"X-Payment-Signature":i.transaction??""}}),A=Date.now()-d;return i.transaction&&this.localRecords.push({agentAddress:o.payTo,paymentSignature:i.transaction,amount:BigInt(o.maxAmountRequired),success:s.ok,responseTimeMs:A,payerAddress:this.config.wallet?.publicKey??"unknown",timestamp:new Date,network:o.network}),s}async createPaymentHeader(e){if(!this.config.wallet)throw new Error("Wallet not configured for payments");let t={version:"1.0",scheme:e.scheme,network:e.network,payer:this.config.wallet.publicKey,payTo:e.payTo,amount:e.maxAmountRequired,asset:e.asset,resource:e.resource,nonce:Date.now().toString(),signature:`mock_sig_${Date.now()}`};return Buffer.from(JSON.stringify(t)).toString("base64")}async fetchWithTimeout(e,t){let o=new AbortController,r=setTimeout(()=>o.abort(),this.config.timeout);try{return await fetch(e,{...t,signal:o.signal})}finally{clearTimeout(r);}}};var v={MAX_REPUTATION_SCORE:1e4,MIN_REPUTATION_FOR_SLASH:1e3,REPUTATION_DECAY_RATE_BPS:10,BRONZE_TIER_THRESHOLD:2e3,SILVER_TIER_THRESHOLD:5e3,GOLD_TIER_THRESHOLD:7500,PLATINUM_TIER_THRESHOLD:9e3,MAX_REPUTATION_CATEGORIES:10};var Iu=class{fraudPatterns=[];constructor(){this.initializeFraudPatterns();}initializeFraudPatterns(){this.fraudPatterns=[{patternId:"sudden_spike",description:"Sudden spike in reputation without corresponding activity",riskScore:80,detect:e=>{if(e.performanceHistory.length<2)return false;let t=e.performanceHistory[e.performanceHistory.length-1],o=e.performanceHistory[e.performanceHistory.length-2];return t.score-o.score>2e3&&t.jobsCompleted===o.jobsCompleted}},{patternId:"perfect_scores_only",description:"All jobs have perfect scores (potential manipulation)",riskScore:60,detect:e=>{let t=e.performanceHistory.slice(-10);return t.length>=5&&t.every(o=>o.avgQuality===100)}},{patternId:"rapid_category_switching",description:"Rapid switching between unrelated categories",riskScore:40,detect:e=>{if(e.categoryReputations.length<5)return false;let t=e.categoryReputations.sort((r,c)=>c.lastActivity-r.lastActivity).slice(0,5);return (Date.now()-t[4].lastActivity)/(1e3*60*60*24)<7}},{patternId:"dispute_pattern",description:"High dispute rate with suspicious resolution pattern",riskScore:70,detect:e=>{if(e.totalJobsCompleted<10)return false;let t=e.disputesAgainst/e.totalJobsCompleted,o=e.disputesResolved/Math.max(1,e.disputesAgainst);return t>.3&&o>.9}},{patternId:"time_manipulation",description:"Completion times significantly below expected",riskScore:50,detect:(e,t)=>t.actualDuration<t.expectedDuration*.1}];}calculateReputation(e,t){let o=this.applyTimeDecay(e),r=this.calculateWeightedScore(o.factors,t),c=this.updateCategoryReputation(o.categoryReputations,t,r),i=this.calculateOverallScore(c.categories),d=this.getTierFromScore(i),s=this.checkBadgeAchievements(o,t,i),A=this.detectFraud(o,t);return {overallScore:i,jobScore:r,categoryScore:c.categoryScore,tier:d,newBadges:s,fraudDetected:A.detected,fraudRiskScore:A.riskScore}}applyTimeDecay(e){let t=Date.now()/1e3,o=(t-e.lastUpdated)/86400;if(o<=0)return e;let r=v.REPUTATION_DECAY_RATE_BPS*o,c=Math.max(0,1e4-r)/1e4,i=Math.floor(e.overallScore*c),d=e.categoryReputations.map(s=>{let A=(t-s.lastActivity)/86400,y=v.REPUTATION_DECAY_RATE_BPS*A,R=Math.max(0,1e4-y)/1e4;return {...s,score:Math.floor(s.score*R)}});return {...e,overallScore:i,categoryReputations:d}}calculateWeightedScore(e,t){if(e.completionWeight+e.qualityWeight+e.timelinessWeight+e.satisfactionWeight+e.disputeWeight!==100)throw new Error("Reputation factors must sum to 100");let r=t.completed?v.MAX_REPUTATION_SCORE:0,c=t.qualityRating*v.MAX_REPUTATION_SCORE/100,i=this.calculateTimelinessScore(t.expectedDuration,t.actualDuration),d=t.clientSatisfaction*v.MAX_REPUTATION_SCORE/100,s=this.calculateDisputeScore(t),A=(r*e.completionWeight+c*e.qualityWeight+i*e.timelinessWeight+d*e.satisfactionWeight+s*e.disputeWeight)/100;return Math.min(A,v.MAX_REPUTATION_SCORE)}calculateTimelinessScore(e,t){if(t<=e)return v.MAX_REPUTATION_SCORE;let o=(t-e)*1e4/e;return o>5e3?0:v.MAX_REPUTATION_SCORE-v.MAX_REPUTATION_SCORE*o/1e4}calculateDisputeScore(e){return e.hadDispute?e.disputeResolvedFavorably?v.MAX_REPUTATION_SCORE/2:0:v.MAX_REPUTATION_SCORE}updateCategoryReputation(e,t,o){let r=e.findIndex(c=>c.category===t.category);if(r!==-1){let c=e[r],i={...c,completedJobs:c.completedJobs+1,qualitySum:c.qualitySum+t.qualityRating,qualityCount:c.qualityCount+1,totalEarnings:c.totalEarnings+t.paymentAmount,lastActivity:Date.now()/1e3,score:Math.floor((c.score*7+o*3)/10),avgCompletionTime:Math.floor((c.avgCompletionTime*c.completedJobs+t.actualDuration)/(c.completedJobs+1))},d=[...e];return d[r]=i,{categories:d,categoryScore:i.score}}else {if(e.length>=v.MAX_REPUTATION_CATEGORIES)throw new Error("Maximum reputation categories reached");let c={category:t.category,score:o,completedJobs:1,avgCompletionTime:t.actualDuration,qualitySum:t.qualityRating,qualityCount:1,lastActivity:Date.now()/1e3,totalEarnings:t.paymentAmount};return {categories:[...e,c],categoryScore:o}}}calculateOverallScore(e){if(e.length===0)return 5e3;let t=0,o=0;for(let r of e){let c=r.completedJobs;t+=r.score*c,o+=c;}return o>0?Math.floor(t/o):5e3}getTierFromScore(e){return e>=v.PLATINUM_TIER_THRESHOLD?"Platinum":e>=v.GOLD_TIER_THRESHOLD?"Gold":e>=v.SILVER_TIER_THRESHOLD?"Silver":e>=v.BRONZE_TIER_THRESHOLD?"Bronze":"None"}checkBadgeAchievements(e,t,o){let r=[],c=new Set(e.badges.map(d=>d.badgeType)),i=e.totalJobsCompleted+(t.completed?1:0);return !c.has("FirstJob")&&i>=1&&r.push("FirstJob"),!c.has("TenJobs")&&i>=10&&r.push("TenJobs"),!c.has("HundredJobs")&&i>=100&&r.push("HundredJobs"),!c.has("ThousandJobs")&&i>=1e3&&r.push("ThousandJobs"),!c.has("PerfectRating")&&o>=9500&&r.push("PerfectRating"),!c.has("QuickResponder")&&e.avgResponseTime>0&&e.avgResponseTime<3600&&r.push("QuickResponder"),!c.has("DisputeResolver")&&e.disputesResolved>=5&&r.push("DisputeResolver"),c.has("CategoryExpert")||e.categoryReputations.some(s=>s.score>=9e3)&&r.push("CategoryExpert"),!c.has("CrossCategoryMaster")&&e.categoryReputations.length>=5&&r.push("CrossCategoryMaster"),r}detectFraud(e,t){let o=0,r=[];for(let i of this.fraudPatterns)i.detect(e,t)&&(o+=i.riskScore,r.push(i.patternId));let c=Math.min(100,o);return {detected:c>=50,riskScore:c,patterns:r}}createPerformanceSnapshot(e,t){let o=e.categoryReputations.length>0?e.categoryReputations.reduce((r,c)=>r+(c.qualityCount>0?c.qualitySum/c.qualityCount:0),0)/e.categoryReputations.length:0;return {timestamp:Date.now()/1e3,score:t,jobsCompleted:e.totalJobsCompleted,avgQuality:Math.floor(o)}}calculateSlashAmount(e,t){if(t>5e3)throw new Error("Slash percentage cannot exceed 50%");if(e<v.MIN_REPUTATION_FOR_SLASH)throw new Error("Reputation too low to slash");let o=Math.floor(e*t/1e4);return {newScore:Math.max(0,e-o),slashAmount:o}}calculateStakingBonus(e){return Math.min(500,Math.floor(e/1e3))}};XT();var vu=class extends z{calculator;tagEngine;constructor(e){super(e),this.calculator=new Iu,this.tagEngine=new sn;}calculateReputationChange(e,t){return this.calculator.calculateReputation(e,t)}getTierName(e){switch(e){case "None":return "Unranked";case "Bronze":return "Bronze";case "Silver":return "Silver";case "Gold":return "Gold";case "Platinum":return "Platinum";default:return "Unknown"}}getTierFromScore(e){return e>=v.PLATINUM_TIER_THRESHOLD?"Platinum":e>=v.GOLD_TIER_THRESHOLD?"Gold":e>=v.SILVER_TIER_THRESHOLD?"Silver":e>=v.BRONZE_TIER_THRESHOLD?"Bronze":"None"}getBadgeName(e){switch(e){case "FirstJob":return "First Job";case "TenJobs":return "10 Jobs";case "HundredJobs":return "100 Jobs";case "ThousandJobs":return "1000 Jobs";case "PerfectRating":return "Perfect Rating";case "QuickResponder":return "Quick Responder";case "DisputeResolver":return "Dispute Resolver";case "CategoryExpert":return "Category Expert";case "CrossCategoryMaster":return "Cross-Category Master";default:return "Unknown Badge"}}calculateApyBoost(e){return Math.floor(e/1e3)*50}getTierColor(e){switch(e){case "Platinum":return "#E5E4E2";case "Gold":return "#FFD700";case "Silver":return "#C0C0C0";case "Bronze":return "#CD7F32";default:return "#808080"}}createDefaultReputationData(e){return {agent:e,overallScore:5e3,totalJobsCompleted:0,totalJobsFailed:0,avgResponseTime:0,disputesAgainst:0,disputesResolved:0,lastUpdated:Math.floor(Date.now()/1e3),categoryReputations:[],badges:[],performanceHistory:[],factors:{completionWeight:25,qualityWeight:25,timelinessWeight:20,satisfactionWeight:20,disputeWeight:10}}}qualifiesForTier(e,t){switch(t){case "Platinum":return e>=v.PLATINUM_TIER_THRESHOLD;case "Gold":return e>=v.GOLD_TIER_THRESHOLD;case "Silver":return e>=v.SILVER_TIER_THRESHOLD;case "Bronze":return e>=v.BRONZE_TIER_THRESHOLD;default:return true}}pointsToNextTier(e){switch(this.getTierFromScore(e)){case "None":return {nextTier:"Bronze",pointsNeeded:v.BRONZE_TIER_THRESHOLD-e};case "Bronze":return {nextTier:"Silver",pointsNeeded:v.SILVER_TIER_THRESHOLD-e};case "Silver":return {nextTier:"Gold",pointsNeeded:v.GOLD_TIER_THRESHOLD-e};case "Gold":return {nextTier:"Platinum",pointsNeeded:v.PLATINUM_TIER_THRESHOLD-e};case "Platinum":return null;default:return null}}recordPayAIPayment(e,t){let o=this.payAIRecordToJobPerformance(e);return this.calculateReputationChange(t,o)}payAIRecordToJobPerformance(e){let t=this.estimateQualityFromResponseTime(e.responseTimeMs),o=this.estimateExpectedDuration(e.amount);return {completed:e.success,qualityRating:t,expectedDuration:o,actualDuration:Math.ceil(e.responseTimeMs/1e3),clientSatisfaction:e.success?t:20,hadDispute:false,disputeResolvedFavorably:false,category:this.categorizeFromNetwork(e.network),paymentAmount:Number(e.amount)/1e6}}estimateQualityFromResponseTime(e){return e<=500?100:e<=2e3?Math.round(90-(e-500)/1500*20):e<=1e4?Math.round(70-(e-2e3)/8e3*30):Math.max(20,Math.round(40-(e-1e4)/5e4*20))}estimateExpectedDuration(e){let t=Number(e)/1e6;return Math.max(2,Math.ceil(2+t*10))}categorizeFromNetwork(e){switch(e){case "solana":return "ai-services-solana";case "base":return "ai-services-base";case "ethereum":return "ai-services-ethereum";default:return "ai-services"}}createPayAIPerformanceSnapshot(e,t){return {timestamp:e.timestamp.getTime(),paymentId:e.paymentSignature,network:e.network,amount:e.amount.toString(),success:e.success,responseTimeMs:e.responseTimeMs,reputationChange:t.jobScore,newScore:t.overallScore,tier:t.tier}}async calculateTagsForAgent(e){return this.tagEngine.calculateTags(e)}getTagsByCategory(e,t){return this.tagEngine.filterTags(e,{category:t})}hasTag(e,t){return e.some(o=>o.tagName===t)}getTagConfidence(e,t){return e.find(r=>r.tagName===t)?.confidence}filterTags(e,t){return this.tagEngine.filterTags(e,t)}applyTagDecay(e,t){return this.tagEngine.applyTagDecay(e,t)}mergeTags(e,t){return this.tagEngine.mergeTags(e,t)}categorizeTags(e){return this.tagEngine.categorizeTags(e)}getTopTags(e,t){return this.tagEngine.getTopTags(e,t)}sortTagsByConfidence(e){return this.tagEngine.sortByConfidence(e)}sortTagsByEvidence(e){return this.tagEngine.sortByEvidence(e)}sortTagsByRecent(e){return this.tagEngine.sortByRecent(e)}getConfidenceLevel(e){return this.tagEngine.getConfidenceLevel(e)}validateTagName(e){return this.tagEngine.validateTagName(e)}validateConfidence(e){return this.tagEngine.validateConfidence(e)}convertMetricsForTagging(e){let t=e.responseTimeCount>0n?Number(e.totalResponseTime/e.responseTimeCount):0,o=e.successfulPayments+e.failedPayments,r=o>0n?Number(e.successfulPayments*10000n/o):0,c=e.totalRatingsCount>0?Math.floor(e.totalRating*100/(e.totalRatingsCount*5)):0,i=e.totalDisputes>0?Math.floor(e.disputesResolved*1e4/e.totalDisputes):1e4;return {successfulPayments:e.successfulPayments,failedPayments:e.failedPayments,totalResponseTime:e.totalResponseTime,responseTimeCount:e.responseTimeCount,totalDisputes:e.totalDisputes,disputesResolved:e.disputesResolved,totalRating:e.totalRating,totalRatingsCount:e.totalRatingsCount,createdAt:e.createdAt,updatedAt:e.updatedAt,avgResponseTime:t,successRate:r,avgRating:c,disputeResolutionRate:i}}};var Mu=class extends z{constructor(e){super(e);}async create(e,t){let o=t.network||"devnet",r=he(o,t.controller);Cu(r);let[c]=await hu(this.programId,t.controller),i=async()=>this.buildCreateDidInstruction(c,t.controller,r,t.verificationMethods||[],t.serviceEndpoints||[]);return this.execute("createDidDocument",i,[e])}async update(e,t){let o=async()=>this.buildUpdateDidInstruction(t.didDocument,e.address,t.addVerificationMethod||null,t.removeVerificationMethodId||null,t.addServiceEndpoint||null,t.removeServiceEndpointId||null);return this.execute("updateDidDocument",o,[e])}async deactivate(e,t){let o=async()=>this.buildDeactivateDidInstruction(t.didDocument,e.address);return this.execute("deactivateDidDocument",o,[e])}async resolve(e){let t;if(typeof e=="string"&&e.startsWith("did:sol:")){let{identifier:r}=d0(e);t=address(r);}else t=typeof e=="string"?address(e):e;let[o]=await hu(this.programId,t);return this.getAccount(o,"getDidDocumentDecoder")}async exportW3C(e,t=true){let o=await this.resolve(e);return o?p0(o,t):null}async getW3CDocument(e){let t=await this.resolve(e);return t?QT(t):null}async deriveDidPda(e){return hu(this.programId,e)}generateDid(e,t="devnet"){return he(t,e)}validateDid(e){return Cu(e),true}async isActive(e){let t=await this.resolve(e);return t?A0(t):false}buildCreateDidInstruction(e,t,o,r,c){throw new Error("DID instructions are not yet generated. Please run: bun run generate:client after adding DID instructions to the program.")}buildUpdateDidInstruction(e,t,o,r,c,i){throw new Error("DID instructions are not yet generated. Please run: bun run generate:client after adding DID instructions to the program.")}buildDeactivateDidInstruction(e,t){throw new Error("DID instructions are not yet generated. Please run: bun run generate:client after adding DID instructions to the program.")}static createVerificationMethod=u0;static createServiceEndpoint=g0};function T0(n,e,t){if(t||e==="Public")return {exactScore:n,tier:an(n),scoreRange:dn(n)};switch(e){case "TierOnly":return {tier:an(n)};case "RangeOnly":return {scoreRange:dn(n)};case "Confidential":return {};case "Custom":return {tier:an(n),scoreRange:dn(n)};default:return {}}}function an(n){return n>=Ee.TIER_THRESHOLDS.PLATINUM?"Platinum":n>=Ee.TIER_THRESHOLDS.GOLD?"Gold":n>=Ee.TIER_THRESHOLDS.SILVER?"Silver":n>=Ee.TIER_THRESHOLDS.BRONZE?"Bronze":"None"}function dn(n){let e=Ee.SCORE_RANGES;return n>=e.VERY_HIGH.min?"VeryHigh":n>=e.HIGH.min?"High":n>=e.MEDIUM.min?"Medium":n>=e.LOW.min?"Low":"VeryLow"}function f0(n,e,t){return n===t?true:e.authorizedViewers.includes(n)}function S0(n,e,t){let o={agent:n.agent},r=c=>t||c==="Public";if(r(e.showScore)&&(o.exactScore=n.overallScore),r(e.showJobsCompleted)&&(o.totalJobsCompleted=n.totalJobsCompleted),r(e.showSuccessRate)){let c=n.totalJobsCompleted+n.totalJobsFailed;o.successRate=c>0?n.totalJobsCompleted/c*100:0;}return r(e.showResponseTime)&&(o.avgResponseTime=n.avgResponseTime),r(e.showDisputes)&&(o.disputes={total:n.disputesAgainst,resolved:n.disputesResolved}),r(e.showEarnings)&&n.totalEarnings!==void 0&&(o.totalEarnings=n.totalEarnings),r(e.showRatings)&&n.avgRating!==void 0&&(o.avgRating=n.avgRating),r(e.showBadges)&&n.badges!==void 0&&(o.badges=n.badges),o.hasFullAccess=t,o}function un(n){switch(n){case "Public":return {showScore:"Public",showJobsCompleted:"Public",showSuccessRate:"Public",showResponseTime:"Public",showDisputes:"Public",showEarnings:"Public",showRatings:"Public",showBadges:"Public"};case "TierOnly":case "RangeOnly":return {showScore:"Private",showJobsCompleted:"Private",showSuccessRate:"Private",showResponseTime:"Private",showDisputes:"Private",showEarnings:"Private",showRatings:"Private",showBadges:"Public"};case "Confidential":return {showScore:"ZKProof",showJobsCompleted:"ZKProof",showSuccessRate:"ZKProof",showResponseTime:"ZKProof",showDisputes:"ZKProof",showEarnings:"ZKProof",showRatings:"ZKProof",showBadges:"ZKProof"};case "Custom":default:return {showScore:"Private",showJobsCompleted:"Public",showSuccessRate:"Public",showResponseTime:"Public",showDisputes:"Private",showEarnings:"Private",showRatings:"Public",showBadges:"Public"}}}function x0(n){let e=[];return n.authorizedViewers.length>Ee.MAX_AUTHORIZED_VIEWERS&&e.push(`Too many authorized viewers (max: ${Ee.MAX_AUTHORIZED_VIEWERS})`),n.mode==="Public"&&Object.values(n.metricVisibility).some(o=>o!=="Public")&&e.push("Public mode cannot have private metrics"),{valid:e.length===0,errors:e}}var ku=class extends z{constructor(e){super(e);}async initializePrivacy(e,t){let o=t.mode??"Public";t.metricVisibility??un(o);let c=async()=>({programAddress:this.programId,accounts:[],data:new Uint8Array([0])});return this.execute("initializePrivacy",c,[e])}async updatePrivacyMode(e,t){let o=async()=>({programAddress:this.programId,accounts:[],data:new Uint8Array([1])});return this.execute("updatePrivacyMode",o,[e])}async setMetricVisibility(e,t){let o=async()=>({programAddress:this.programId,accounts:[],data:new Uint8Array([2])});return this.execute("setMetricVisibility",o,[e])}async grantAccess(e,t){let o=async()=>({programAddress:this.programId,accounts:[],data:new Uint8Array([3])});return this.execute("grantAccess",o,[e])}async revokeAccess(e,t){let o=async()=>({programAddress:this.programId,accounts:[],data:new Uint8Array([4])});return this.execute("revokeAccess",o,[e])}async applyPreset(e,t){let{preset:o}=t;return await this.updatePrivacyMode(e,{agentAddress:t.agentAddress,mode:o.mode}),this.setMetricVisibility(e,{agentAddress:t.agentAddress,metricVisibility:o.metricVisibility})}async getPrivacySettings(e){return {agent:e,mode:"Public",metricVisibility:un("Public"),authorizedViewers:[],autoGrantClients:false,updatedAt:Math.floor(Date.now()/1e3)}}async getVisibleReputation(e,t){let o=await this.getPrivacySettings(e);o||(o={agent:e,mode:"Public",metricVisibility:un("Public"),authorizedViewers:[],autoGrantClients:false,updatedAt:Math.floor(Date.now()/1e3)});let r=f0(t,o,e),c={agent:e,overallScore:7500,totalJobsCompleted:100,totalJobsFailed:5,avgResponseTime:250,disputesAgainst:2,disputesResolved:2,totalEarnings:5e4,avgRating:4.5,badges:["FirstJob","TenJobs","QuickResponder"]},i=T0(c.overallScore,o.mode,r);return {...S0(c,o.metricVisibility,r),privacyMode:o.mode,...i,hasFullAccess:r}}validateSettings(e){return x0(e)}getAvailablePresets(){return GT}getDefaultVisibility(e){return un(e)}getTier(e){return an(e)}getRange(e){return dn(e)}async derivePrivacyPda(e){let{getProgramDerivedAddress:t,getAddressEncoder:o}=await import('@solana/addresses'),c=o().encode(e),[i]=await t({programAddress:this.programId,seeds:[new TextEncoder().encode("privacy_settings"),c]});return i}};var gle="GhostSpeak Reputation Authorization";function D0(n){let e=[];e.push(Buffer.from(gle,"utf8"));let t=pt.decode(n.agentAddress);e.push(Buffer.from(t));let o=pt.decode(n.authorizedSource);e.push(Buffer.from(o));let r=Buffer.allocUnsafe(8);r.writeBigUInt64BE(BigInt(n.indexLimit)),e.push(r);let c=Buffer.allocUnsafe(8);return c.writeBigUInt64BE(BigInt(n.expiresAt)),e.push(c),e.push(Buffer.from(n.network,"utf8")),n.nonce&&e.push(Buffer.from(n.nonce,"utf8")),Buffer.concat(e)}async function Ale(n,e){let t=e.publicKey.toBase58();if(t!==n.agentAddress)throw new Error(`Keypair public key ${t} does not match agent address ${n.agentAddress}`);let o=D0(n);return (await import('tweetnacl')).sign.detached(o,e.secretKey)}async function P0(n){try{let e={agentAddress:n.agentAddress,authorizedSource:n.authorizedSource,indexLimit:n.indexLimit,expiresAt:n.expiresAt,network:n.network,nonce:n.nonce},t=D0(e),o=await import('tweetnacl'),r=pt.decode(n.agentAddress);return o.sign.detached.verify(t,n.signature,r)}catch(e){return console.error("[Auth Signature] Verification failed:",e),false}}async function E0(n,e){let t=address(e.publicKey.toBase58()),o=Math.floor(Date.now()/1e3),r=n.expiresAt||o+(n.expiresIn||720*60*60),c=n.indexLimit||1e3,i=n.network||"devnet",d=n.nonce!==void 0?n.nonce:"default",s={agentAddress:t,authorizedSource:n.authorizedSource,indexLimit:c,expiresAt:r,network:i,nonce:d},A=await Ale(s,e);return {agentAddress:t,authorizedSource:n.authorizedSource,indexLimit:c,expiresAt:r,network:i,signature:A,nonce:d,metadata:n.metadata}}function ZT(n){return {agentAddress:n.agentAddress,authorizedSource:n.authorizedSource,indexLimit:n.indexLimit,expiresAt:n.expiresAt,network:n.network,signature:pt.encode(n.signature),nonce:n.nonce,metadata:n.metadata}}function h0(n){return {agentAddress:n.agentAddress,authorizedSource:n.authorizedSource,indexLimit:n.indexLimit,expiresAt:n.expiresAt,network:n.network,signature:pt.decode(n.signature),nonce:n.nonce,metadata:n.metadata}}async function C0(authorization){let serialized=ZT(authorization),json=JSON.stringify(serialized),encoder=new TextEncoder,data=encoder.encode(json),crypto;if(globalThis.crypto)crypto=globalThis.crypto;else {let nodeCrypto=eval("require")("crypto");crypto=nodeCrypto.webcrypto;}let hashBuffer=await crypto.subtle.digest("SHA-256",data),hashArray=new Uint8Array(hashBuffer);return pt.encode(hashArray)}function R0(n,e){return (e||Math.floor(Date.now()/1e3))>=n.expiresAt}function b0(n,e){return e>=n.indexLimit}var ple=2000000n,wu=class extends z{constructor(e){super(e);}async createAuthorization(e,t){return await E0(e,t)}async storeAuthorizationOnChain(e,t,o){let r=this.calculateStorageFee(e,o),c=o?.feePayedByAgent??true;console.log(`\u{1F4B0} On-chain storage cost: ${Number(r)/1e9} SOL`),console.log(` Fee payer: ${c?"Agent":"Facilitator"}`);let{getCreateAgentAuthorizationInstructionAsync:i}=await Promise.resolve().then(()=>(Rm(),iM)),{getProgramDerivedAddress:d,getBytesEncoder:s,getAddressEncoder:A,getUtf8Encoder:y}=await import('@solana/kit'),R=e.nonce??"default",[D]=await d({programAddress:this.getProgramId(),seeds:[s().encode(new Uint8Array([97,103,101,110,116,95,97,117,116,104])),A().encode(e.agentAddress),A().encode(e.authorizedSource),y().encode(R)]});return await this.execute("createAgentAuthorization",async()=>await i({agent:e.agentAddress,authorization:D,authority:t,authorizedSource:e.authorizedSource,indexLimit:BigInt(e.indexLimit),expiresAt:BigInt(e.expiresAt),network:e.network==="mainnet-beta"?0:e.network==="devnet"?1:2,signature:e.signature,nonce:R}),[t])}async verifySignature(e){return P0(e)}getAuthorizationStatus(e,t){let o=Math.floor(Date.now()/1e3),r=t??0;return R0(e,o)?{status:"expired",isValid:false,remainingUses:0,reason:"Authorization has expired"}:b0(e,r)?{status:"exhausted",isValid:false,remainingUses:0,reason:"Index limit reached"}:{status:"active",isValid:true,remainingUses:e.indexLimit-r}}async fetchAuthorization(e,t,o){throw new Error("On-chain fetch not yet implemented - pending Codama generation")}async updateReputationWithAuth(e,t,o,r,c,i){if(!await this.verifySignature(e))throw new Error("Invalid authorization signature");let s=this.getAuthorizationStatus(e);if(!s.isValid)throw new Error(`Authorization is ${s.status}: ${s.reason}`);let{getUpdateReputationWithAuthInstructionAsync:A}=await Promise.resolve().then(()=>(PT(),Vw));return await this.execute("updateReputationWithAuth",async()=>await A({agent:e.agentAddress,authorizedSource:i,usageRecord:r,reputationChange:BigInt(t),transactionSignature:o,metadata:c?JSON.stringify(c):null,nonce:e.nonce??null}),[i])}async revokeAuthorization(e,t,o,r){let{getRevokeAuthorizationInstruction:c}=await Promise.resolve().then(()=>(Ay(),Lk));return await this.execute("revokeAuthorization",()=>c({agent:e,authorization:t,authority:r,nonce:o??null}),[r])}async listAuthorizations(e){throw new Error("Authorization listing not yet implemented - pending Codama generation")}serializeAuthorization(e){return ZT(e)}deserializeAuthorization(e){return h0(e)}async getAuthorizationId(e){return C0(e)}async createPayAIAuthorization(e,t,o){let r={authorizedSource:e,indexLimit:1e3,expiresIn:2592e3,network:"devnet",...o};return this.createAuthorization(r,t)}calculateStorageFee(e,t){if(t?.storageFee!==void 0)return t.storageFee;if(t?.customFees){let o=Math.floor(Date.now()/1e3),r=e.expiresAt-o,c=Object.keys(t.customFees).map(Number).sort((d,s)=>d-s);for(let d of c)if(r<=d)return t.customFees[d];let i=c[c.length-1];if(i&&t.customFees[i])return t.customFees[i]}return ple}async estimateStorageCost(e,t){let o=Math.floor(Date.now()/1e3),r={agentAddress:"11111111111111111111111111111111",authorizedSource:e.authorizedSource,indexLimit:e.indexLimit??1e3,expiresAt:e.expiresAt??o+(e.expiresIn??720*60*60),network:e.network??"devnet",signature:new Uint8Array(64),nonce:e.nonce},c=this.calculateStorageFee(r,t);return Number(c)/1e9}};te();var Uu=class extends z{async initializeStakingConfig(e){let t=await W1({authority:e.authority,minStake:e.minStake,treasury:e.treasury},{programAddress:this.programId});return this.execute("initializeStakingConfig",()=>t,[e.authority])}async stake(e){let t=await Py({ownerTokenAccount:e.agentTokenAccount,stakingVault:e.stakingVault,stakingConfig:e.stakingConfig,ghostMint:e.ghostMint,owner:e.agentOwner,amount:e.amount,lockDuration:e.lockDuration},{programAddress:this.programId});return this.execute("stakeGhost",()=>t,[e.agentOwner])}async unstake(e){let t=await wy({stakingAccount:e.stakingAccount,stakingVault:e.stakingVault,ownerTokenAccount:e.agentTokenAccount,owner:e.agentOwner},{programAddress:this.programId});return this.execute("unstakeGhost",()=>t,[e.agentOwner])}async getStakingAccount(e){try{return await this.getAccount(e,"getStakingAccountDecoder")}catch(t){return console.error("Error fetching staking account:",t),null}}async getStakingConfig(e){try{return await this.getAccount(e,"getStakingConfigDecoder")}catch(t){return console.error("Error fetching staking config:",t),null}}};Hg();var ef=class{config;constructor(e){this.config={programId:u,commitment:"confirmed",cluster:"devnet",rpcEndpoint:e?.rpcEndpoint??this.getDefaultRpcEndpoint(e?.cluster??"devnet"),...e,rpc:e?.rpc??{}};}get agents(){return new tn(this.config)}get governanceModule(){return new nn(this.config)}get multisigModule(){return new rn(this.config)}agent(){return new tf(this.config)}payai(){return new bu({rpcUrl:this.config.rpcEndpoint,facilitatorUrl:this.config.payai?.facilitatorUrl,timeout:this.config.transactionTimeout,retry:this.config.retryConfig&&{attempts:this.config.retryConfig.maxRetries??3,delayMs:this.config.retryConfig.baseDelay??1e3}})}reputation(){return new vu(this.config)}tagEngine(){let{ReputationTagEngine:e}=(XT(),lf(m0));return new e}reputationAggregator(){let{MultiSourceAggregator:e}=(v0(),lf(I0));return new e}privacy(){return new ku(this.config)}governance(){return new nf(this.config)}multisig(){return new cf(this.config)}credentials(){return new Ru({programId:this.config.programId,crossmint:this.config.credentials?.crossmintApiKey?{apiKey:this.config.credentials.crossmintApiKey,environment:this.config.credentials.crossmintEnvironment,chain:this.config.credentials.crossmintChain}:void 0,crossmintTemplates:this.config.credentials?.templates})}did(){return new Mu(this.config)}get authorization(){return new wu(this.config)}get staking(){return new Uu(this.config)}enableDevMode(){return console.log("\u{1F6E0}\uFE0F Development mode enabled"),console.log(" - Transaction simulation before sending"),console.log(" - Cost estimates for all operations"),console.log(" - Enhanced error messages"),this.config={...this.config},this}useNetwork(e){return this.config.cluster=e,this.config.rpcEndpoint=this.getDefaultRpcEndpoint(e),this}useRpc(e,t){return this.config.rpcEndpoint=e,this.config.wsEndpoint=t,this}getDefaultRpcEndpoint(e){switch(e){case "mainnet-beta":return "https://api.mainnet-beta.solana.com";case "devnet":return "https://api.devnet.solana.com";case "testnet":return "https://api.testnet.solana.com";case "localnet":return "http://localhost:8899";default:return "https://api.devnet.solana.com"}}},tf=class{module;params={};constructor(e){this.module=new tn(e);}create(e){return this.params={...this.params,agentType:0,metadataUri:JSON.stringify(e),agentId:e.name.toLowerCase().replace(/\s+/g,"-"),name:e.name,description:e.description||""},this}withDescription(e){return this.params.description=e,this}withType(e){return this.params.agentType=e,this}withIPFS(){return this.params.forceIPFS=true,this}compressed(){return this.params.compressed=true,this}debug(){return this.module.debug(),this}withSigner(e){return this.params.signer=e,this}validateParams(){if(!this.params.signer)throw new Error("Agent builder requires a signer. Call with signer first.");if(!this.params.metadataUri)throw new Error("Agent builder requires metadata. Call create() first.");if(!this.params.agentId)throw new Error("Agent builder requires agent ID. Call create() first.");this.params.agentType??=0;}async getCost(){return this.validateParams(),this.module.getCost("registerAgent",()=>({programAddress:this.module.getProgramId(),accounts:[],data:new Uint8Array}))}async simulate(){let e=()=>({programAddress:this.module.getProgramId(),accounts:[],data:new Uint8Array});return this.validateParams(),this.module.simulateInstruction("registerAgent",e,[this.params.signer])}async explain(){return this.validateParams(),this.module.explain("registerAgent",()=>({programAddress:this.module.getProgramId(),accounts:[],data:new Uint8Array}))}async execute(){this.validateParams(),this.params.compressed&&console.log("Creating compressed agent (5000x cheaper)...");let e=await this.module.register(this.params.signer,{agentType:this.params.agentType,name:this.params.name,description:this.params.description,metadataUri:this.params.metadataUri,agentId:this.params.agentId});return {address:await this.deriveAgentAddress(this.params.agentId,this.params.signer),signature:e}}async deriveAgentAddress(e,t){let{deriveAgentPda:o}=await Promise.resolve().then(()=>(Pu(),Du)),[r]=await o({programAddress:this.module.getProgramId(),owner:t.address,agentId:e});return r}},nf=class{module;params={};constructor(e){this.module=new nn(e);}proposal(){return new rf(this.module,this.params)}query(){return new of(this.module)}debug(){return this.module.debug(),this}withSigner(e){return this.params.signer=e,this}},rf=class{constructor(e,t){this.module=e;this.builderParams=t;this.params.signer=t.signer;}params={};create(e){return this.params.title=e.title,this.params.description=e.description,this}type(e){return this.params.proposalType=e,this}votingDuration(e){return this.params.votingDuration=e,this}executionDelay(e){return this.params.executionDelay=e,this}validateParams(){if(!this.params.signer)throw new Error("Signer required");if(!this.params.title)throw new Error("Title required");if(!this.params.description)throw new Error("Description required");if(!this.params.proposalType)throw new Error("Proposal type required");if(!this.params.votingDuration)throw new Error("Voting duration required")}async execute(){this.validateParams();let e=await this.module.createProposal({signer:this.params.signer,title:this.params.title,description:this.params.description,proposalType:this.params.proposalType,votingDuration:this.params.votingDuration,executionDelay:this.params.executionDelay});return {address:`proposal_${this.params.signer.address}_${this.params.title}`,signature:e}}withSigner(e){return this.params.signer=e,this}},of=class{constructor(e){this.module=e;}async activeProposals(){return this.module.getActiveProposals()}async proposalsByProposer(e){return this.module.getProposalsByProposer(e)}async proposalsByStatus(e){return this.module.getProposalsByStatus(e)}},cf=class{module;params={};constructor(e){this.module=new rn(e);}create(){return new sf(this.module,this.params)}proposal(){return new af(this.module,this.params)}approve(){return new df(this.module,this.params)}executeProposal(){return new uf(this.module,this.params)}withSigner(e){return this.params.signer=e,this}debug(){return this.module.debug(),this}},sf=class{constructor(e,t){this.module=e;this.builderParams=t;this.params.signer=t.signer;}params={};withId(e){return this.params.multisigId=e,this}threshold(e){return this.params.threshold=e,this}signers(e){return this.params.signers=e,this}async execute(){if(!this.params.signer)throw new Error("Signer required");if(!this.params.multisigId)throw new Error("Multisig ID required");if(!this.params.threshold)throw new Error("Threshold required");if(!this.params.signers)throw new Error("Signers required");return {signature:await this.module.createMultisig({owner:this.params.signer,multisigId:this.params.multisigId,threshold:this.params.threshold,signers:this.params.signers})}}withSigner(e){return this.params.signer=e,this}},af=class{constructor(e,t){this.module=e;this.builderParams=t;this.params.signer=t.signer;}params={};forMultisig(e){return this.params.multisigAddress=e,this}title(e){return this.params.title=e,this}description(e){return this.params.description=e,this}async execute(){if(!this.params.signer)throw new Error("Signer required");if(!this.params.title)throw new Error("Title required");if(!this.params.description)throw new Error("Description required");return {signature:await this.module.createProposal({multisigAddress:this.params.multisigAddress,title:this.params.title,description:this.params.description,proposalType:7,executionParams:{instructions:[],executionDelay:0n,executionConditions:[],cancellable:true,autoExecute:true,executionAuthority:this.params.signer.address},proposalId:BigInt(Date.now()),proposer:this.params.signer})}}withSigner(e){return this.params.signer=e,this}},df=class{constructor(e,t){this.module=e;this.builderParams=t;this.params.signer=t.signer;}params={};proposal(e){return this.params.proposalAddress=e,this}vote(e){return this.params.voteChoice=e,this}reason(e){return this.params.reasoning=e,this}tokenAccount(e){return this.params.tokenAccount=e,this}async execute(){throw this.params.signer?this.params.proposalAddress?new Error("Multisig approval: Use protocol_config instructions for voting (approveProposal removed)"):new Error("Proposal address required"):new Error("Signer required")}withSigner(e){return this.params.signer=e,this}},uf=class{constructor(e,t){this.module=e;this.builderParams=t;this.params.signer=t.signer;}params={};proposal(e){return this.params.proposalAddress=e,this}target(e){return this.params.targetProgram=e,this}async execute(){if(!this.params.signer)throw new Error("Signer required");if(!this.params.proposalAddress)throw new Error("Proposal address required");if(!this.params.targetProgram)throw new Error("Target program required");return {signature:await this.module.executeProposal({proposalAddress:this.params.proposalAddress,executor:this.params.signer,targetProgram:this.params.targetProgram})}}withSigner(e){return this.params.signer=e,this}};function lle(n){return BigInt(Math.round(n*1e9))}var lt=class extends Error{code;context;solution;instruction;constructor(e,t,o={},r,c){super(t),this.name="GhostSpeakError",this.code=e,this.context=o,this.solution=r,this.instruction=c;}toString(){let e=`${this.name} [${this.code}]: ${this.message}`;return Object.keys(this.context).length>0&&(e+=`
|
|
1
|
+
import {fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU64Encoder,getI64Encoder,getU8Encoder,getOptionEncoder,addEncoderSizePrefix,getUtf8Encoder,getU32Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU64Decoder,getI64Decoder,getU8Decoder,getOptionDecoder,getBytesDecoder,addDecoderSizePrefix,getUtf8Decoder,getU32Decoder,combineCodec,getProgramDerivedAddress,AccountRole,upgradeRoleToSigner,isProgramError,containsBytes,getArrayEncoder,getBooleanEncoder,getArrayDecoder,getBooleanDecoder,getEnumEncoder,getEnumDecoder,getU16Encoder,getU16Decoder,getF64Encoder,getF64Decoder,getDiscriminatedUnionEncoder,getUnitEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getUnitDecoder,getTupleDecoder,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,decodeAccount,isTransactionSigner,pipe,createTransactionMessage,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,appendTransactionMessageInstructions,signTransactionMessageWithSigners,setTransactionMessageFeePayer,compileTransactionMessage,getBase64EncodedWireTransaction,createSolanaRpc,createSolanaRpcSubscriptions,lamports}from'@solana/kit';import {LRUCache}from'lru-cache';import {address}from'@solana/addresses';import'@solana/sysvars';import {sha256}from'@noble/hashes/sha256';import Tt from'bs58';var Ku=Object.defineProperty;var C0=Object.getOwnPropertyDescriptor;var b0=Object.getOwnPropertyNames;var R0=Object.prototype.hasOwnProperty;var a=(n,e)=>()=>(n&&(e=n(n=0)),e);var oe=(n,e)=>{for(var t in e)Ku(n,t,{get:e[t],enumerable:true});},I0=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of b0(e))!R0.call(n,r)&&r!==t&&Ku(n,r,{get:()=>e[r],enumerable:!(o=C0(e,r))||o.enumerable});return n};var Of=n=>I0(Ku({},"__esModule",{value:true}),n);function mn(){return getStructEncoder([["auditEnabled",getBooleanEncoder()],["realTimeMonitoring",getBooleanEncoder()],["retentionPeriod",getI64Encoder()]])}function yn(){return getStructDecoder([["auditEnabled",getBooleanDecoder()],["realTimeMonitoring",getBooleanDecoder()],["retentionPeriod",getI64Decoder()]])}function _0(){return combineCodec(mn(),yn())}var Wf=a(()=>{});function Tn(){return getStructEncoder([["policyId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["policyType",Rn()],["rules",getArrayEncoder(Dn())],["scope",En()],["priority",getU8Encoder()],["status",Cn()],["effectiveDate",getI64Encoder()],["expirationDate",getOptionEncoder(getI64Encoder())],["metadata",Sn()]])}function fn(){return getStructDecoder([["policyId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["policyType",In()],["rules",getArrayDecoder(hn())],["scope",Pn()],["priority",getU8Decoder()],["status",bn()],["effectiveDate",getI64Decoder()],["expirationDate",getOptionDecoder(getI64Decoder())],["metadata",xn()]])}function K0(){return combineCodec(Tn(),fn())}var Lf=a(()=>{m();});function j(){return getEnumEncoder(vn)}function $(){return getEnumDecoder(vn)}function q0(){return combineCodec(j(),$())}var vn,Vf=a(()=>{vn=(c=>(c[c.None=0]="None",c[c.Basic=1]="Basic",c[c.Verified=2]="Verified",c[c.Pro=3]="Pro",c[c.Whale=4]="Whale",c))(vn||{});});function Mn(){return getStructEncoder([["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function kn(){return getStructDecoder([["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function o_(){return combineCodec(Mn(),kn())}var Kf=a(()=>{});function wn(){return getStructEncoder([["maxFailedAttempts",getU8Encoder()],["lockoutDuration",getI64Encoder()],["progressiveLockout",getBooleanEncoder()],["unlockMethods",getArrayEncoder(_n())],["notificationRequirements",getArrayEncoder(we())]])}function Un(){return getStructDecoder([["maxFailedAttempts",getU8Decoder()],["lockoutDuration",getI64Decoder()],["progressiveLockout",getBooleanDecoder()],["unlockMethods",getArrayDecoder(zn())],["notificationRequirements",getArrayDecoder(Ue())]])}function l_(){return combineCodec(wn(),Un())}var $f=a(()=>{m();});function On(){return getStructEncoder([["requirementType",Gn()],["approvers",getArrayEncoder(getAddressEncoder())],["minApprovals",getU8Encoder()],["approvalTimeout",getI64Encoder()],["evidenceRequirements",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function Fn(){return getStructDecoder([["requirementType",Wn()],["approvers",getArrayDecoder(getAddressDecoder())],["minApprovals",getU8Decoder()],["approvalTimeout",getI64Decoder()],["evidenceRequirements",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function M_(){return combineCodec(On(),Fn())}var Qf=a(()=>{m();});function Gn(){return getEnumEncoder(Nn)}function Wn(){return getEnumDecoder(Nn)}function __(){return combineCodec(Gn(),Wn())}var Nn,Xf=a(()=>{Nn=(s=>(s[s.ManagerApproval=0]="ManagerApproval",s[s.PeerReview=1]="PeerReview",s[s.SecurityClearance=2]="SecurityClearance",s[s.BackgroundCheck=3]="BackgroundCheck",s[s.TrainingCompletion=4]="TrainingCompletion",s[s.CertificationRequired=5]="CertificationRequired",s[s.BusinessJustification=6]="BusinessJustification",s[s.TechnicalAssessment=7]="TechnicalAssessment",s))(Nn||{});});function eS(){return getStructEncoder([["agent",getAddressEncoder()],["owner",getAddressEncoder()],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["timestamp",getI64Encoder()]])}function tS(){return getStructDecoder([["agent",getAddressDecoder()],["owner",getAddressDecoder()],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["timestamp",getI64Decoder()]])}function j_(){return combineCodec(eS(),tS())}var nS=a(()=>{});function iS(){return getStructEncoder([["agent",getAddressEncoder()],["owner",getAddressEncoder()],["timestamp",getI64Encoder()],["serviceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["isActive",getBooleanEncoder()]])}function cS(){return getStructDecoder([["agent",getAddressDecoder()],["owner",getAddressDecoder()],["timestamp",getI64Decoder()],["serviceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["isActive",getBooleanDecoder()]])}function cz(){return combineCodec(iS(),cS())}var sS=a(()=>{});function Ln(){return getEnumEncoder(Bn)}function Vn(){return getEnumDecoder(Bn)}function uz(){return combineCodec(Ln(),Vn())}var Bn,aS=a(()=>{Bn=(r=>(r[r.Unregistered=0]="Unregistered",r[r.Registered=1]="Registered",r[r.Claimed=2]="Claimed",r[r.Verified=3]="Verified",r))(Bn||{});});function pS(){return getStructEncoder([["agent",getAddressEncoder()],["previousStatus",getBooleanEncoder()],["newStatus",getBooleanEncoder()],["timestamp",getI64Encoder()],["authority",getAddressEncoder()]])}function lS(){return getStructDecoder([["agent",getAddressDecoder()],["previousStatus",getBooleanDecoder()],["newStatus",getBooleanDecoder()],["timestamp",getI64Decoder()],["authority",getAddressDecoder()]])}function yz(){return combineCodec(pS(),lS())}var mS=a(()=>{});function fS(){return getStructEncoder([["agent",getAddressEncoder()],["owner",getAddressEncoder()],["timestamp",getI64Encoder()]])}function SS(){return getStructDecoder([["agent",getAddressDecoder()],["owner",getAddressDecoder()],["timestamp",getI64Decoder()]])}function hz(){return combineCodec(fS(),SS())}var xS=a(()=>{});function Kn(){return getStructEncoder([["agentPubkey",getAddressEncoder()],["serviceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["supportedCapabilities",getArrayEncoder(getU64Encoder())],["verifiedAt",getI64Encoder()]])}function Hn(){return getStructDecoder([["agentPubkey",getAddressDecoder()],["serviceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["supportedCapabilities",getArrayDecoder(getU64Decoder())],["verifiedAt",getI64Decoder()]])}function Nz(){return combineCodec(Kn(),Hn())}var DS=a(()=>{});function jn(){return getStructEncoder([["biometricType",_e()],["maxAge",getI64Encoder()],["refreshRequirements",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["degradationHandling",qn()]])}function $n(){return getStructDecoder([["biometricType",ze()],["maxAge",getI64Decoder()],["refreshRequirements",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["degradationHandling",Jn()]])}function eO(){return combineCodec(jn(),$n())}var hS=a(()=>{m();});function Qn(){return getStructEncoder([["actionType",Oe()],["requiredApprovers",getArrayEncoder(getAddressEncoder())],["minApprovals",getU8Encoder()],["approvalTimeout",getI64Encoder()]])}function Xn(){return getStructDecoder([["actionType",Fe()],["requiredApprovers",getArrayDecoder(getAddressDecoder())],["minApprovals",getU8Decoder()],["approvalTimeout",getI64Decoder()]])}function AO(){return combineCodec(Qn(),Xn())}var ES=a(()=>{m();});function ie(){return getDiscriminatedUnionEncoder([["FavorClient",getStructEncoder([["reason",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])],["FavorAgent",getStructEncoder([["reason",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])],["Split",getStructEncoder([["clientPercentage",getU8Encoder()],["reason",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])]])}function ce(){return getDiscriminatedUnionDecoder([["FavorClient",getStructDecoder([["reason",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])],["FavorAgent",getStructDecoder([["reason",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])],["Split",getStructDecoder([["clientPercentage",getU8Decoder()],["reason",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])]])}function fO(){return combineCodec(ie(),ce())}function SO(n,e){return Array.isArray(e)?{__kind:n,fields:e}:{__kind:n,...e??{}}}function xO(n,e){return e.__kind===n}var PS=a(()=>{});function Oe(){return getEnumEncoder(Zn)}function Fe(){return getEnumDecoder(Zn)}function PO(){return combineCodec(Oe(),Fe())}var Zn,CS=a(()=>{Zn=(l=>(l[l.AgentRegistered=0]="AgentRegistered",l[l.AgentUpdated=1]="AgentUpdated",l[l.AgentDeactivated=2]="AgentDeactivated",l[l.AgentVerified=3]="AgentVerified",l[l.PaymentProcessed=4]="PaymentProcessed",l[l.EscrowCreated=5]="EscrowCreated",l[l.EscrowReleased=6]="EscrowReleased",l[l.FundsWithdrawn=7]="FundsWithdrawn",l[l.ProposalCreated=8]="ProposalCreated",l[l.VoteCast=9]="VoteCast",l[l.ProposalExecuted=10]="ProposalExecuted",l[l.GovernanceUpdated=11]="GovernanceUpdated",l[l.AccessGranted=12]="AccessGranted",l[l.AccessRevoked=13]="AccessRevoked",l[l.SecurityPolicyUpdated=14]="SecurityPolicyUpdated",l[l.SuspiciousActivity=15]="SuspiciousActivity",l[l.ComplianceReportGenerated=16]="ComplianceReportGenerated",l[l.RegulatorySubmission=17]="RegulatorySubmission",l[l.AuditRequested=18]="AuditRequested",l[l.ViolationDetected=19]="ViolationDetected",l[l.SystemConfigUpdated=20]="SystemConfigUpdated",l[l.EmergencyAction=21]="EmergencyAction",l[l.MaintenancePerformed=22]="MaintenancePerformed",l[l.WorkOrderCreated=23]="WorkOrderCreated",l[l.WorkOrderCompleted=24]="WorkOrderCompleted",l[l.DisputeRaised=25]="DisputeRaised",l[l.DisputeResolved=26]="DisputeResolved",l[l.MultisigCreated=27]="MultisigCreated",l[l.MultisigSigned=28]="MultisigSigned",l[l.MultisigExecuted=29]="MultisigExecuted",l[l.RiskAssessmentPerformed=30]="RiskAssessmentPerformed",l[l.RiskThresholdExceeded=31]="RiskThresholdExceeded",l[l.RiskMitigationApplied=32]="RiskMitigationApplied",l))(Zn||{});});function Ge(){return getStructEncoder([["maxEntries",getU32Encoder()],["retentionPeriod",getI64Encoder()],["autoArchive",getBooleanEncoder()],["reportingFrequency",tr()],["approvalLevels",getArrayEncoder(Qn())],["encryptionRequired",getBooleanEncoder()],["backupFrequency",Yn()]])}function We(){return getStructDecoder([["maxEntries",getU32Decoder()],["retentionPeriod",getI64Decoder()],["autoArchive",getBooleanDecoder()],["reportingFrequency",nr()],["approvalLevels",getArrayDecoder(Xn())],["encryptionRequired",getBooleanDecoder()],["backupFrequency",er()]])}function _O(){return combineCodec(Ge(),We())}var IS=a(()=>{m();});function rr(){return getStructEncoder([["metadata",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function or(){return getStructDecoder([["metadata",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function KO(){return combineCodec(rr(),or())}var vS=a(()=>{});function ir(){return getStructEncoder([["entryId",getU64Encoder()],["timestamp",getI64Encoder()],["action",Oe()],["actor",getAddressEncoder()],["target",getOptionEncoder(getAddressEncoder())],["context",rr()],["complianceFlags",sr()],["previousHash",fixEncoderSize(getBytesEncoder(),32)],["entryHash",fixEncoderSize(getBytesEncoder(),32)],["signature",getOptionEncoder(fixEncoderSize(getBytesEncoder(),64))]])}function cr(){return getStructDecoder([["entryId",getU64Decoder()],["timestamp",getI64Decoder()],["action",Fe()],["actor",getAddressDecoder()],["target",getOptionDecoder(getAddressDecoder())],["context",or()],["complianceFlags",ar()],["previousHash",fixDecoderSize(getBytesDecoder(),32)],["entryHash",fixDecoderSize(getBytesDecoder(),32)],["signature",getOptionDecoder(fixDecoderSize(getBytesDecoder(),64))]])}function ZO(){return combineCodec(ir(),cr())}var _S=a(()=>{m();});function zS(){return getStructEncoder([["entity",getAddressEncoder()],["entityType",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["timestamp",getI64Encoder()]])}function OS(){return getStructDecoder([["entity",getAddressDecoder()],["entityType",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["timestamp",getI64Decoder()]])}function A8(){return combineCodec(zS(),OS())}var FS=a(()=>{});function ur(){return getEnumEncoder(dr)}function gr(){return getEnumDecoder(dr)}function y8(){return combineCodec(ur(),gr())}var dr,GS=a(()=>{dr=(r=>(r[r.Low=0]="Low",r[r.Medium=1]="Medium",r[r.High=2]="High",r[r.VeryHigh=3]="VeryHigh",r))(dr||{});});function pr(){return getEnumEncoder(Ar)}function lr(){return getEnumDecoder(Ar)}function x8(){return combineCodec(pr(),lr())}var Ar,WS=a(()=>{Ar=(p=>(p[p.Password=0]="Password",p[p.DigitalSignature=1]="DigitalSignature",p[p.Biometric=2]="Biometric",p[p.Token=3]="Token",p[p.Certificate=4]="Certificate",p[p.Sms=5]="Sms",p[p.Email=6]="Email",p[p.App=7]="App",p[p.Hardware=8]="Hardware",p))(Ar||{});});function mr(){return getStructEncoder([["mfaRequired",getBooleanEncoder()],["supportedMethods",getArrayEncoder(pr())],["strengthRequirements",Tr()],["lockoutPolicies",wn()],["biometricPolicies",getOptionEncoder(Sr())]])}function yr(){return getStructDecoder([["mfaRequired",getBooleanDecoder()],["supportedMethods",getArrayDecoder(lr())],["strengthRequirements",fr()],["lockoutPolicies",Un()],["biometricPolicies",getOptionDecoder(xr())]])}function M8(){return combineCodec(mr(),yr())}var NS=a(()=>{m();});function Tr(){return getStructEncoder([["minimumLevel",ur()],["riskBased",getBooleanEncoder()],["adaptive",getBooleanEncoder()],["stepUpTriggers",getArrayEncoder(Dr())]])}function fr(){return getStructDecoder([["minimumLevel",gr()],["riskBased",getBooleanDecoder()],["adaptive",getBooleanDecoder()],["stepUpTriggers",getArrayDecoder(hr())]])}function O8(){return combineCodec(Tr(),fr())}var VS=a(()=>{m();});function Er(){return getStructEncoder([["defaultDeny",getBooleanEncoder()],["explicitPermissionsRequired",getBooleanEncoder()]])}function Pr(){return getStructDecoder([["defaultDeny",getBooleanDecoder()],["explicitPermissionsRequired",getBooleanDecoder()]])}function N8(){return combineCodec(Er(),Pr())}var jS=a(()=>{});function Yn(){return getEnumEncoder(Cr)}function er(){return getEnumDecoder(Cr)}function K8(){return combineCodec(Yn(),er())}var Cr,$S=a(()=>{Cr=(r=>(r[r.Hourly=0]="Hourly",r[r.Daily=1]="Daily",r[r.Weekly=2]="Weekly",r[r.Monthly=3]="Monthly",r))(Cr||{});});function Sr(){return getStructEncoder([["supportedTypes",getArrayEncoder(_e())],["qualityRequirements",Ir()],["livenessDetection",getBooleanEncoder()],["templateProtection",br()]])}function xr(){return getStructDecoder([["supportedTypes",getArrayDecoder(ze())],["qualityRequirements",vr()],["livenessDetection",getBooleanDecoder()],["templateProtection",Rr()]])}function Z8(){return combineCodec(Sr(),xr())}var qS=a(()=>{m();});function br(){return getStructEncoder([["encryptionRequired",getBooleanEncoder()],["storageMethod",Mr()],["revocationSupport",getBooleanEncoder()],["agingPolicies",getArrayEncoder(jn())]])}function Rr(){return getStructDecoder([["encryptionRequired",getBooleanDecoder()],["storageMethod",kr()],["revocationSupport",getBooleanDecoder()],["agingPolicies",getArrayDecoder($n())]])}function oF(){return combineCodec(br(),Rr())}var XS=a(()=>{m();});function Ir(){return getStructEncoder([["score",getU8Encoder()]])}function vr(){return getStructDecoder([["score",getU8Decoder()]])}function uF(){return combineCodec(Ir(),vr())}var ZS=a(()=>{});function Mr(){return getEnumEncoder(wr)}function kr(){return getEnumDecoder(wr)}function lF(){return combineCodec(Mr(),kr())}var wr,YS=a(()=>{wr=(c=>(c[c.OnDevice=0]="OnDevice",c[c.Encrypted=1]="Encrypted",c[c.Hashed=2]="Hashed",c[c.Distributed=3]="Distributed",c[c.None=4]="None",c))(wr||{});});function _e(){return getEnumEncoder(Ur)}function ze(){return getEnumDecoder(Ur)}function fF(){return combineCodec(_e(),ze())}var Ur,ex=a(()=>{Ur=(d=>(d[d.Fingerprint=0]="Fingerprint",d[d.FaceRecognition=1]="FaceRecognition",d[d.IrisRecognition=2]="IrisRecognition",d[d.VoiceRecognition=3]="VoiceRecognition",d[d.Signature=4]="Signature",d[d.Gait=5]="Gait",d[d.Behavioral=6]="Behavioral",d))(Ur||{});});function sr(){return getStructEncoder([["requiresReporting",getBooleanEncoder()],["highRisk",getBooleanEncoder()],["sensitiveData",getBooleanEncoder()],["crossBorder",getBooleanEncoder()],["largeAmount",getBooleanEncoder()],["suspicious",getBooleanEncoder()],["manualReview",getBooleanEncoder()],["jurisdiction",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function ar(){return getStructDecoder([["requiresReporting",getBooleanDecoder()],["highRisk",getBooleanDecoder()],["sensitiveData",getBooleanDecoder()],["crossBorder",getBooleanDecoder()],["largeAmount",getBooleanDecoder()],["suspicious",getBooleanDecoder()],["manualReview",getBooleanDecoder()],["jurisdiction",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function MF(){return combineCodec(sr(),ar())}var tx=a(()=>{});function _r(){return getStructEncoder([["complianceScore",getU8Encoder()],["policyAdherenceRate",getU8Encoder()],["avgIncidentResponseTime",getU64Encoder()],["falsePositiveRate",getU8Encoder()],["coveragePercentage",getU8Encoder()],["auditReadinessScore",getU8Encoder()]])}function zr(){return getStructDecoder([["complianceScore",getU8Decoder()],["policyAdherenceRate",getU8Decoder()],["avgIncidentResponseTime",getU64Decoder()],["falsePositiveRate",getU8Decoder()],["coveragePercentage",getU8Decoder()],["auditReadinessScore",getU8Decoder()]])}function OF(){return combineCodec(_r(),zr())}var nx=a(()=>{});function Or(){return getStructEncoder([["frameworks",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["auditRequirements",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["reportingRequirements",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function Fr(){return getStructDecoder([["frameworks",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["auditRequirements",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["reportingRequirements",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function NF(){return combineCodec(Or(),Fr())}var rx=a(()=>{});function cx(){return getStructEncoder([["report",getAddressEncoder()],["reportId",getU64Encoder()],["reportType",se()],["complianceRate",getU64Encoder()]])}function sx(){return getStructDecoder([["report",getAddressDecoder()],["reportId",getU64Decoder()],["reportType",ae()],["complianceRate",getU64Decoder()]])}function jF(){return combineCodec(cx(),sx())}var ax=a(()=>{m();});function Gr(){return getStructEncoder([["status",getU8Encoder()]])}function Wr(){return getStructDecoder([["status",getU8Decoder()]])}function ZF(){return combineCodec(Gr(),Wr())}var dx=a(()=>{});function yx(){return getStructEncoder([["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["owner",getAddressEncoder()],["treeAuthority",getAddressEncoder()],["merkleTree",getAddressEncoder()],["dataHash",fixEncoderSize(getBytesEncoder(),32)],["index",getU64Encoder()],["metadataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["createdAt",getI64Encoder()]])}function Tx(){return getStructDecoder([["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["owner",getAddressDecoder()],["treeAuthority",getAddressDecoder()],["merkleTree",getAddressDecoder()],["dataHash",fixDecoderSize(getBytesDecoder(),32)],["index",getU64Decoder()],["metadataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["createdAt",getI64Decoder()]])}function uG(){return combineCodec(yx(),Tx())}var fx=a(()=>{});function Br(){return getEnumEncoder(Nr)}function Lr(){return getEnumDecoder(Nr)}function lG(){return combineCodec(Br(),Lr())}var Nr,Sx=a(()=>{Nr=(i=>(i[i.TimeDelay=0]="TimeDelay",i[i.TokenBalance=1]="TokenBalance",i[i.PriceThreshold=2]="PriceThreshold",i[i.VoteCount=3]="VoteCount",i[i.ExternalOracle=4]="ExternalOracle",i[i.CustomLogic=5]="CustomLogic",i))(Nr||{});});function Vr(){return getStructEncoder([["attribute",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["operator",Hr()],["value",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["valueType",$r()]])}function Kr(){return getStructDecoder([["attribute",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["operator",jr()],["value",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["valueType",qr()]])}function fG(){return combineCodec(Vr(),Kr())}var bx=a(()=>{m();});function Hr(){return getEnumEncoder(Jr)}function jr(){return getEnumDecoder(Jr)}function hG(){return combineCodec(Hr(),jr())}var Jr,Rx=a(()=>{Jr=(x=>(x[x.Equals=0]="Equals",x[x.NotEquals=1]="NotEquals",x[x.GreaterThan=2]="GreaterThan",x[x.LessThan=3]="LessThan",x[x.GreaterThanOrEqual=4]="GreaterThanOrEqual",x[x.LessThanOrEqual=5]="LessThanOrEqual",x[x.Contains=6]="Contains",x[x.NotContains=7]="NotContains",x[x.In=8]="In",x[x.NotIn=9]="NotIn",x[x.Matches=10]="Matches",x[x.NotMatches=11]="NotMatches",x))(Jr||{});});function Ne(){return getEnumEncoder(Qr)}function Be(){return getEnumDecoder(Qr)}function bG(){return combineCodec(Ne(),Be())}var Qr,Ix=a(()=>{Qr=(c=>(c[c.AgentIdentity=0]="AgentIdentity",c[c.ReputationScore=1]="ReputationScore",c[c.JobCompletion=2]="JobCompletion",c[c.DelegatedSigner=3]="DelegatedSigner",c[c.Custom=4]="Custom",c))(Qr||{});});function Zr(){return getEnumEncoder(Xr)}function Yr(){return getEnumDecoder(Xr)}function MG(){return combineCodec(Zr(),Yr())}var Xr,vx=a(()=>{Xr=(r=>(r[r.Pending=0]="Pending",r[r.Active=1]="Active",r[r.Revoked=2]="Revoked",r[r.Expired=3]="Expired",r))(Xr||{});});function Le(){return getEnumEncoder(eo)}function Ve(){return getEnumDecoder(eo)}function _G(){return combineCodec(Le(),Ve())}var eo,Mx=a(()=>{eo=(r=>(r[r.NotSynced=0]="NotSynced",r[r.SyncPending=1]="SyncPending",r[r.SyncedToCrossmint=2]="SyncedToCrossmint",r[r.SyncFailed=3]="SyncFailed",r))(eo||{});});function no(){return getEnumEncoder(to)}function ro(){return getEnumDecoder(to)}function GG(){return combineCodec(no(),ro())}var to,kx=a(()=>{to=(c=>(c[c.Public=0]="Public",c[c.Internal=1]="Internal",c[c.Confidential=2]="Confidential",c[c.Restricted=3]="Restricted",c[c.TopSecret=4]="TopSecret",c))(to||{});});function oo(){return getStructEncoder([["encryptionRequired",getBooleanEncoder()],["classificationRequired",getBooleanEncoder()],["dlpEnabled",getBooleanEncoder()]])}function io(){return getStructDecoder([["encryptionRequired",getBooleanDecoder()],["classificationRequired",getBooleanDecoder()],["dlpEnabled",getBooleanDecoder()]])}function LG(){return combineCodec(oo(),io())}var wx=a(()=>{});function qn(){return getEnumEncoder(co)}function Jn(){return getEnumDecoder(co)}function jG(){return combineCodec(qn(),Jn())}var co,Ux=a(()=>{co=(r=>(r[r.RequireRefresh=0]="RequireRefresh",r[r.GradualDegradation=1]="GradualDegradation",r[r.ImmediateExpiry=2]="ImmediateExpiry",r[r.AdaptiveThreshold=3]="AdaptiveThreshold",r))(co||{});});function so(){return getStructEncoder([["delegator",getAddressEncoder()],["delegatedAt",getI64Encoder()],["scope",uo()],["expiresAt",getOptionEncoder(getI64Encoder())]])}function ao(){return getStructDecoder([["delegator",getAddressDecoder()],["delegatedAt",getI64Decoder()],["scope",go()],["expiresAt",getOptionDecoder(getI64Decoder())]])}function e2(){return combineCodec(so(),ao())}var Ox=a(()=>{m();});function uo(){return getDiscriminatedUnionEncoder([["All",getUnitEncoder()],["ProposalType",getStructEncoder([["fields",getTupleEncoder([de()])]])],["SingleProposal",getUnitEncoder()],["Limited",getUnitEncoder()]])}function go(){return getDiscriminatedUnionDecoder([["All",getUnitDecoder()],["ProposalType",getStructDecoder([["fields",getTupleDecoder([ue()])]])],["SingleProposal",getUnitDecoder()],["Limited",getUnitDecoder()]])}function a2(){return combineCodec(uo(),go())}function d2(n,e){return Array.isArray(e)?{__kind:n,fields:e}:{__kind:n,...e??{}}}function u2(n,e){return e.__kind===n}var Fx=a(()=>{m();});function Gx(){return getStructEncoder([["escrowId",getU64Encoder()],["agent",getAddressEncoder()],["deliveryProof",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function Wx(){return getStructDecoder([["escrowId",getU64Decoder()],["agent",getAddressDecoder()],["deliveryProof",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function P2(){return combineCodec(Gx(),Wx())}var Nx=a(()=>{});function Bx(){return getStructEncoder([["escrowId",getU64Encoder()],["client",getAddressEncoder()],["reason",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function Lx(){return getStructDecoder([["escrowId",getU64Decoder()],["client",getAddressDecoder()],["reason",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function G2(){return combineCodec(Bx(),Lx())}var Vx=a(()=>{});function Kx(){return getStructEncoder([["escrowId",getU64Encoder()],["decision",ie()],["arbitrator",getAddressEncoder()]])}function Hx(){return getStructDecoder([["escrowId",getU64Decoder()],["decision",ce()],["arbitrator",getAddressDecoder()]])}function j2(){return combineCodec(Kx(),Hx())}var jx=a(()=>{m();});function Ao(){return getStructEncoder([["breakGlassEnabled",getBooleanEncoder()],["emergencyContacts",getArrayEncoder(getAddressEncoder())],["approvalRequired",getBooleanEncoder()]])}function po(){return getStructDecoder([["breakGlassEnabled",getBooleanDecoder()],["emergencyContacts",getArrayDecoder(getAddressDecoder())],["approvalRequired",getBooleanDecoder()]])}function eW(){return combineCodec(Ao(),po())}var Jx=a(()=>{});function lo(){return getStructEncoder([["emergencyContacts",getArrayEncoder(getAddressEncoder())],["emergencyThreshold",getU8Encoder()],["emergencyTimeout",getI64Encoder()],["emergencyTransactionTypes",getArrayEncoder(Ke())],["freezeEnabled",getBooleanEncoder()],["frozen",getBooleanEncoder()],["frozenAt",getOptionEncoder(getI64Encoder())],["autoUnfreezeDuration",getOptionEncoder(getI64Encoder())]])}function mo(){return getStructDecoder([["emergencyContacts",getArrayDecoder(getAddressDecoder())],["emergencyThreshold",getU8Decoder()],["emergencyTimeout",getI64Decoder()],["emergencyTransactionTypes",getArrayDecoder(He())],["freezeEnabled",getBooleanDecoder()],["frozen",getBooleanDecoder()],["frozenAt",getOptionDecoder(getI64Decoder())],["autoUnfreezeDuration",getOptionDecoder(getI64Decoder())]])}function aW(){return combineCodec(lo(),mo())}var nD=a(()=>{m();});function je(){return getEnumEncoder(yo)}function $e(){return getEnumDecoder(yo)}function AW(){return combineCodec(je(),$e())}var yo,rD=a(()=>{yo=(r=>(r[r.Hard=0]="Hard",r[r.Soft=1]="Soft",r[r.Advisory=2]="Advisory",r[r.ExceptionBased=3]="ExceptionBased",r))(yo||{});});function cD(){return getStructEncoder([["escrowId",getU64Encoder()],["agent",getAddressEncoder()],["amount",getU64Encoder()]])}function sD(){return getStructDecoder([["escrowId",getU64Decoder()],["agent",getAddressDecoder()],["amount",getU64Decoder()]])}function fW(){return combineCodec(cD(),sD())}var aD=a(()=>{});function pD(){return getStructEncoder([["escrowId",getU64Encoder()],["client",getAddressEncoder()],["agent",getAddressEncoder()],["amount",getU64Encoder()],["deadline",getI64Encoder()]])}function lD(){return getStructDecoder([["escrowId",getU64Decoder()],["client",getAddressDecoder()],["agent",getAddressDecoder()],["amount",getU64Decoder()],["deadline",getI64Decoder()]])}function PW(){return combineCodec(pD(),lD())}var mD=a(()=>{});function fo(){return getEnumEncoder(To)}function So(){return getEnumDecoder(To)}function IW(){return combineCodec(fo(),So())}var To,yD=a(()=>{To=(r=>(r[r.Active=0]="Active",r[r.Completed=1]="Completed",r[r.Disputed=2]="Disputed",r[r.Cancelled=3]="Cancelled",r))(To||{});});function ge(){return getStructEncoder([["conditionType",Br()],["targetValue",getU64Encoder()],["currentValue",getU64Encoder()],["met",getBooleanEncoder()],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function Ae(){return getStructDecoder([["conditionType",Lr()],["targetValue",getU64Decoder()],["currentValue",getU64Decoder()],["met",getBooleanDecoder()],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function NW(){return combineCodec(ge(),Ae())}var SD=a(()=>{m();});function qe(){return getStructEncoder([["instructions",getArrayEncoder(xo())],["executionDelay",getI64Encoder()],["executionConditions",getArrayEncoder(ge())],["cancellable",getBooleanEncoder()],["autoExecute",getBooleanEncoder()],["executionAuthority",getAddressEncoder()]])}function Je(){return getStructDecoder([["instructions",getArrayDecoder(Do())],["executionDelay",getI64Decoder()],["executionConditions",getArrayDecoder(Ae())],["cancellable",getBooleanDecoder()],["autoExecute",getBooleanDecoder()],["executionAuthority",getAddressDecoder()]])}function qW(){return combineCodec(qe(),Je())}var PD=a(()=>{m();});function ho(){return getStructEncoder([["platform",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["externalId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["verified",getBooleanEncoder()],["verifiedAt",getI64Encoder()]])}function Eo(){return getStructDecoder([["platform",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["externalId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["verified",getBooleanDecoder()],["verifiedAt",getI64Decoder()]])}function n6(){return combineCodec(ho(),Eo())}var kD=a(()=>{});function Po(){return getStructEncoder([["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["latitudeRange",bo()],["longitudeRange",Io()],["radius",getOptionEncoder(getU32Encoder())]])}function Co(){return getStructDecoder([["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["latitudeRange",Ro()],["longitudeRange",vo()],["radius",getOptionDecoder(getU32Decoder())]])}function A6(){return combineCodec(Po(),Co())}var _D=a(()=>{m();});function zD(){return getStructEncoder([["agent",getAddressEncoder()],["amount",getU64Encoder()],["reason",Qe()],["newTier",j()]])}function OD(){return getStructDecoder([["agent",getAddressDecoder()],["amount",getU64Decoder()],["reason",Xe()],["newTier",$()]])}function x6(){return combineCodec(zD(),OD())}var FD=a(()=>{m();});function ND(){return getStructEncoder([["agent",getAddressEncoder()],["amount",getU64Encoder()],["unlockAt",getI64Encoder()],["reputationBoostBps",getU16Encoder()],["tier",j()],["dailyApiCalls",getU32Encoder()],["votingPower",getU64Encoder()]])}function BD(){return getStructDecoder([["agent",getAddressDecoder()],["amount",getU64Decoder()],["unlockAt",getI64Decoder()],["reputationBoostBps",getU16Decoder()],["tier",$()],["dailyApiCalls",getU32Decoder()],["votingPower",getU64Decoder()]])}function w6(){return combineCodec(ND(),BD())}var LD=a(()=>{m();});function VD(){return getStructEncoder([["agent",getAddressEncoder()],["amount",getU64Encoder()]])}function KD(){return getStructDecoder([["agent",getAddressDecoder()],["amount",getU64Decoder()]])}function N6(){return combineCodec(VD(),KD())}var HD=a(()=>{});function qD(){return getStructEncoder([["proposal",getAddressEncoder()],["proposalId",getU64Encoder()],["proposer",getAddressEncoder()],["title",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function JD(){return getStructDecoder([["proposal",getAddressDecoder()],["proposalId",getU64Decoder()],["proposer",getAddressDecoder()],["title",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function Z6(){return combineCodec(qD(),JD())}var QD=a(()=>{});function Mo(){return getStructEncoder([["level",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["value",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["includeDescendants",getBooleanEncoder()]])}function ko(){return getStructDecoder([["level",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["value",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["includeDescendants",getBooleanDecoder()]])}function oN(){return combineCodec(Mo(),ko())}var rh=a(()=>{});function wo(){return getStructEncoder([["responseTeam",getArrayEncoder(getAddressEncoder())],["escalationProcedures",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["notificationRequirements",getArrayEncoder(we())]])}function Uo(){return getStructDecoder([["responseTeam",getArrayDecoder(getAddressDecoder())],["escalationProcedures",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["notificationRequirements",getArrayDecoder(Ue())]])}function yN(){return combineCodec(wo(),Uo())}var oh=a(()=>{m();});function bo(){return getStructEncoder([["min",getF64Encoder()],["max",getF64Encoder()]])}function Ro(){return getStructDecoder([["min",getF64Decoder()],["max",getF64Decoder()]])}function xN(){return combineCodec(bo(),Ro())}var sh=a(()=>{});function No(){return getStructEncoder([["allowedCountries",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["blockedCountries",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["allowedIpRanges",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["blockedIpRanges",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["geofencingEnabled",getBooleanEncoder()],["allowedRegions",getArrayEncoder(Po())]])}function Bo(){return getStructDecoder([["allowedCountries",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["blockedCountries",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["allowedIpRanges",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["blockedIpRanges",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["geofencingEnabled",getBooleanDecoder()],["allowedRegions",getArrayDecoder(Co())]])}function bN(){return combineCodec(No(),Bo())}var ah=a(()=>{m();});function Io(){return getStructEncoder([["min",getF64Encoder()],["max",getF64Encoder()]])}function vo(){return getStructDecoder([["min",getF64Decoder()],["max",getF64Decoder()]])}function MN(){return combineCodec(Io(),vo())}var gh=a(()=>{});function Ze(){return getStructEncoder([["threshold",getU8Encoder()]])}function Ye(){return getStructDecoder([["threshold",getU8Decoder()]])}function ON(){return combineCodec(Ze(),Ye())}var Ah=a(()=>{});function mh(){return getStructEncoder([["multisigId",getU64Encoder()],["multisigType",pe()],["owner",getAddressEncoder()],["threshold",getU8Encoder()],["signerCount",getU8Encoder()],["timestamp",getI64Encoder()]])}function yh(){return getStructDecoder([["multisigId",getU64Decoder()],["multisigType",le()],["owner",getAddressDecoder()],["threshold",getU8Decoder()],["signerCount",getU8Decoder()],["timestamp",getI64Decoder()]])}function jN(){return combineCodec(mh(),yh())}var Th=a(()=>{m();});function Lo(){return getStructEncoder([["signer",getAddressEncoder()],["signature",fixEncoderSize(getBytesEncoder(),64)],["signedAt",getI64Encoder()],["signatureMethod",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["verificationData",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))]])}function Vo(){return getStructDecoder([["signer",getAddressDecoder()],["signature",fixDecoderSize(getBytesDecoder(),64)],["signedAt",getI64Decoder()],["signatureMethod",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["verificationData",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))]])}function c4(){return combineCodec(Lo(),Vo())}var Ph=a(()=>{});function pe(){return getEnumEncoder(Ko)}function le(){return getEnumDecoder(Ko)}function u4(){return combineCodec(pe(),le())}var Ko,Ch=a(()=>{Ko=(i=>(i[i.Protocol=0]="Protocol",i[i.Dao=1]="Dao",i[i.Dispute=2]="Dispute",i[i.AgentConsortium=3]="AgentConsortium",i[i.AgentTreasury=4]="AgentTreasury",i[i.Custom=5]="Custom",i))(Ko||{});});function Ho(){return getStructEncoder([["multisigType",pe()],["timelockSeconds",getI64Encoder()],["minSigners",getU8Encoder()],["maxSigners",getU8Encoder()],["minReputationScore",getU16Encoder()],["requiresTokenHoldings",getBooleanEncoder()],["minTokenBalance",getU64Encoder()]])}function jo(){return getStructDecoder([["multisigType",le()],["timelockSeconds",getI64Decoder()],["minSigners",getU8Decoder()],["maxSigners",getU8Decoder()],["minReputationScore",getU16Decoder()],["requiresTokenHoldings",getBooleanDecoder()],["minTokenBalance",getU64Decoder()]])}function h4(){return combineCodec(Ho(),jo())}var Ih=a(()=>{m();});function $o(){return getStructEncoder([["firewallRequired",getBooleanEncoder()],["intrusionDetection",getBooleanEncoder()],["trafficMonitoring",getBooleanEncoder()]])}function qo(){return getStructDecoder([["firewallRequired",getBooleanDecoder()],["intrusionDetection",getBooleanDecoder()],["trafficMonitoring",getBooleanDecoder()]])}function b4(){return combineCodec($o(),qo())}var vh=a(()=>{});function Qo(){return getEnumEncoder(Jo)}function Xo(){return getEnumDecoder(Jo)}function M4(){return combineCodec(Qo(),Xo())}var Jo,Mh=a(()=>{Jo=(i=>(i[i.OnChain=0]="OnChain",i[i.Email=1]="Email",i[i.Sms=2]="Sms",i[i.Push=3]="Push",i[i.InApp=4]="InApp",i[i.All=5]="All",i))(Jo||{});});function Yo(){return getEnumEncoder(Zo)}function ei(){return getEnumDecoder(Zo)}function _4(){return combineCodec(Yo(),ei())}var Zo,kh=a(()=>{Zo=(c=>(c[c.Low=0]="Low",c[c.Medium=1]="Medium",c[c.High=2]="High",c[c.Critical=3]="Critical",c[c.Emergency=4]="Emergency",c))(Zo||{});});function we(){return getStructEncoder([["eventType",ii()],["targets",getArrayEncoder(ti())],["method",Qo()],["timing",ri()]])}function Ue(){return getStructDecoder([["eventType",ci()],["targets",getArrayDecoder(ni())],["method",Xo()],["timing",oi()]])}function N4(){return combineCodec(we(),Ue())}var wh=a(()=>{m();});function ti(){return getStructEncoder([["targetType",si()],["targetId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["priority",Yo()]])}function ni(){return getStructDecoder([["targetType",ai()],["targetId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["priority",ei()]])}function Q4(){return combineCodec(ti(),ni())}var Uh=a(()=>{m();});function si(){return getEnumEncoder(di)}function ai(){return getEnumDecoder(di)}function eB(){return combineCodec(si(),ai())}var di,_h=a(()=>{di=(d=>(d[d.User=0]="User",d[d.Administrator=1]="Administrator",d[d.SecurityTeam=2]="SecurityTeam",d[d.ComplianceTeam=3]="ComplianceTeam",d[d.Manager=4]="Manager",d[d.AuditTeam=5]="AuditTeam",d[d.ExternalSystem=6]="ExternalSystem",d))(di||{});});function ri(){return getEnumEncoder(ui)}function oi(){return getEnumDecoder(ui)}function oB(){return combineCodec(ri(),oi())}var ui,zh=a(()=>{ui=(r=>(r[r.Immediate=0]="Immediate",r[r.Delayed=1]="Delayed",r[r.Batched=2]="Batched",r[r.Scheduled=3]="Scheduled",r))(ui||{});});function gi(){return getStructEncoder([["minimumLength",getU8Encoder()],["complexityRequirements",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["historyCount",getU8Encoder()],["maxAge",getI64Encoder()]])}function Ai(){return getStructDecoder([["minimumLength",getU8Decoder()],["complexityRequirements",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["historyCount",getU8Decoder()],["maxAge",getI64Decoder()]])}function fB(){return combineCodec(gi(),Ai())}var Gh=a(()=>{});function pi(){return getStructEncoder([["transactionId",getU64Encoder()],["transactionType",Ke()],["target",getAddressEncoder()],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["requiredSignatures",getU8Encoder()],["signatures",getArrayEncoder(Lo())],["createdAt",getI64Encoder()],["expiresAt",getI64Encoder()],["priority",Ti()],["executionConditions",getArrayEncoder(ge())],["status",Si()],["timeLock",getOptionEncoder(mi())]])}function li(){return getStructDecoder([["transactionId",getU64Decoder()],["transactionType",He()],["target",getAddressDecoder()],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["requiredSignatures",getU8Decoder()],["signatures",getArrayDecoder(Vo())],["createdAt",getI64Decoder()],["expiresAt",getI64Decoder()],["priority",fi()],["executionConditions",getArrayDecoder(Ae())],["status",xi()],["timeLock",getOptionDecoder(yi())]])}function OB(){return combineCodec(pi(),li())}var Vh=a(()=>{m();});function Ri(){return getStructEncoder([["permissionId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["resourceType",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["actions",getArrayEncoder(Mn())],["scope",Ui()],["constraints",getArrayEncoder(vi())],["metadata",ki()]])}function Ii(){return getStructDecoder([["permissionId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["resourceType",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["actions",getArrayDecoder(kn())],["scope",_i()],["constraints",getArrayDecoder(Mi())],["metadata",wi()]])}function NB(){return combineCodec(Ri(),Ii())}var jh=a(()=>{m();});function vi(){return getStructEncoder([["constraintType",zi()],["conditions",getArrayEncoder(Vr())],["enforcement",je()]])}function Mi(){return getStructDecoder([["constraintType",Oi()],["conditions",getArrayDecoder(Kr())],["enforcement",$e()]])}function jB(){return combineCodec(vi(),Mi())}var $h=a(()=>{m();});function zi(){return getEnumEncoder(Fi)}function Oi(){return getEnumDecoder(Fi)}function QB(){return combineCodec(zi(),Oi())}var Fi,qh=a(()=>{Fi=(i=>(i[i.Temporal=0]="Temporal",i[i.Contextual=1]="Contextual",i[i.Conditional=2]="Conditional",i[i.ResourceBased=3]="ResourceBased",i[i.AttributeBased=4]="AttributeBased",i[i.RiskBased=5]="RiskBased",i))(Fi||{});});function ki(){return getStructEncoder([["businessJustification",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["riskAssessment",Gi()],["complianceMapping",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["relatedPermissions",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["owner",getOptionEncoder(getAddressEncoder())],["lastReview",getOptionEncoder(getI64Encoder())],["reviewFrequency",getI64Encoder()]])}function wi(){return getStructDecoder([["businessJustification",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["riskAssessment",Wi()],["complianceMapping",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["relatedPermissions",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["owner",getOptionDecoder(getAddressDecoder())],["lastReview",getOptionDecoder(getI64Decoder())],["reviewFrequency",getI64Decoder()]])}function nL(){return combineCodec(ki(),wi())}var tE=a(()=>{m();});function Ui(){return getStructEncoder([["scopeType",Li()],["boundaries",Ni()],["hierarchical",getBooleanEncoder()],["inherited",getBooleanEncoder()]])}function _i(){return getStructDecoder([["scopeType",Vi()],["boundaries",Bi()],["hierarchical",getBooleanDecoder()],["inherited",getBooleanDecoder()]])}function cL(){return combineCodec(Ui(),_i())}var oE=a(()=>{m();});function Sn(){return getStructEncoder([["author",getOptionEncoder(getAddressEncoder())],["approver",getOptionEncoder(getAddressEncoder())],["approvalDate",getOptionEncoder(getI64Encoder())],["businessJustification",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["complianceReferences",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["riskAssessment",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["reviewSchedule",ji()]])}function xn(){return getStructDecoder([["author",getOptionDecoder(getAddressDecoder())],["approver",getOptionDecoder(getAddressDecoder())],["approvalDate",getOptionDecoder(getI64Decoder())],["businessJustification",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["complianceReferences",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["riskAssessment",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["reviewSchedule",$i()]])}function lL(){return combineCodec(Sn(),xn())}var sE=a(()=>{m();});function Dn(){return getStructEncoder([["ruleId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["conditions",getArrayEncoder(qi())],["effect",Qi()],["priority",getU8Encoder()],["enabled",getBooleanEncoder()]])}function hn(){return getStructDecoder([["ruleId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["conditions",getArrayDecoder(Ji())],["effect",Xi()],["priority",getU8Decoder()],["enabled",getBooleanDecoder()]])}function ML(){return combineCodec(Dn(),hn())}var aE=a(()=>{m();});function En(){return getStructEncoder([["subjects",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["resources",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["actions",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["inheritance",Zi()]])}function Pn(){return getStructDecoder([["subjects",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["resources",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["actions",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["inheritance",Yi()]])}function _L(){return combineCodec(En(),Pn())}var dE=a(()=>{m();});function Cn(){return getEnumEncoder(ec)}function bn(){return getEnumDecoder(ec)}function GL(){return combineCodec(Cn(),bn())}var ec,uE=a(()=>{ec=(i=>(i[i.Active=0]="Active",i[i.Inactive=1]="Inactive",i[i.Draft=2]="Draft",i[i.UnderReview=3]="UnderReview",i[i.Deprecated=4]="Deprecated",i[i.Suspended=5]="Suspended",i))(ec||{});});function Rn(){return getEnumEncoder(tc)}function In(){return getEnumDecoder(tc)}function LL(){return combineCodec(Rn(),In())}var tc,gE=a(()=>{tc=(i=>(i[i.Allow=0]="Allow",i[i.Deny=1]="Deny",i[i.Conditional=2]="Conditional",i[i.Delegated=3]="Delegated",i[i.Temporary=4]="Temporary",i[i.Emergency=5]="Emergency",i))(tc||{});});function J(){return getEnumEncoder(Et)}function Q(){return getEnumDecoder(Et)}function jL(){return combineCodec(J(),Q())}var Et,AE=a(()=>{Et=(s=>(s[s.Fixed=0]="Fixed",s[s.Hourly=1]="Hourly",s[s.PerTask=2]="PerTask",s[s.Subscription=3]="Subscription",s[s.Auction=4]="Auction",s[s.Dynamic=5]="Dynamic",s[s.RevenueShare=6]="RevenueShare",s[s.Tiered=7]="Tiered",s))(Et||{});});function nc(){return getStructEncoder([["pubkey",getAddressEncoder()],["isSigner",getBooleanEncoder()],["isWritable",getBooleanEncoder()],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function rc(){return getStructDecoder([["pubkey",getAddressDecoder()],["isSigner",getBooleanDecoder()],["isWritable",getBooleanDecoder()],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function oV(){return combineCodec(nc(),rc())}var mE=a(()=>{});function xo(){return getStructEncoder([["programId",getAddressEncoder()],["accounts",getArrayEncoder(nc())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function Do(){return getStructDecoder([["programId",getAddressDecoder()],["accounts",getArrayDecoder(rc())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function yV(){return combineCodec(xo(),Do())}var xE=a(()=>{m();});function cc(){return getStructEncoder([["ipfsHash",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["externalReferences",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["tags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["riskAssessment",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["impactAnalysis",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["implementationTimeline",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function sc(){return getStructDecoder([["ipfsHash",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["externalReferences",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["tags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["riskAssessment",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["impactAnalysis",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["implementationTimeline",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function xV(){return combineCodec(cc(),sc())}var EE=a(()=>{});function dc(){return getEnumEncoder(ac)}function uc(){return getEnumDecoder(ac)}function PV(){return combineCodec(dc(),uc())}var ac,PE=a(()=>{ac=(s=>(s[s.Draft=0]="Draft",s[s.Active=1]="Active",s[s.Passed=2]="Passed",s[s.Failed=3]="Failed",s[s.Executed=4]="Executed",s[s.Cancelled=5]="Cancelled",s[s.Expired=6]="Expired",s[s.Queued=7]="Queued",s))(ac||{});});function de(){return getEnumEncoder(Pt)}function ue(){return getEnumDecoder(Pt)}function IV(){return combineCodec(de(),ue())}var Pt,Jg=a(()=>{Pt=(s=>(s[s.ParameterUpdate=0]="ParameterUpdate",s[s.ProtocolUpgrade=1]="ProtocolUpgrade",s[s.TreasuryOperation=2]="TreasuryOperation",s[s.FeeUpdate=3]="FeeUpdate",s[s.SecurityUpdate=4]="SecurityUpdate",s[s.GovernanceUpdate=5]="GovernanceUpdate",s[s.EmergencyAction=6]="EmergencyAction",s[s.Custom=7]="Custom",s))(Pt||{});});function vE(){return getStructEncoder([["authority",getAddressEncoder()],["feesEnabled",getBooleanEncoder()],["escrowFeeBps",getU16Encoder()],["agentRegistrationFee",getU64Encoder()],["listingFee",getU64Encoder()],["disputeFeeBps",getU16Encoder()],["timestamp",getI64Encoder()]])}function ME(){return getStructDecoder([["authority",getAddressDecoder()],["feesEnabled",getBooleanDecoder()],["escrowFeeBps",getU16Decoder()],["agentRegistrationFee",getU64Decoder()],["listingFee",getU64Decoder()],["disputeFeeBps",getU16Decoder()],["timestamp",getI64Decoder()]])}function GV(){return combineCodec(vE(),ME())}var kE=a(()=>{});function Ac(){return getEnumEncoder(gc)}function pc(){return getEnumDecoder(gc)}function LV(){return combineCodec(Ac(),pc())}var gc,wE=a(()=>{gc=(r=>(r[r.Absolute=0]="Absolute",r[r.Relative=1]="Relative",r[r.Weighted=2]="Weighted",r[r.Dynamic=3]="Dynamic",r))(gc||{});});function lc(){return getStructEncoder([["minimumParticipation",getU8Encoder()],["approvalThreshold",getU8Encoder()],["superMajorityRequired",getBooleanEncoder()],["minimumVotingPower",getU64Encoder()],["quorumMethod",Ac()]])}function mc(){return getStructDecoder([["minimumParticipation",getU8Decoder()],["approvalThreshold",getU8Decoder()],["superMajorityRequired",getBooleanDecoder()],["minimumVotingPower",getU64Decoder()],["quorumMethod",pc()]])}function QV(){return combineCodec(lc(),mc())}var zE=a(()=>{m();});function GE(){return getStructEncoder([["rbacConfig",getAddressEncoder()],["authority",getAddressEncoder()],["rolesCount",getU32Encoder()]])}function WE(){return getStructDecoder([["rbacConfig",getAddressDecoder()],["authority",getAddressDecoder()],["rolesCount",getU32Decoder()]])}function n3(){return combineCodec(GE(),WE())}var NE=a(()=>{});function Tc(){return getEnumEncoder(yc)}function fc(){return getEnumDecoder(yc)}function c3(){return combineCodec(Tc(),fc())}var yc,BE=a(()=>{yc=(t=>(t[t.Unlocked=0]="Unlocked",t[t.Locked=1]="Locked",t))(yc||{});});function Sc(){return getStructEncoder([["summary",Ec()],["entries",getArrayEncoder(Dc())],["complianceMetrics",_r()],["riskIndicators",getArrayEncoder(Cc())],["recommendations",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function xc(){return getStructDecoder([["summary",Pc()],["entries",getArrayDecoder(hc())],["complianceMetrics",zr()],["riskIndicators",getArrayDecoder(bc())],["recommendations",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function y3(){return combineCodec(Sc(),xc())}var LE=a(()=>{m();});function Dc(){return getStructEncoder([["data",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function hc(){return getStructDecoder([["data",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function b3(){return combineCodec(Dc(),hc())}var VE=a(()=>{});function tr(){return getEnumEncoder(Rc)}function nr(){return getEnumDecoder(Rc)}function M3(){return combineCodec(tr(),nr())}var Rc,KE=a(()=>{Rc=(i=>(i[i.Daily=0]="Daily",i[i.Weekly=1]="Weekly",i[i.Monthly=2]="Monthly",i[i.Quarterly=3]="Quarterly",i[i.Annually=4]="Annually",i[i.OnDemand=5]="OnDemand",i))(Rc||{});});function vc(){return getEnumEncoder(Ic)}function Mc(){return getEnumDecoder(Ic)}function _3(){return combineCodec(vc(),Mc())}var Ic,HE=a(()=>{Ic=(d=>(d[d.Draft=0]="Draft",d[d.Generated=1]="Generated",d[d.Reviewed=2]="Reviewed",d[d.Approved=3]="Approved",d[d.Submitted=4]="Submitted",d[d.Acknowledged=5]="Acknowledged",d[d.Rejected=6]="Rejected",d))(Ic||{});});function Ec(){return getStructEncoder([["totalTransactions",getU64Encoder()],["totalVolume",getU64Encoder()],["highRiskTransactions",getU64Encoder()],["complianceViolations",getU64Encoder()],["securityIncidents",getU64Encoder()],["averageRiskScore",getU8Encoder()]])}function Pc(){return getStructDecoder([["totalTransactions",getU64Decoder()],["totalVolume",getU64Decoder()],["highRiskTransactions",getU64Decoder()],["complianceViolations",getU64Decoder()],["securityIncidents",getU64Decoder()],["averageRiskScore",getU8Decoder()]])}function N3(){return combineCodec(Ec(),Pc())}var jE=a(()=>{});function se(){return getEnumEncoder(kc)}function ae(){return getEnumDecoder(kc)}function K3(){return combineCodec(se(),ae())}var kc,$E=a(()=>{kc=(s=>(s[s.FinancialTransactions=0]="FinancialTransactions",s[s.SuspiciousActivity=1]="SuspiciousActivity",s[s.RegulatoryCompliance=2]="RegulatoryCompliance",s[s.SecurityIncidents=3]="SecurityIncidents",s[s.AuditSummary=4]="AuditSummary",s[s.RiskAssessment=5]="RiskAssessment",s[s.GovernanceActivity=6]="GovernanceActivity",s[s.DataPrivacyCompliance=7]="DataPrivacyCompliance",s))(kc||{});});function ct(){return getStructEncoder([["sourceType",wc()],["score",getU64Encoder()],["weight",getU32Encoder()],["lastUpdated",getI64Encoder()],["dataPoints",getU64Encoder()]])}function st(){return getStructDecoder([["sourceType",Uc()],["score",getU64Decoder()],["weight",getU32Decoder()],["lastUpdated",getI64Decoder()],["dataPoints",getU64Decoder()]])}function Z3(){return combineCodec(ct(),st())}var QE=a(()=>{m();});function XE(){return getStructEncoder([["agent",getAddressEncoder()],["timestamp",getI64Encoder()]])}function ZE(){return getStructDecoder([["agent",getAddressDecoder()],["timestamp",getI64Decoder()]])}function c5(){return combineCodec(XE(),ZE())}var YE=a(()=>{});function eP(){return getStructEncoder([["agent",getAddressEncoder()],["paymentSignature",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["amount",getU64Encoder()],["responseTimeMs",getU64Encoder()],["success",getBooleanEncoder()],["newReputationScore",getU64Encoder()],["timestamp",getI64Encoder()]])}function tP(){return getStructDecoder([["agent",getAddressDecoder()],["paymentSignature",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["amount",getU64Decoder()],["responseTimeMs",getU64Decoder()],["success",getBooleanDecoder()],["newReputationScore",getU64Decoder()],["timestamp",getI64Decoder()]])}function h5(){return combineCodec(eP(),tP())}var nP=a(()=>{});function iP(){return getStructEncoder([["agent",getAddressEncoder()],["client",getAddressEncoder()],["rating",getU8Encoder()],["newReputationScore",getU64Encoder()],["timestamp",getI64Encoder()]])}function cP(){return getStructDecoder([["agent",getAddressDecoder()],["client",getAddressDecoder()],["rating",getU8Decoder()],["newReputationScore",getU64Decoder()],["timestamp",getI64Decoder()]])}function w5(){return combineCodec(iP(),cP())}var sP=a(()=>{});function wc(){return getEnumEncoder(_c)}function Uc(){return getEnumDecoder(_c)}function O5(){return combineCodec(wc(),Uc())}var _c,aP=a(()=>{_c=(s=>(s[s.AccountAge=0]="AccountAge",s[s.X402Transactions=1]="X402Transactions",s[s.UserReviews=2]="UserReviews",s[s.ElizaOSReputation=3]="ElizaOSReputation",s[s.CrossmintVerification=4]="CrossmintVerification",s[s.EndpointReliability=5]="EndpointReliability",s[s.JobCompletions=6]="JobCompletions",s[s.SkillEndorsements=7]="SkillEndorsements",s))(_c||{});});function dP(){return getStructEncoder([["agent",getAddressEncoder()],["totalTags",getU32Encoder()],["skillTagsCount",getU32Encoder()],["behaviorTagsCount",getU32Encoder()],["complianceTagsCount",getU32Encoder()],["tagScoresCount",getU32Encoder()],["timestamp",getI64Encoder()]])}function uP(){return getStructDecoder([["agent",getAddressDecoder()],["totalTags",getU32Decoder()],["skillTagsCount",getU32Decoder()],["behaviorTagsCount",getU32Decoder()],["complianceTagsCount",getU32Decoder()],["tagScoresCount",getU32Decoder()],["timestamp",getI64Decoder()]])}function K5(){return combineCodec(dP(),uP())}var gP=a(()=>{});function zc(){return getStructEncoder([["maxUsage",getU8Encoder()]])}function Oc(){return getStructDecoder([["maxUsage",getU8Decoder()]])}function Q5(){return combineCodec(zc(),Oc())}var AP=a(()=>{});function ji(){return getStructEncoder([["frequency",getI64Encoder()],["lastReview",getOptionEncoder(getI64Encoder())],["nextReview",getI64Encoder()],["reviewOwners",getArrayEncoder(getAddressEncoder())],["reviewCriteria",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function $i(){return getStructDecoder([["frequency",getI64Decoder()],["lastReview",getOptionDecoder(getI64Decoder())],["nextReview",getI64Decoder()],["reviewOwners",getArrayDecoder(getAddressDecoder())],["reviewCriteria",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function u9(){return combineCodec(ji(),$i())}var mP=a(()=>{});function Wc(){return getStructEncoder([["accepted",getBooleanEncoder()],["acceptingAuthority",getOptionEncoder(getAddressEncoder())],["acceptanceDate",getOptionEncoder(getI64Encoder())],["reasoning",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["reviewDate",getOptionEncoder(getI64Encoder())]])}function Nc(){return getStructDecoder([["accepted",getBooleanDecoder()],["acceptingAuthority",getOptionDecoder(getAddressDecoder())],["acceptanceDate",getOptionDecoder(getI64Decoder())],["reasoning",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["reviewDate",getOptionDecoder(getI64Decoder())]])}function P9(){return combineCodec(Wc(),Nc())}var fP=a(()=>{});function Gi(){return getStructEncoder([["riskScore",getU8Encoder()],["riskFactors",getArrayEncoder(Bc())],["mitigationMeasures",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["riskAcceptance",Wc()]])}function Wi(){return getStructDecoder([["riskScore",getU8Decoder()],["riskFactors",getArrayDecoder(Lc())],["mitigationMeasures",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["riskAcceptance",Nc()]])}function O9(){return combineCodec(Gi(),Wi())}var DP=a(()=>{m();});function Kc(){return getEnumEncoder(Vc)}function Hc(){return getEnumDecoder(Vc)}function N9(){return combineCodec(Kc(),Hc())}var Vc,hP=a(()=>{Vc=(d=>(d[d.Operational=0]="Operational",d[d.Financial=1]="Financial",d[d.Compliance=2]="Compliance",d[d.Security=3]="Security",d[d.Reputational=4]="Reputational",d[d.Technical=5]="Technical",d[d.Legal=6]="Legal",d))(Vc||{});});function Bc(){return getStructEncoder([["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["category",Kc()],["impact",getU8Encoder()],["likelihood",getU8Encoder()],["riskScore",getU8Encoder()]])}function Lc(){return getStructDecoder([["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["category",Hc()],["impact",getU8Decoder()],["likelihood",getU8Decoder()],["riskScore",getU8Decoder()]])}function Q9(){return combineCodec(Bc(),Lc())}var EP=a(()=>{m();});function Cc(){return getStructEncoder([["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["currentValue",getU64Encoder()],["thresholdValue",getU64Encoder()],["trend",jc()],["severity",qc()],["recommendedActions",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function bc(){return getStructDecoder([["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["currentValue",getU64Decoder()],["thresholdValue",getU64Decoder()],["trend",$c()],["severity",Jc()],["recommendedActions",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function nK(){return combineCodec(Cc(),bc())}var wP=a(()=>{m();});function Xc(){return getEnumEncoder(Qc)}function Zc(){return getEnumDecoder(Qc)}function cK(){return combineCodec(Xc(),Zc())}var Qc,UP=a(()=>{Qc=(r=>(r[r.Low=0]="Low",r[r.Medium=1]="Medium",r[r.High=2]="High",r[r.Critical=3]="Critical",r))(Qc||{});});function at(){return getStructEncoder([["roleId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["roleType",is()],["permissions",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["constraints",Yc()],["inheritsFrom",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["metadata",ts()],["status",rs()],["createdAt",getI64Encoder()],["modifiedAt",getI64Encoder()]])}function dt(){return getStructDecoder([["roleId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["roleType",cs()],["permissions",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["constraints",es()],["inheritsFrom",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["metadata",ns()],["status",os()],["createdAt",getI64Decoder()],["modifiedAt",getI64Decoder()]])}function uK(){return combineCodec(at(),dt())}var GP=a(()=>{m();});function Yc(){return getStructEncoder([["timeConstraints",getOptionEncoder(gs())],["locationConstraints",getOptionEncoder(No())],["resourceConstraints",getOptionEncoder(zc())],["sessionConstraints",getOptionEncoder(ss())],["sodConstraints",getArrayEncoder(ds())],["maxConcurrentSessions",getOptionEncoder(getU32Encoder())],["activationRequirements",getArrayEncoder(On())]])}function es(){return getStructDecoder([["timeConstraints",getOptionDecoder(As())],["locationConstraints",getOptionDecoder(Bo())],["resourceConstraints",getOptionDecoder(Oc())],["sessionConstraints",getOptionDecoder(as())],["sodConstraints",getArrayDecoder(us())],["maxConcurrentSessions",getOptionDecoder(getU32Decoder())],["activationRequirements",getArrayDecoder(Fn())]])}function yK(){return combineCodec(Yc(),es())}var BP=a(()=>{m();});function ts(){return getStructEncoder([["businessPurpose",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["riskLevel",Xc()],["dataAccessLevel",no()],["complianceRequirements",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["roleOwner",getOptionEncoder(getAddressEncoder())],["roleCustodian",getOptionEncoder(getAddressEncoder())],["reviewFrequency",getI64Encoder()],["lastReview",getOptionEncoder(getI64Encoder())],["nextReview",getOptionEncoder(getI64Encoder())]])}function ns(){return getStructDecoder([["businessPurpose",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["riskLevel",Zc()],["dataAccessLevel",ro()],["complianceRequirements",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["roleOwner",getOptionDecoder(getAddressDecoder())],["roleCustodian",getOptionDecoder(getAddressDecoder())],["reviewFrequency",getI64Decoder()],["lastReview",getOptionDecoder(getI64Decoder())],["nextReview",getOptionDecoder(getI64Decoder())]])}function hK(){return combineCodec(ts(),ns())}var QP=a(()=>{m();});function rs(){return getEnumEncoder(ms)}function os(){return getEnumDecoder(ms)}function bK(){return combineCodec(rs(),os())}var ms,XP=a(()=>{ms=(c=>(c[c.Active=0]="Active",c[c.Inactive=1]="Inactive",c[c.Deprecated=2]="Deprecated",c[c.UnderReview=3]="UnderReview",c[c.Suspended=4]="Suspended",c))(ms||{});});function is(){return getEnumEncoder(ys)}function cs(){return getEnumDecoder(ys)}function MK(){return combineCodec(is(),cs())}var ys,ZP=a(()=>{ys=(s=>(s[s.Administrative=0]="Administrative",s[s.Operational=1]="Operational",s[s.ReadOnly=2]="ReadOnly",s[s.Compliance=3]="Compliance",s[s.Emergency=4]="Emergency",s[s.Custom=5]="Custom",s[s.Service=6]="Service",s[s.Guest=7]="Guest",s))(ys||{});});function qi(){return getStructEncoder([["expression",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function Ji(){return getStructDecoder([["expression",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function NK(){return combineCodec(qi(),Ji())}var YP=a(()=>{});function Qi(){return getEnumEncoder(Ts)}function Xi(){return getEnumDecoder(Ts)}function KK(){return combineCodec(Qi(),Xi())}var Ts,eC=a(()=>{Ts=(i=>(i[i.Allow=0]="Allow",i[i.Deny=1]="Deny",i[i.AuditOnly=2]="AuditOnly",i[i.RequireApproval=3]="RequireApproval",i[i.RequireMfa=4]="RequireMfa",i[i.RequireJustification=5]="RequireJustification",i))(Ts||{});});function Ni(){return getStructEncoder([["includedResources",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["excludedResources",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["resourcePatterns",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["hierarchicalBoundaries",getArrayEncoder(Mo())]])}function Bi(){return getStructDecoder([["includedResources",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["excludedResources",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["resourcePatterns",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["hierarchicalBoundaries",getArrayDecoder(ko())]])}function qK(){return combineCodec(Ni(),Bi())}var tC=a(()=>{m();});function Zi(){return getEnumEncoder(xs)}function Yi(){return getEnumDecoder(xs)}function ZK(){return combineCodec(Zi(),Yi())}var xs,nC=a(()=>{xs=(r=>(r[r.None=0]="None",r[r.Hierarchical=1]="Hierarchical",r[r.Delegated=2]="Delegated",r[r.Inherited=3]="Inherited",r))(xs||{});});function Li(){return getEnumEncoder(Ds)}function Vi(){return getEnumDecoder(Ds)}function nH(){return combineCodec(Li(),Vi())}var Ds,rC=a(()=>{Ds=(i=>(i[i.Global=0]="Global",i[i.Organization=1]="Organization",i[i.Department=2]="Department",i[i.Project=3]="Project",i[i.Resource=4]="Resource",i[i.Individual=5]="Individual",i))(Ds||{});});function ii(){return getEnumEncoder(hs)}function ci(){return getEnumDecoder(hs)}function cH(){return combineCodec(ii(),ci())}var hs,oC=a(()=>{hs=(s=>(s[s.AccountLockout=0]="AccountLockout",s[s.PasswordChange=1]="PasswordChange",s[s.PrivilegeEscalation=2]="PrivilegeEscalation",s[s.SuspiciousActivity=3]="SuspiciousActivity",s[s.PolicyViolation=4]="PolicyViolation",s[s.AccessDenied=5]="AccessDenied",s[s.DataBreach=6]="DataBreach",s[s.SystemCompromise=7]="SystemCompromise",s))(hs||{});});function Es(){return getStructEncoder([["authentication",mr()],["authorization",Er()],["password",gi()],["session",Cs()],["dataProtection",oo()],["networkSecurity",$o()],["incidentResponse",wo()],["compliance",Or()]])}function Ps(){return getStructDecoder([["authentication",yr()],["authorization",Pr()],["password",Ai()],["session",bs()],["dataProtection",io()],["networkSecurity",qo()],["incidentResponse",Uo()],["compliance",Fr()]])}function uH(){return combineCodec(Es(),Ps())}var iC=a(()=>{m();});function me(){return getStructEncoder([["id",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["serviceType",Rs()],["serviceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]])}function ye(){return getStructDecoder([["id",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["serviceType",Is()],["serviceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function lH(){return combineCodec(me(),ye())}var cC=a(()=>{m();});function Rs(){return getEnumEncoder(vs)}function Is(){return getEnumDecoder(vs)}function fH(){return combineCodec(Rs(),Is())}var vs,sC=a(()=>{vs=(c=>(c[c.AIAgentService=0]="AIAgentService",c[c.DIDCommMessaging=1]="DIDCommMessaging",c[c.CredentialRepository=2]="CredentialRepository",c[c.LinkedDomains=3]="LinkedDomains",c[c.Custom=4]="Custom",c))(vs||{});});function ss(){return getStructEncoder([["maxSessionDuration",getI64Encoder()],["idleTimeout",getI64Encoder()],["reauthInterval",getI64Encoder()],["mfaRequired",getBooleanEncoder()],["deviceFingerprinting",getBooleanEncoder()],["sessionEncryption",getBooleanEncoder()]])}function as(){return getStructDecoder([["maxSessionDuration",getI64Decoder()],["idleTimeout",getI64Decoder()],["reauthInterval",getI64Decoder()],["mfaRequired",getBooleanDecoder()],["deviceFingerprinting",getBooleanDecoder()],["sessionEncryption",getBooleanDecoder()]])}function hH(){return combineCodec(ss(),as())}var aC=a(()=>{});function Cs(){return getStructEncoder([["maxSessionDuration",getI64Encoder()],["idleTimeout",getI64Encoder()],["concurrentSessions",getU8Encoder()]])}function bs(){return getStructDecoder([["maxSessionDuration",getI64Decoder()],["idleTimeout",getI64Decoder()],["concurrentSessions",getU8Decoder()]])}function IH(){return combineCodec(Cs(),bs())}var gC=a(()=>{});function Qe(){return getEnumEncoder(Ms)}function Xe(){return getEnumDecoder(Ms)}function wH(){return combineCodec(Qe(),Xe())}var Ms,AC=a(()=>{Ms=(o=>(o[o.Fraud=0]="Fraud",o[o.DisputeLoss=1]="DisputeLoss",o[o.Custom=2]="Custom",o))(Ms||{});});function ds(){return getStructEncoder([["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["conflictingRoles",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["constraintType",ks()],["enforcementLevel",je()],["exceptionProcedures",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function us(){return getStructDecoder([["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["conflictingRoles",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["constraintType",ws()],["enforcementLevel",$e()],["exceptionProcedures",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function OH(){return combineCodec(ds(),us())}var mC=a(()=>{m();});function ks(){return getEnumEncoder(Us)}function ws(){return getEnumDecoder(Us)}function NH(){return combineCodec(ks(),ws())}var Us,yC=a(()=>{Us=(r=>(r[r.Static=0]="Static",r[r.Dynamic=1]="Dynamic",r[r.Temporal=2]="Temporal",r[r.Contextual=3]="Contextual",r))(Us||{});});function SC(){return getStructEncoder([["agent",getAddressEncoder()],["sourceName",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["sourceScore",getU16Encoder()],["weightedAggregateScore",getU64Encoder()],["hasConflict",getBooleanEncoder()],["totalSources",getU32Encoder()],["timestamp",getI64Encoder()]])}function xC(){return getStructDecoder([["agent",getAddressDecoder()],["sourceName",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["sourceScore",getU16Decoder()],["weightedAggregateScore",getU64Decoder()],["hasConflict",getBooleanDecoder()],["totalSources",getU32Decoder()],["timestamp",getI64Decoder()]])}function o7(){return combineCodec(SC(),xC())}var DC=a(()=>{});function _s(){return getStructEncoder([["sourceName",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["score",getU16Encoder()],["weight",getU16Encoder()],["dataPoints",getU32Encoder()],["reliability",getU16Encoder()],["lastUpdated",getI64Encoder()]])}function zs(){return getStructDecoder([["sourceName",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["score",getU16Decoder()],["weight",getU16Decoder()],["dataPoints",getU32Decoder()],["reliability",getU16Decoder()],["lastUpdated",getI64Decoder()]])}function l7(){return combineCodec(_s(),zs())}var PC=a(()=>{});function Dr(){return getEnumEncoder(Os)}function hr(){return getEnumDecoder(Os)}function f7(){return combineCodec(Dr(),hr())}var Os,CC=a(()=>{Os=(d=>(d[d.HighRiskAction=0]="HighRiskAction",d[d.SensitiveData=1]="SensitiveData",d[d.LargeTransaction=2]="LargeTransaction",d[d.NewDevice=3]="NewDevice",d[d.UnusualLocation=4]="UnusualLocation",d[d.TimeBasedRisk=5]="TimeBasedRisk",d[d.BehaviorAnomaly=6]="BehaviorAnomaly",d))(Os||{});});function Fs(){return getStructEncoder([["submittedAt",getI64Encoder()],["regulatoryBody",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["submissionReference",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["acknowledged",getBooleanEncoder()],["acknowledgedAt",getOptionEncoder(getI64Encoder())],["regulatoryResponse",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function Gs(){return getStructDecoder([["submittedAt",getI64Decoder()],["regulatoryBody",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["submissionReference",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["acknowledged",getBooleanDecoder()],["acknowledgedAt",getOptionDecoder(getI64Decoder())],["regulatoryResponse",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function P7(){return combineCodec(Fs(),Gs())}var MC=a(()=>{});function UC(){return getStructEncoder([["agent",getAddressEncoder()],["tagsRemoved",getU32Encoder()],["remainingTags",getU32Encoder()],["timestamp",getI64Encoder()]])}function _C(){return getStructDecoder([["agent",getAddressDecoder()],["tagsRemoved",getU32Decoder()],["remainingTags",getU32Decoder()],["timestamp",getI64Decoder()]])}function w7(){return combineCodec(UC(),_C())}var zC=a(()=>{});function ut(){return getStructEncoder([["tagName",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["confidence",getU16Encoder()],["evidenceCount",getU32Encoder()],["lastUpdated",getI64Encoder()]])}function gt(){return getStructDecoder([["tagName",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["confidence",getU16Decoder()],["evidenceCount",getU32Decoder()],["lastUpdated",getI64Decoder()]])}function K7(){return combineCodec(ut(),gt())}var GC=a(()=>{});function BC(){return getStructEncoder([["agent",getAddressEncoder()],["oldTier",j()],["newTier",j()],["totalStaked",getU64Encoder()],["dailyApiCalls",getU32Encoder()],["votingPower",getU64Encoder()]])}function LC(){return getStructDecoder([["agent",getAddressDecoder()],["oldTier",$()],["newTier",$()],["totalStaked",getU64Decoder()],["dailyApiCalls",getU32Decoder()],["votingPower",getU64Decoder()]])}function Z7(){return combineCodec(BC(),LC())}var VC=a(()=>{m();});function gs(){return getStructEncoder([["allowedHours",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["allowedDays",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["timezone",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["maxSessionDuration",getOptionEncoder(getI64Encoder())],["expiresAt",getOptionEncoder(getI64Encoder())],["reactivationPeriod",getOptionEncoder(getI64Encoder())]])}function As(){return getStructDecoder([["allowedHours",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["allowedDays",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["timezone",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["maxSessionDuration",getOptionDecoder(getI64Decoder())],["expiresAt",getOptionDecoder(getI64Decoder())],["reactivationPeriod",getOptionDecoder(getI64Decoder())]])}function oj(){return combineCodec(gs(),As())}var jC=a(()=>{});function mi(){return getStructEncoder([["duration",getI64Encoder()],["lockedAt",getI64Encoder()],["unlocksAt",getI64Encoder()],["earlyUnlockConditions",getArrayEncoder(ge())],["lockType",Ws()],["cancellable",getBooleanEncoder()]])}function yi(){return getStructDecoder([["duration",getI64Decoder()],["lockedAt",getI64Decoder()],["unlocksAt",getI64Decoder()],["earlyUnlockConditions",getArrayDecoder(Ae())],["lockType",Ns()],["cancellable",getBooleanDecoder()]])}function Aj(){return combineCodec(mi(),yi())}var $C=a(()=>{m();});function Ws(){return getEnumEncoder(Bs)}function Ns(){return getEnumDecoder(Bs)}function yj(){return combineCodec(Ws(),Ns())}var Bs,qC=a(()=>{Bs=(r=>(r[r.Standard=0]="Standard",r[r.Vesting=1]="Vesting",r[r.Emergency=2]="Emergency",r[r.Governance=3]="Governance",r))(Bs||{});});function Ti(){return getEnumEncoder(Ls)}function fi(){return getEnumDecoder(Ls)}function xj(){return combineCodec(Ti(),fi())}var Ls,JC=a(()=>{Ls=(c=>(c[c.Low=0]="Low",c[c.Normal=1]="Normal",c[c.High=2]="High",c[c.Critical=3]="Critical",c[c.Emergency=4]="Emergency",c))(Ls||{});});function Si(){return getEnumEncoder(Vs)}function xi(){return getEnumDecoder(Vs)}function Pj(){return combineCodec(Si(),xi())}var Vs,QC=a(()=>{Vs=(d=>(d[d.Pending=0]="Pending",d[d.PartiallyApproved=1]="PartiallyApproved",d[d.FullyApproved=2]="FullyApproved",d[d.Executed=3]="Executed",d[d.Cancelled=4]="Cancelled",d[d.Expired=5]="Expired",d[d.Failed=6]="Failed",d))(Vs||{});});function Ke(){return getEnumEncoder(Ks)}function He(){return getEnumDecoder(Ks)}function Ij(){return combineCodec(Ke(),He())}var Ks,XC=a(()=>{Ks=(R=>(R[R.Transfer=0]="Transfer",R[R.Withdrawal=1]="Withdrawal",R[R.EscrowRelease=2]="EscrowRelease",R[R.ProposalCreation=3]="ProposalCreation",R[R.VoteExecution=4]="VoteExecution",R[R.ParameterUpdate=5]="ParameterUpdate",R[R.SignerAddition=6]="SignerAddition",R[R.SignerRemoval=7]="SignerRemoval",R[R.ThresholdUpdate=8]="ThresholdUpdate",R[R.ConfigUpdate=9]="ConfigUpdate",R[R.EmergencyFreeze=10]="EmergencyFreeze",R[R.EmergencyUnfreeze=11]="EmergencyUnfreeze",R[R.SecurityPolicyUpdate=12]="SecurityPolicyUpdate",R[R.ProtocolUpgrade=13]="ProtocolUpgrade",R[R.FeatureToggle=14]="FeatureToggle",R[R.RiskParameterUpdate=15]="RiskParameterUpdate",R[R.CustomInstruction=16]="CustomInstruction",R))(Ks||{});});function jc(){return getEnumEncoder(Hs)}function $c(){return getEnumDecoder(Hs)}function wj(){return combineCodec(jc(),$c())}var Hs,ZC=a(()=>{Hs=(r=>(r[r.Increasing=0]="Increasing",r[r.Decreasing=1]="Decreasing",r[r.Stable=2]="Stable",r[r.Unknown=3]="Unknown",r))(Hs||{});});function _n(){return getEnumEncoder(js)}function zn(){return getEnumDecoder(js)}function Oj(){return combineCodec(_n(),zn())}var js,YC=a(()=>{js=(c=>(c[c.TimeBasedAutoUnlock=0]="TimeBasedAutoUnlock",c[c.AdminUnlock=1]="AdminUnlock",c[c.SelfServiceUnlock=2]="SelfServiceUnlock",c[c.MultiFactorUnlock=3]="MultiFactorUnlock",c[c.SupervisorUnlock=4]="SupervisorUnlock",c))(js||{});});function $r(){return getEnumEncoder($s)}function qr(){return getEnumDecoder($s)}function Nj(){return combineCodec($r(),qr())}var $s,eb=a(()=>{$s=(s=>(s[s.String=0]="String",s[s.Number=1]="Number",s[s.Boolean=2]="Boolean",s[s.Date=3]="Date",s[s.Time=4]="Time",s[s.Duration=5]="Duration",s[s.List=6]="List",s[s.Object=7]="Object",s))($s||{});});function Te(){return getStructEncoder([["id",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["methodType",qs()],["controller",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["publicKeyMultibase",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["relationships",getArrayEncoder(Qs())],["createdAt",getI64Encoder()],["revoked",getBooleanEncoder()]])}function fe(){return getStructDecoder([["id",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["methodType",Js()],["controller",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["publicKeyMultibase",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["relationships",getArrayDecoder(Xs())],["createdAt",getI64Decoder()],["revoked",getBooleanDecoder()]])}function Qj(){return combineCodec(Te(),fe())}var tb=a(()=>{m();});function qs(){return getEnumEncoder(Zs)}function Js(){return getEnumDecoder(Zs)}function e$(){return combineCodec(qs(),Js())}var Zs,nb=a(()=>{Zs=(o=>(o[o.Ed25519VerificationKey2020=0]="Ed25519VerificationKey2020",o[o.X25519KeyAgreementKey2020=1]="X25519KeyAgreementKey2020",o[o.EcdsaSecp256k1VerificationKey2019=2]="EcdsaSecp256k1VerificationKey2019",o))(Zs||{});});function Qs(){return getEnumEncoder(Ys)}function Xs(){return getEnumDecoder(Ys)}function o$(){return combineCodec(Qs(),Xs())}var Ys,rb=a(()=>{Ys=(c=>(c[c.Authentication=0]="Authentication",c[c.AssertionMethod=1]="AssertionMethod",c[c.KeyAgreement=2]="KeyAgreement",c[c.CapabilityInvocation=3]="CapabilityInvocation",c[c.CapabilityDelegation=4]="CapabilityDelegation",c))(Ys||{});});function qc(){return getEnumEncoder(ea)}function Jc(){return getEnumDecoder(ea)}function a$(){return combineCodec(qc(),Jc())}var ea,ob=a(()=>{ea=(r=>(r[r.Low=0]="Low",r[r.Medium=1]="Medium",r[r.High=2]="High",r[r.Critical=3]="Critical",r))(ea||{});});function ta(){return getStructEncoder([["voter",getAddressEncoder()],["choice",ra()],["votingPower",getU64Encoder()],["votedAt",getI64Encoder()],["reasoning",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["delegationInfo",getOptionEncoder(so())]])}function na(){return getStructDecoder([["voter",getAddressDecoder()],["choice",oa()],["votingPower",getU64Decoder()],["votedAt",getI64Decoder()],["reasoning",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["delegationInfo",getOptionDecoder(ao())]])}function P$(){return combineCodec(ta(),na())}var sb=a(()=>{m();});function ra(){return getEnumEncoder(ia)}function oa(){return getEnumDecoder(ia)}function I$(){return combineCodec(ra(),oa())}var ia,ab=a(()=>{ia=(o=>(o[o.For=0]="For",o[o.Against=1]="Against",o[o.Abstain=2]="Abstain",o))(ia||{});});function aa(){return getStructEncoder([["votesFor",getU64Encoder()],["votesAgainst",getU64Encoder()],["votesAbstain",getU64Encoder()],["totalVotingPower",getU64Encoder()],["participationRate",getU8Encoder()],["individualVotes",getArrayEncoder(ta())],["weightedVoting",getBooleanEncoder()],["quorumReached",getBooleanEncoder()],["approvalThresholdMet",getBooleanEncoder()]])}function da(){return getStructDecoder([["votesFor",getU64Decoder()],["votesAgainst",getU64Decoder()],["votesAbstain",getU64Decoder()],["totalVotingPower",getU64Decoder()],["participationRate",getU8Decoder()],["individualVotes",getArrayDecoder(na())],["weightedVoting",getBooleanDecoder()],["quorumReached",getBooleanDecoder()],["approvalThresholdMet",getBooleanDecoder()]])}function O$(){return combineCodec(aa(),da())}var db=a(()=>{m();});var m=a(()=>{Wf();Lf();Vf();Kf();$f();Qf();Xf();nS();sS();aS();mS();xS();DS();hS();ES();PS();CS();IS();vS();_S();FS();GS();WS();NS();VS();jS();$S();qS();XS();ZS();YS();ex();tx();nx();rx();ax();dx();fx();Sx();bx();Rx();Ix();vx();Mx();kx();wx();Ux();Ox();Fx();Nx();Vx();jx();Jx();nD();rD();aD();mD();yD();SD();PD();kD();_D();FD();LD();HD();QD();rh();oh();sh();ah();gh();Ah();Th();Ph();Ch();Ih();vh();Mh();kh();wh();Uh();_h();zh();Gh();Vh();jh();$h();qh();tE();oE();sE();aE();dE();uE();gE();AE();mE();xE();EE();PE();Jg();kE();wE();zE();NE();BE();LE();VE();KE();HE();jE();$E();QE();YE();nP();sP();aP();gP();AP();mP();fP();DP();hP();EP();wP();UP();GP();BP();QP();XP();ZP();YP();eC();tC();nC();rC();oC();iC();cC();sC();aC();gC();AC();mC();yC();DC();PC();CC();MC();zC();GC();VC();jC();$C();qC();JC();QC();XC();ZC();YC();eb();tb();nb();rb();ob();sb();ab();db();});function q$(){return fixEncoderSize(getBytesEncoder(),8).encode(ep)}function lb(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["owner",getOptionEncoder(getAddressEncoder())],["status",Ln()],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["firstTxSignature",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["firstSeenTimestamp",getI64Encoder()],["discoverySource",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["claimedAt",getOptionEncoder(getI64Encoder())],["agentType",getU8Encoder()],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["capabilities",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["pricingModel",J()],["reputationScore",getU32Encoder()],["totalJobsCompleted",getU32Encoder()],["totalEarnings",getU64Encoder()],["isActive",getBooleanEncoder()],["createdAt",getI64Encoder()],["updatedAt",getI64Encoder()],["originalPrice",getU64Encoder()],["genomeHash",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["isReplicable",getBooleanEncoder()],["replicationFee",getU64Encoder()],["serviceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["isVerified",getBooleanEncoder()],["verificationTimestamp",getI64Encoder()],["metadataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["frameworkOrigin",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["supportedTokens",getArrayEncoder(getAddressEncoder())],["cnftMint",getOptionEncoder(getAddressEncoder())],["merkleTree",getOptionEncoder(getAddressEncoder())],["supportsA2a",getBooleanEncoder()],["transferHook",getOptionEncoder(getAddressEncoder())],["parentAgent",getOptionEncoder(getAddressEncoder())],["generation",getU32Encoder()],["x402Enabled",getBooleanEncoder()],["x402PaymentAddress",getAddressEncoder()],["x402AcceptedTokens",getArrayEncoder(getAddressEncoder())],["x402PricePerCall",getU64Encoder()],["x402ServiceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["x402TotalPayments",getU64Encoder()],["x402TotalCalls",getU64Encoder()],["lastPaymentTimestamp",getI64Encoder()],["externalIdentifiers",getArrayEncoder(ho())],["ghostScore",getU64Encoder()],["reputationComponents",getArrayEncoder(ct())],["didAddress",getOptionEncoder(getAddressEncoder())],["credentials",getArrayEncoder(getAddressEncoder())],["apiSpecUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["apiVersion",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["bump",getU8Encoder()]]),n=>({...n,discriminator:ep}))}function tp(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["owner",getOptionDecoder(getAddressDecoder())],["status",Vn()],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["firstTxSignature",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["firstSeenTimestamp",getI64Decoder()],["discoverySource",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["claimedAt",getOptionDecoder(getI64Decoder())],["agentType",getU8Decoder()],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["capabilities",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["pricingModel",Q()],["reputationScore",getU32Decoder()],["totalJobsCompleted",getU32Decoder()],["totalEarnings",getU64Decoder()],["isActive",getBooleanDecoder()],["createdAt",getI64Decoder()],["updatedAt",getI64Decoder()],["originalPrice",getU64Decoder()],["genomeHash",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["isReplicable",getBooleanDecoder()],["replicationFee",getU64Decoder()],["serviceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["isVerified",getBooleanDecoder()],["verificationTimestamp",getI64Decoder()],["metadataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["frameworkOrigin",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["supportedTokens",getArrayDecoder(getAddressDecoder())],["cnftMint",getOptionDecoder(getAddressDecoder())],["merkleTree",getOptionDecoder(getAddressDecoder())],["supportsA2a",getBooleanDecoder()],["transferHook",getOptionDecoder(getAddressDecoder())],["parentAgent",getOptionDecoder(getAddressDecoder())],["generation",getU32Decoder()],["x402Enabled",getBooleanDecoder()],["x402PaymentAddress",getAddressDecoder()],["x402AcceptedTokens",getArrayDecoder(getAddressDecoder())],["x402PricePerCall",getU64Decoder()],["x402ServiceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["x402TotalPayments",getU64Decoder()],["x402TotalCalls",getU64Decoder()],["lastPaymentTimestamp",getI64Decoder()],["externalIdentifiers",getArrayDecoder(Eo())],["ghostScore",getU64Decoder()],["reputationComponents",getArrayDecoder(st())],["didAddress",getOptionDecoder(getAddressDecoder())],["credentials",getArrayDecoder(getAddressDecoder())],["apiSpecUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["apiVersion",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["bump",getU8Decoder()]])}function J$(){return combineCodec(lb(),tp())}function np(n){return decodeAccount(n,tp())}async function Q$(n,e,t){let o=await mb(n,e,t);return assertAccountExists(o),o}async function mb(n,e,t){let o=await fetchEncodedAccount(n,e,t);return np(o)}async function X$(n,e,t){let o=await yb(n,e,t);return assertAccountsExist(o),o}async function yb(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>np(r))}var ep,Tb=a(()=>{m();ep=new Uint8Array([47,166,112,147,155,197,86,7]);});function mq(){return fixEncoderSize(getBytesEncoder(),8).encode(ip)}function Ib(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agent",getAddressEncoder()],["authorizedSource",getAddressEncoder()],["indexLimit",getU64Encoder()],["currentIndex",getU64Encoder()],["expiresAt",getI64Encoder()],["network",getU8Encoder()],["signature",fixEncoderSize(getBytesEncoder(),64)],["nonce",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["revoked",getBooleanEncoder()],["createdAt",getI64Encoder()],["lastUsedAt",getOptionEncoder(getI64Encoder())],["totalReputationChange",getI64Encoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:ip}))}function cp(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agent",getAddressDecoder()],["authorizedSource",getAddressDecoder()],["indexLimit",getU64Decoder()],["currentIndex",getU64Decoder()],["expiresAt",getI64Decoder()],["network",getU8Decoder()],["signature",fixDecoderSize(getBytesDecoder(),64)],["nonce",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["revoked",getBooleanDecoder()],["createdAt",getI64Decoder()],["lastUsedAt",getOptionDecoder(getI64Decoder())],["totalReputationChange",getI64Decoder()],["bump",getU8Decoder()]])}function yq(){return combineCodec(Ib(),cp())}function sp(n){return decodeAccount(n,cp())}async function Tq(n,e,t){let o=await vb(n,e,t);return assertAccountExists(o),o}async function vb(n,e,t){let o=await fetchEncodedAccount(n,e,t);return sp(o)}async function fq(n,e,t){let o=await Mb(n,e,t);return assertAccountsExist(o),o}async function Mb(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>sp(r))}var ip,kb=a(()=>{ip=new Uint8Array([30,249,165,44,155,194,188,175]);});function _q(){return fixEncoderSize(getBytesEncoder(),8).encode(ap)}function Ob(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["treeCreator",getAddressEncoder()],["treeDelegate",getAddressEncoder()],["numMinted",getU64Encoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:ap}))}function dp(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["treeCreator",getAddressDecoder()],["treeDelegate",getAddressDecoder()],["numMinted",getU64Decoder()],["bump",getU8Decoder()]])}function zq(){return combineCodec(Ob(),dp())}function up(n){return decodeAccount(n,dp())}async function Oq(n,e,t){let o=await Fb(n,e,t);return assertAccountExists(o),o}async function Fb(n,e,t){let o=await fetchEncodedAccount(n,e,t);return up(o)}async function Fq(n,e,t){let o=await Gb(n,e,t);return assertAccountsExist(o),o}async function Gb(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>up(r))}function Gq(){return 81}var ap,Wb=a(()=>{ap=new Uint8Array([145,145,156,0,197,232,130,245]);});function eJ(){return fixEncoderSize(getBytesEncoder(),8).encode(gp)}function jb(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agent",getAddressEncoder()],["verifier",getAddressEncoder()],["verificationData",Kn()],["createdAt",getI64Encoder()],["expiresAt",getI64Encoder()],["isActive",getBooleanEncoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:gp}))}function Ap(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agent",getAddressDecoder()],["verifier",getAddressDecoder()],["verificationData",Hn()],["createdAt",getI64Decoder()],["expiresAt",getI64Decoder()],["isActive",getBooleanDecoder()],["bump",getU8Decoder()]])}function tJ(){return combineCodec(jb(),Ap())}function pp(n){return decodeAccount(n,Ap())}async function nJ(n,e,t){let o=await $b(n,e,t);return assertAccountExists(o),o}async function $b(n,e,t){let o=await fetchEncodedAccount(n,e,t);return pp(o)}async function rJ(n,e,t){let o=await qb(n,e,t);return assertAccountsExist(o),o}async function qb(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>pp(r))}var gp,Jb=a(()=>{m();gp=new Uint8Array([128,155,95,241,66,207,166,59]);});function SJ(){return fixEncoderSize(getBytesEncoder(),8).encode(yp)}function eR(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["trailId",getU64Encoder()],["createdAt",getI64Encoder()],["updatedAt",getI64Encoder()],["version",getU8Encoder()],["entries",getArrayEncoder(ir())],["config",Ge()],["complianceStatus",Gr()],["hashChain",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["reserved",fixEncoderSize(getBytesEncoder(),128)]]),n=>({...n,discriminator:yp}))}function Tp(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["trailId",getU64Decoder()],["createdAt",getI64Decoder()],["updatedAt",getI64Decoder()],["version",getU8Decoder()],["entries",getArrayDecoder(cr())],["config",We()],["complianceStatus",Wr()],["hashChain",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["reserved",fixDecoderSize(getBytesDecoder(),128)]])}function xJ(){return combineCodec(eR(),Tp())}function fp(n){return decodeAccount(n,Tp())}async function DJ(n,e,t){let o=await tR(n,e,t);return assertAccountExists(o),o}async function tR(n,e,t){let o=await fetchEncodedAccount(n,e,t);return fp(o)}async function hJ(n,e,t){let o=await nR(n,e,t);return assertAccountsExist(o),o}async function nR(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>fp(r))}var yp,rR=a(()=>{m();yp=new Uint8Array([171,223,253,181,134,88,66,26]);});function NJ(){return fixEncoderSize(getBytesEncoder(),8).encode(Dp)}function lR(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authorization",getAddressEncoder()],["agent",getAddressEncoder()],["authorizedSource",getAddressEncoder()],["usageIndex",getU64Encoder()],["reputationChange",getI64Encoder()],["usedAt",getI64Encoder()],["transactionSignature",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["metadata",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["bump",getU8Encoder()]]),n=>({...n,discriminator:Dp}))}function hp(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authorization",getAddressDecoder()],["agent",getAddressDecoder()],["authorizedSource",getAddressDecoder()],["usageIndex",getU64Decoder()],["reputationChange",getI64Decoder()],["usedAt",getI64Decoder()],["transactionSignature",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["metadata",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["bump",getU8Decoder()]])}function BJ(){return combineCodec(lR(),hp())}function Ep(n){return decodeAccount(n,hp())}async function LJ(n,e,t){let o=await mR(n,e,t);return assertAccountExists(o),o}async function mR(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Ep(o)}async function VJ(n,e,t){let o=await yR(n,e,t);return assertAccountsExist(o),o}async function yR(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Ep(r))}var Dp,TR=a(()=>{Dp=new Uint8Array([109,102,102,17,210,84,85,210]);});function rQ(){return fixEncoderSize(getBytesEncoder(),8).encode(Ip)}function fR(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["reportId",getU64Encoder()],["reportType",se()],["generatedAt",getI64Encoder()],["periodStart",getI64Encoder()],["periodEnd",getI64Encoder()],["reportData",Sc()],["signature",fixEncoderSize(getBytesEncoder(),64)],["status",vc()],["submissionDetails",getOptionEncoder(Fs())],["reserved",fixEncoderSize(getBytesEncoder(),64)]]),n=>({...n,discriminator:Ip}))}function vp(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["reportId",getU64Decoder()],["reportType",ae()],["generatedAt",getI64Decoder()],["periodStart",getI64Decoder()],["periodEnd",getI64Decoder()],["reportData",xc()],["signature",fixDecoderSize(getBytesDecoder(),64)],["status",Mc()],["submissionDetails",getOptionDecoder(Gs())],["reserved",fixDecoderSize(getBytesDecoder(),64)]])}function oQ(){return combineCodec(fR(),vp())}function Mp(n){return decodeAccount(n,vp())}async function iQ(n,e,t){let o=await SR(n,e,t);return assertAccountExists(o),o}async function SR(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Mp(o)}async function cQ(n,e,t){let o=await xR(n,e,t);return assertAccountsExist(o),o}async function xR(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Mp(r))}var Ip,DR=a(()=>{m();Ip=new Uint8Array([75,146,78,26,130,240,228,35]);});function fQ(){return fixEncoderSize(getBytesEncoder(),8).encode(Bp)}function hR(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["template",getAddressEncoder()],["subject",getAddressEncoder()],["issuer",getAddressEncoder()],["credentialId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["subjectDataHash",fixEncoderSize(getBytesEncoder(),32)],["subjectDataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["status",Zr()],["signature",fixEncoderSize(getBytesEncoder(),64)],["issuedAt",getI64Encoder()],["expiresAt",getOptionEncoder(getI64Encoder())],["revokedAt",getOptionEncoder(getI64Encoder())],["crossChainStatus",Le()],["crossmintCredentialId",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["sourceAccount",getOptionEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),n=>({...n,discriminator:Bp}))}function Lp(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["template",getAddressDecoder()],["subject",getAddressDecoder()],["issuer",getAddressDecoder()],["credentialId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["subjectDataHash",fixDecoderSize(getBytesDecoder(),32)],["subjectDataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["status",Yr()],["signature",fixDecoderSize(getBytesDecoder(),64)],["issuedAt",getI64Decoder()],["expiresAt",getOptionDecoder(getI64Decoder())],["revokedAt",getOptionDecoder(getI64Decoder())],["crossChainStatus",Ve()],["crossmintCredentialId",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["sourceAccount",getOptionDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function SQ(){return combineCodec(hR(),Lp())}function Vp(n){return decodeAccount(n,Lp())}async function xQ(n,e,t){let o=await ER(n,e,t);return assertAccountExists(o),o}async function ER(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Vp(o)}async function DQ(n,e,t){let o=await PR(n,e,t);return assertAccountsExist(o),o}async function PR(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Vp(r))}var Bp,CR=a(()=>{m();Bp=new Uint8Array([145,44,68,220,67,46,100,135]);});function VQ(){return fixEncoderSize(getBytesEncoder(),8).encode(Qp)}function MR(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["credentialType",getAddressEncoder()],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["imageUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["issuer",getAddressEncoder()],["isActive",getBooleanEncoder()],["totalIssued",getU64Encoder()],["createdAt",getI64Encoder()],["crossmintTemplateId",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["bump",getU8Encoder()]]),n=>({...n,discriminator:Qp}))}function Xp(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["credentialType",getAddressDecoder()],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["imageUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["issuer",getAddressDecoder()],["isActive",getBooleanDecoder()],["totalIssued",getU64Decoder()],["createdAt",getI64Decoder()],["crossmintTemplateId",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["bump",getU8Decoder()]])}function KQ(){return combineCodec(MR(),Xp())}function Zp(n){return decodeAccount(n,Xp())}async function HQ(n,e,t){let o=await kR(n,e,t);return assertAccountExists(o),o}async function kR(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Zp(o)}async function jQ(n,e,t){let o=await wR(n,e,t);return assertAccountsExist(o),o}async function wR(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Zp(r))}var Qp,UR=a(()=>{Qp=new Uint8Array([229,129,99,91,179,207,66,75]);});function lX(){return fixEncoderSize(getBytesEncoder(),8).encode(il)}function OR(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["kind",Ne()],["schemaUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["isActive",getBooleanEncoder()],["totalIssued",getU64Encoder()],["createdAt",getI64Encoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:il}))}function cl(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["kind",Be()],["schemaUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["isActive",getBooleanDecoder()],["totalIssued",getU64Decoder()],["createdAt",getI64Decoder()],["bump",getU8Decoder()]])}function mX(){return combineCodec(OR(),cl())}function sl(n){return decodeAccount(n,cl())}async function yX(n,e,t){let o=await FR(n,e,t);return assertAccountExists(o),o}async function FR(n,e,t){let o=await fetchEncodedAccount(n,e,t);return sl(o)}async function TX(n,e,t){let o=await GR(n,e,t);return assertAccountsExist(o),o}async function GR(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>sl(r))}var il,WR=a(()=>{m();il=new Uint8Array([132,171,20,181,39,219,217,112]);});function FX(){return fixEncoderSize(getBytesEncoder(),8).encode(ll)}function LR(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["did",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["controller",getAddressEncoder()],["verificationMethods",getArrayEncoder(Te())],["serviceEndpoints",getArrayEncoder(me())],["context",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["alsoKnownAs",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["createdAt",getI64Encoder()],["updatedAt",getI64Encoder()],["version",getU32Encoder()],["deactivated",getBooleanEncoder()],["deactivatedAt",getOptionEncoder(getI64Encoder())],["bump",getU8Encoder()]]),n=>({...n,discriminator:ll}))}function ml(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["did",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["controller",getAddressDecoder()],["verificationMethods",getArrayDecoder(fe())],["serviceEndpoints",getArrayDecoder(ye())],["context",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["alsoKnownAs",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["createdAt",getI64Decoder()],["updatedAt",getI64Decoder()],["version",getU32Decoder()],["deactivated",getBooleanDecoder()],["deactivatedAt",getOptionDecoder(getI64Decoder())],["bump",getU8Decoder()]])}function GX(){return combineCodec(LR(),ml())}function yl(n){return decodeAccount(n,ml())}async function WX(n,e,t){let o=await VR(n,e,t);return assertAccountExists(o),o}async function VR(n,e,t){let o=await fetchEncodedAccount(n,e,t);return yl(o)}async function NX(n,e,t){let o=await KR(n,e,t);return assertAccountsExist(o),o}async function KR(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>yl(r))}var ll,HR=a(()=>{m();ll=new Uint8Array([109,220,168,224,33,173,192,166]);});function cZ(){return fixEncoderSize(getBytesEncoder(),8).encode(Tl)}function nI(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["ghostPubkey",getAddressEncoder()],["platform",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["externalId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["createdAt",getI64Encoder()],["verified",getBooleanEncoder()],["verifiedAt",getOptionEncoder(getI64Encoder())],["bump",getU8Encoder()]]),n=>({...n,discriminator:Tl}))}function fl(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["ghostPubkey",getAddressDecoder()],["platform",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["externalId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["createdAt",getI64Decoder()],["verified",getBooleanDecoder()],["verifiedAt",getOptionDecoder(getI64Decoder())],["bump",getU8Decoder()]])}function sZ(){return combineCodec(nI(),fl())}function Sl(n){return decodeAccount(n,fl())}async function aZ(n,e,t){let o=await rI(n,e,t);return assertAccountExists(o),o}async function rI(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Sl(o)}async function dZ(n,e,t){let o=await oI(n,e,t);return assertAccountsExist(o),o}async function oI(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Sl(r))}var Tl,iI=a(()=>{Tl=new Uint8Array([180,218,64,128,181,84,116,180]);});function EZ(){return fixEncoderSize(getBytesEncoder(),8).encode(Ml)}function uI(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["escrowId",getU64Encoder()],["client",getAddressEncoder()],["agent",getAddressEncoder()],["amount",getU64Encoder()],["tokenMint",getAddressEncoder()],["status",fo()],["jobDescription",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["deliveryProof",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["deadline",getI64Encoder()],["createdAt",getI64Encoder()],["completedAt",getOptionEncoder(getI64Encoder())],["disputeReason",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["arbitratorDecision",getOptionEncoder(ie())],["bump",getU8Encoder()]]),n=>({...n,discriminator:Ml}))}function kl(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["escrowId",getU64Decoder()],["client",getAddressDecoder()],["agent",getAddressDecoder()],["amount",getU64Decoder()],["tokenMint",getAddressDecoder()],["status",So()],["jobDescription",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["deliveryProof",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["deadline",getI64Decoder()],["createdAt",getI64Decoder()],["completedAt",getOptionDecoder(getI64Decoder())],["disputeReason",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["arbitratorDecision",getOptionDecoder(ce())],["bump",getU8Decoder()]])}function PZ(){return combineCodec(uI(),kl())}function wl(n){return decodeAccount(n,kl())}async function CZ(n,e,t){let o=await gI(n,e,t);return assertAccountExists(o),o}async function gI(n,e,t){let o=await fetchEncodedAccount(n,e,t);return wl(o)}async function bZ(n,e,t){let o=await AI(n,e,t);return assertAccountsExist(o),o}async function AI(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>wl(r))}var Ml,pI=a(()=>{m();Ml=new Uint8Array([38,0,98,160,102,4,51,160]);});function LZ(){return fixEncoderSize(getBytesEncoder(),8).encode(zl)}function hI(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["proposalId",getU64Encoder()],["proposer",getAddressEncoder()],["title",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["proposalType",de()],["createdAt",getI64Encoder()],["votingStartsAt",getI64Encoder()],["votingEndsAt",getI64Encoder()],["executionTimestamp",getOptionEncoder(getI64Encoder())],["status",dc()],["votingResults",aa()],["executionParams",qe()],["quorumRequirements",lc()],["metadata",cc()],["reserved",fixEncoderSize(getBytesEncoder(),64)]]),n=>({...n,discriminator:zl}))}function Ol(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["proposalId",getU64Decoder()],["proposer",getAddressDecoder()],["title",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["proposalType",ue()],["createdAt",getI64Decoder()],["votingStartsAt",getI64Decoder()],["votingEndsAt",getI64Decoder()],["executionTimestamp",getOptionDecoder(getI64Decoder())],["status",uc()],["votingResults",da()],["executionParams",Je()],["quorumRequirements",mc()],["metadata",sc()],["reserved",fixDecoderSize(getBytesDecoder(),64)]])}function VZ(){return combineCodec(hI(),Ol())}function Fl(n){return decodeAccount(n,Ol())}async function KZ(n,e,t){let o=await EI(n,e,t);return assertAccountExists(o),o}async function EI(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Fl(o)}async function HZ(n,e,t){let o=await PI(n,e,t);return assertAccountsExist(o),o}async function PI(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Fl(r))}var zl,CI=a(()=>{m();zl=new Uint8Array([53,107,240,190,43,73,65,143]);});function rY(){return fixEncoderSize(getBytesEncoder(),8).encode(Nl)}function OI(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["multisigId",getU64Encoder()],["multisigType",pe()],["threshold",getU8Encoder()],["signers",getArrayEncoder(getAddressEncoder())],["owner",getAddressEncoder()],["createdAt",getI64Encoder()],["updatedAt",getI64Encoder()],["nonce",getU64Encoder()],["pendingTransactions",getArrayEncoder(pi())],["config",Ze()],["emergencyConfig",lo()],["typeConfig",Ho()],["reserved",fixEncoderSize(getBytesEncoder(),64)]]),n=>({...n,discriminator:Nl}))}function Bl(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multisigId",getU64Decoder()],["multisigType",le()],["threshold",getU8Decoder()],["signers",getArrayDecoder(getAddressDecoder())],["owner",getAddressDecoder()],["createdAt",getI64Decoder()],["updatedAt",getI64Decoder()],["nonce",getU64Decoder()],["pendingTransactions",getArrayDecoder(li())],["config",Ye()],["emergencyConfig",mo()],["typeConfig",jo()],["reserved",fixDecoderSize(getBytesDecoder(),64)]])}function oY(){return combineCodec(OI(),Bl())}function Ll(n){return decodeAccount(n,Bl())}async function iY(n,e,t){let o=await FI(n,e,t);return assertAccountExists(o),o}async function FI(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Ll(o)}async function cY(n,e,t){let o=await GI(n,e,t);return assertAccountsExist(o),o}async function GI(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Ll(r))}var Nl,WI=a(()=>{m();Nl=new Uint8Array([224,116,121,186,68,161,79,236]);});function hY(){return fixEncoderSize(getBytesEncoder(),8).encode(Hl)}function jI(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["treasury",getAddressEncoder()],["buybackPool",getAddressEncoder()],["moderatorPool",getAddressEncoder()],["escrowFeeBps",getU16Encoder()],["agentRegistrationFee",getU64Encoder()],["listingFee",getU64Encoder()],["disputeFeeBps",getU16Encoder()],["feesEnabled",getBooleanEncoder()],["updatedAt",getI64Encoder()],["bump",getU8Encoder()],["reserved",fixEncoderSize(getBytesEncoder(),64)]]),n=>({...n,discriminator:Hl}))}function jl(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["treasury",getAddressDecoder()],["buybackPool",getAddressDecoder()],["moderatorPool",getAddressDecoder()],["escrowFeeBps",getU16Decoder()],["agentRegistrationFee",getU64Decoder()],["listingFee",getU64Decoder()],["disputeFeeBps",getU16Decoder()],["feesEnabled",getBooleanDecoder()],["updatedAt",getI64Decoder()],["bump",getU8Decoder()],["reserved",fixDecoderSize(getBytesDecoder(),64)]])}function EY(){return combineCodec(jI(),jl())}function $l(n){return decodeAccount(n,jl())}async function PY(n,e,t){let o=await $I(n,e,t);return assertAccountExists(o),o}async function $I(n,e,t){let o=await fetchEncodedAccount(n,e,t);return $l(o)}async function CY(n,e,t){let o=await qI(n,e,t);return assertAccountsExist(o),o}async function qI(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>$l(r))}function bY(){return 230}var Hl,JI=a(()=>{Hl=new Uint8Array([207,91,250,28,152,179,215,209]);});function NY(){return fixEncoderSize(getBytesEncoder(),8).encode(Zl)}function ev(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["createdAt",getI64Encoder()],["updatedAt",getI64Encoder()],["version",getU8Encoder()],["roles",getArrayEncoder(at())],["permissions",getArrayEncoder(Ri())],["accessPolicies",getArrayEncoder(Tn())],["securityPolicies",Es()],["auditConfig",mn()],["emergencyAccess",Ao()],["reserved",fixEncoderSize(getBytesEncoder(),128)]]),n=>({...n,discriminator:Zl}))}function Yl(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["createdAt",getI64Decoder()],["updatedAt",getI64Decoder()],["version",getU8Decoder()],["roles",getArrayDecoder(dt())],["permissions",getArrayDecoder(Ii())],["accessPolicies",getArrayDecoder(fn())],["securityPolicies",Ps()],["auditConfig",yn()],["emergencyAccess",po()],["reserved",fixDecoderSize(getBytesDecoder(),128)]])}function BY(){return combineCodec(ev(),Yl())}function em(n){return decodeAccount(n,Yl())}async function LY(n,e,t){let o=await tv(n,e,t);return assertAccountExists(o),o}async function tv(n,e,t){let o=await fetchEncodedAccount(n,e,t);return em(o)}async function VY(n,e,t){let o=await nv(n,e,t);return assertAccountsExist(o),o}async function nv(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>em(r))}var Zl,rv=a(()=>{m();Zl=new Uint8Array([177,94,184,202,221,112,110,38]);});function dee(){return fixEncoderSize(getBytesEncoder(),8).encode(tm)}function cv(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["state",Tc()],["nonce",getU64Encoder()],["lastInteraction",getI64Encoder()],["authority",getAddressEncoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:tm}))}function nm(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["state",fc()],["nonce",getU64Decoder()],["lastInteraction",getI64Decoder()],["authority",getAddressDecoder()],["bump",getU8Decoder()]])}function uee(){return combineCodec(cv(),nm())}function rm(n){return decodeAccount(n,nm())}async function gee(n,e,t){let o=await sv(n,e,t);return assertAccountExists(o),o}async function sv(n,e,t){let o=await fetchEncodedAccount(n,e,t);return rm(o)}async function Aee(n,e,t){let o=await av(n,e,t);return assertAccountsExist(o),o}async function av(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>rm(r))}function pee(){return 58}var tm,dv=a(()=>{m();tm=new Uint8Array([207,227,141,11,194,21,193,32]);});function vee(){return fixEncoderSize(getBytesEncoder(),8).encode(om)}function Av(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agent",getAddressEncoder()],["successfulPayments",getU64Encoder()],["failedPayments",getU64Encoder()],["totalResponseTime",getU64Encoder()],["responseTimeCount",getU64Encoder()],["totalDisputes",getU32Encoder()],["disputesResolved",getU32Encoder()],["totalRating",getU32Encoder()],["totalRatingsCount",getU32Encoder()],["paymentHistory7d",getArrayEncoder(getU64Encoder(),{size:7})],["createdAt",getI64Encoder()],["updatedAt",getI64Encoder()],["skillTags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["behaviorTags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["complianceTags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["tagScores",getArrayEncoder(ut())],["tagUpdatedAt",getI64Encoder()],["sourceScores",getArrayEncoder(_s())],["primarySource",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["lastAggregation",getI64Encoder()],["conflictFlags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["bump",getU8Encoder()]]),n=>({...n,discriminator:om}))}function im(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agent",getAddressDecoder()],["successfulPayments",getU64Decoder()],["failedPayments",getU64Decoder()],["totalResponseTime",getU64Decoder()],["responseTimeCount",getU64Decoder()],["totalDisputes",getU32Decoder()],["disputesResolved",getU32Decoder()],["totalRating",getU32Decoder()],["totalRatingsCount",getU32Decoder()],["paymentHistory7d",getArrayDecoder(getU64Decoder(),{size:7})],["createdAt",getI64Decoder()],["updatedAt",getI64Decoder()],["skillTags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["behaviorTags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["complianceTags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["tagScores",getArrayDecoder(gt())],["tagUpdatedAt",getI64Decoder()],["sourceScores",getArrayDecoder(zs())],["primarySource",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["lastAggregation",getI64Decoder()],["conflictFlags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["bump",getU8Decoder()]])}function Mee(){return combineCodec(Av(),im())}function cm(n){return decodeAccount(n,im())}async function kee(n,e,t){let o=await pv(n,e,t);return assertAccountExists(o),o}async function pv(n,e,t){let o=await fetchEncodedAccount(n,e,t);return cm(o)}async function wee(n,e,t){let o=await lv(n,e,t);return assertAccountsExist(o),o}async function lv(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>cm(r))}var om,mv=a(()=>{m();om=new Uint8Array([8,160,71,30,66,150,108,33]);});function Zee(){return fixEncoderSize(getBytesEncoder(),8).encode(dm)}function xv(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["owner",getAddressEncoder()],["amountStaked",getU64Encoder()],["stakedAt",getI64Encoder()],["lockDuration",getI64Encoder()],["unlockAt",getI64Encoder()],["reputationBoostBps",getU16Encoder()],["hasVerifiedBadge",getBooleanEncoder()],["hasPremiumBenefits",getBooleanEncoder()],["totalSlashed",getU64Encoder()],["tier",j()],["apiCallsRemaining",getU32Encoder()],["lastQuotaReset",getI64Encoder()],["votingPower",getU64Encoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:dm}))}function um(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["owner",getAddressDecoder()],["amountStaked",getU64Decoder()],["stakedAt",getI64Decoder()],["lockDuration",getI64Decoder()],["unlockAt",getI64Decoder()],["reputationBoostBps",getU16Decoder()],["hasVerifiedBadge",getBooleanDecoder()],["hasPremiumBenefits",getBooleanDecoder()],["totalSlashed",getU64Decoder()],["tier",$()],["apiCallsRemaining",getU32Decoder()],["lastQuotaReset",getI64Decoder()],["votingPower",getU64Decoder()],["bump",getU8Decoder()]])}function Yee(){return combineCodec(xv(),um())}function gm(n){return decodeAccount(n,um())}async function ete(n,e,t){let o=await Dv(n,e,t);return assertAccountExists(o),o}async function Dv(n,e,t){let o=await fetchEncodedAccount(n,e,t);return gm(o)}async function tte(n,e,t){let o=await hv(n,e,t);return assertAccountsExist(o),o}async function hv(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>gm(r))}function nte(){return 106}var dm,Ev=a(()=>{m();dm=new Uint8Array([52,178,251,157,180,186,98,234]);});function xte(){return fixEncoderSize(getBytesEncoder(),8).encode(Am)}function Mv(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["minStake",getU64Encoder()],["minLockDuration",getI64Encoder()],["fraudSlashBps",getU16Encoder()],["disputeSlashBps",getU16Encoder()],["treasury",getAddressEncoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:Am}))}function pm(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["minStake",getU64Decoder()],["minLockDuration",getI64Decoder()],["fraudSlashBps",getU16Decoder()],["disputeSlashBps",getU16Decoder()],["treasury",getAddressDecoder()],["bump",getU8Decoder()]])}function Dte(){return combineCodec(Mv(),pm())}function lm(n){return decodeAccount(n,pm())}async function hte(n,e,t){let o=await kv(n,e,t);return assertAccountExists(o),o}async function kv(n,e,t){let o=await fetchEncodedAccount(n,e,t);return lm(o)}async function Ete(n,e,t){let o=await wv(n,e,t);return assertAccountsExist(o),o}async function wv(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>lm(r))}function Pte(){return 93}var Am,Uv=a(()=>{Am=new Uint8Array([45,134,252,82,37,57,84,25]);});function Kte(){return fixEncoderSize(getBytesEncoder(),8).encode(mm)}function Ov(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["user",getAddressEncoder()],["agentCount",getU16Encoder()],["listingCount",getU16Encoder()],["workOrderCount",getU16Encoder()],["channelCount",getU16Encoder()],["totalVolumeTraded",getU64Encoder()],["lastActivity",getI64Encoder()],["createdAt",getI64Encoder()],["isRateLimited",getBooleanEncoder()],["rateLimitExpiry",getI64Encoder()],["lastExtensionRegistration",getI64Encoder()],["lastDisputeFiling",getI64Encoder()],["lastEvidenceSubmission",getI64Encoder()],["lastBatchExecution",getI64Encoder()],["lastDashboardUpdate",getI64Encoder()],["lastBulkDealCreation",getI64Encoder()],["lastDashboardCreation",getI64Encoder()],["bump",getU8Encoder()]]),n=>({...n,discriminator:mm}))}function ym(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["user",getAddressDecoder()],["agentCount",getU16Decoder()],["listingCount",getU16Decoder()],["workOrderCount",getU16Decoder()],["channelCount",getU16Decoder()],["totalVolumeTraded",getU64Decoder()],["lastActivity",getI64Decoder()],["createdAt",getI64Decoder()],["isRateLimited",getBooleanDecoder()],["rateLimitExpiry",getI64Decoder()],["lastExtensionRegistration",getI64Decoder()],["lastDisputeFiling",getI64Decoder()],["lastEvidenceSubmission",getI64Decoder()],["lastBatchExecution",getI64Decoder()],["lastDashboardUpdate",getI64Decoder()],["lastBulkDealCreation",getI64Decoder()],["lastDashboardCreation",getI64Decoder()],["bump",getU8Decoder()]])}function Hte(){return combineCodec(Ov(),ym())}function Tm(n){return decodeAccount(n,ym())}async function jte(n,e,t){let o=await Fv(n,e,t);return assertAccountExists(o),o}async function Fv(n,e,t){let o=await fetchEncodedAccount(n,e,t);return Tm(o)}async function $te(n,e,t){let o=await Gv(n,e,t);return assertAccountsExist(o),o}async function Gv(n,e,t){return (await fetchEncodedAccounts(n,e,t)).map(r=>Tm(r))}function qte(){return 138}var mm,Wv=a(()=>{mm=new Uint8Array([37,84,98,14,130,63,210,138]);});var Nv=a(()=>{Tb();kb();Wb();Jb();rR();TR();DR();CR();UR();WR();HR();iI();pI();CI();WI();JI();rv();dv();mv();Ev();Uv();Wv();});function Jte(n){let e="data"in n?n.data:n;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([47,166,112,147,155,197,86,7])),0))return 0;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([30,249,165,44,155,194,188,175])),0))return 1;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([145,145,156,0,197,232,130,245])),0))return 2;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([128,155,95,241,66,207,166,59])),0))return 3;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([171,223,253,181,134,88,66,26])),0))return 4;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([109,102,102,17,210,84,85,210])),0))return 5;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([75,146,78,26,130,240,228,35])),0))return 6;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([145,44,68,220,67,46,100,135])),0))return 7;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([229,129,99,91,179,207,66,75])),0))return 8;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([132,171,20,181,39,219,217,112])),0))return 9;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([109,220,168,224,33,173,192,166])),0))return 10;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([180,218,64,128,181,84,116,180])),0))return 11;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([38,0,98,160,102,4,51,160])),0))return 12;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([53,107,240,190,43,73,65,143])),0))return 13;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([224,116,121,186,68,161,79,236])),0))return 14;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([207,91,250,28,152,179,215,209])),0))return 15;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([177,94,184,202,221,112,110,38])),0))return 16;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([207,227,141,11,194,21,193,32])),0))return 17;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([8,160,71,30,66,150,108,33])),0))return 18;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([52,178,251,157,180,186,98,234])),0))return 19;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([45,134,252,82,37,57,84,25])),0))return 20;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([37,84,98,14,130,63,210,138])),0))return 21;throw new Error("The provided account could not be identified as a ghostspeakMarketplace account.")}function Qte(n){let e="data"in n?n.data:n;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([252,139,87,21,195,152,29,217])),0))return 0;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([28,233,51,115,33,220,41,28])),0))return 1;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([225,89,166,101,215,40,191,4])),0))return 2;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([50,170,232,73,238,200,180,16])),0))return 3;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([149,107,35,233,252,101,148,225])),0))return 4;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([48,219,232,202,151,97,230,20])),0))return 5;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([183,109,12,128,134,8,139,144])),0))return 6;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([211,208,67,175,20,248,8,227])),0))return 7;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([253,40,200,239,69,147,82,182])),0))return 8;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([253,215,165,116,36,108,68,80])),0))return 9;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([148,146,240,10,226,215,167,174])),0))return 10;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([205,171,239,225,82,126,96,166])),0))return 11;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([177,8,195,104,56,34,84,162])),0))return 12;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([110,174,221,244,36,206,60,237])),0))return 13;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([77,13,56,161,67,155,206,119])),0))return 14;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([9,115,79,19,158,209,221,38])),0))return 15;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([210,63,221,114,212,97,195,156])),0))return 16;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([213,97,79,234,22,228,14,32])),0))return 17;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([156,109,115,85,12,60,245,99])),0))return 18;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([145,182,236,249,212,17,175,161])),0))return 19;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([137,84,234,206,17,58,54,215])),0))return 20;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([28,50,43,233,244,98,123,118])),0))return 21;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([215,68,129,228,237,165,0,240])),0))return 22;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([228,11,207,44,52,188,169,237])),0))return 23;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([78,164,6,115,206,48,168,105])),0))return 24;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([255,193,171,224,68,171,194,87])),0))return 25;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([156,102,141,155,175,13,29,86])),0))return 26;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([164,219,91,38,45,31,33,47])),0))return 27;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([165,202,159,139,65,65,36,163])),0))return 28;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([135,157,66,195,2,113,175,30])),0))return 29;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([15,6,94,55,65,80,123,248])),0))return 30;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([34,233,111,236,212,22,26,254])),0))return 31;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([93,74,168,125,46,153,9,255])),0))return 32;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([168,180,218,211,184,19,102,12])),0))return 33;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([222,179,207,59,191,78,24,248])),0))return 34;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([38,123,95,95,223,158,169,87])),0))return 35;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([190,242,137,27,41,18,233,37])),0))return 36;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([5,196,24,54,196,56,173,191])),0))return 37;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([217,177,33,54,136,185,123,96])),0))return 38;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([23,160,228,88,168,145,129,19])),0))return 39;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([252,101,172,252,1,4,12,116])),0))return 40;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([85,2,178,9,119,139,102,164])),0))return 41;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([80,227,92,245,231,37,99,180])),0))return 42;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([87,146,181,198,252,68,243,102])),0))return 43;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([22,167,59,238,22,231,239,146])),0))return 44;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([64,216,17,91,205,94,45,57])),0))return 45;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([213,152,5,80,163,224,151,120])),0))return 46;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([197,97,123,54,221,168,11,135])),0))return 47;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([206,96,254,186,129,180,103,198])),0))return 48;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([61,236,225,167,134,43,53,93])),0))return 49;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([161,240,255,69,130,227,71,123])),0))return 50;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([206,212,108,12,105,61,100,66])),0))return 51;if(containsBytes(e,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([43,9,131,59,74,118,113,170])),0))return 52;throw new Error("The provided instruction could not be identified as a ghostspeakMarketplace instruction.")}var u,Bv,Lv,Vv=a(()=>{u="4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB",Bv=(C=>(C[C.Agent=0]="Agent",C[C.AgentReputationAuth=1]="AgentReputationAuth",C[C.AgentTreeConfig=2]="AgentTreeConfig",C[C.AgentVerification=3]="AgentVerification",C[C.AuditTrail=4]="AuditTrail",C[C.AuthorizationUsageRecord=5]="AuthorizationUsageRecord",C[C.ComplianceReport=6]="ComplianceReport",C[C.Credential=7]="Credential",C[C.CredentialTemplate=8]="CredentialTemplate",C[C.CredentialType=9]="CredentialType",C[C.DidDocument=10]="DidDocument",C[C.ExternalIdMapping=11]="ExternalIdMapping",C[C.GhostProtectEscrow=12]="GhostProtectEscrow",C[C.GovernanceProposal=13]="GovernanceProposal",C[C.Multisig=14]="Multisig",C[C.ProtocolConfig=15]="ProtocolConfig",C[C.RbacConfig=16]="RbacConfig",C[C.ReentrancyGuard=17]="ReentrancyGuard",C[C.ReputationMetrics=18]="ReputationMetrics",C[C.StakingAccount=19]="StakingAccount",C[C.StakingConfig=20]="StakingConfig",C[C.UserRegistry=21]="UserRegistry",C))(Bv||{});Lv=(A=>(A[A.ActivateAgent=0]="ActivateAgent",A[A.ApproveDelivery=1]="ApproveDelivery",A[A.ArbitrateDispute=2]="ArbitrateDispute",A[A.AutoCreateGhost=3]="AutoCreateGhost",A[A.ClaimGhost=4]="ClaimGhost",A[A.CreateAgentAuthorization=5]="CreateAgentAuthorization",A[A.CreateCredentialTemplate=6]="CreateCredentialTemplate",A[A.CreateCredentialType=7]="CreateCredentialType",A[A.CreateDidDocument=8]="CreateDidDocument",A[A.CreateEscrow=9]="CreateEscrow",A[A.CreateMultisig=10]="CreateMultisig",A[A.DeactivateAgent=11]="DeactivateAgent",A[A.DeactivateCredentialTemplate=12]="DeactivateCredentialTemplate",A[A.DeactivateCredentialType=13]="DeactivateCredentialType",A[A.DeactivateDidDocument=14]="DeactivateDidDocument",A[A.EnableProtocolFees=15]="EnableProtocolFees",A[A.FileDispute=16]="FileDispute",A[A.GenerateComplianceReport=17]="GenerateComplianceReport",A[A.InitReentrancyGuard=18]="InitReentrancyGuard",A[A.InitializeAuditTrail=19]="InitializeAuditTrail",A[A.InitializeGovernanceProposal=20]="InitializeGovernanceProposal",A[A.InitializeProtocolConfig=21]="InitializeProtocolConfig",A[A.InitializeRbacConfig=22]="InitializeRbacConfig",A[A.InitializeReputationMetrics=23]="InitializeReputationMetrics",A[A.InitializeStakingConfig=24]="InitializeStakingConfig",A[A.IssueCredential=25]="IssueCredential",A[A.LinkExternalId=26]="LinkExternalId",A[A.ManageAgentStatus=27]="ManageAgentStatus",A[A.RecordPayaiPayment=28]="RecordPayaiPayment",A[A.RegisterAgent=29]="RegisterAgent",A[A.RegisterAgentCompressed=30]="RegisterAgentCompressed",A[A.RegisterGhostMetadata=31]="RegisterGhostMetadata",A[A.ResetReentrancyGuard=32]="ResetReentrancyGuard",A[A.ResolveDidDocument=33]="ResolveDidDocument",A[A.RevokeAuthorization=34]="RevokeAuthorization",A[A.RevokeCredential=35]="RevokeCredential",A[A.SlashStake=36]="SlashStake",A[A.StakeGhost=37]="StakeGhost",A[A.SubmitDelivery=38]="SubmitDelivery",A[A.SubmitServiceRating=39]="SubmitServiceRating",A[A.UnstakeGhost=40]="UnstakeGhost",A[A.UpdateAgent=41]="UpdateAgent",A[A.UpdateAgentReputation=42]="UpdateAgentReputation",A[A.UpdateAgentService=43]="UpdateAgentService",A[A.UpdateCrosschainStatus=44]="UpdateCrosschainStatus",A[A.UpdateDidDocument=45]="UpdateDidDocument",A[A.UpdateGhostScore=46]="UpdateGhostScore",A[A.UpdateProtocolConfig=47]="UpdateProtocolConfig",A[A.UpdateReputationTags=48]="UpdateReputationTags",A[A.UpdateReputationWithAuth=49]="UpdateReputationWithAuth",A[A.UpdateSourceReputation=50]="UpdateSourceReputation",A[A.VerifyAgent=51]="VerifyAgent",A[A.VerifyAuthorization=52]="VerifyAuthorization",A))(Lv||{});});var D=a(()=>{Vv();});function Zte(n){return process.env.NODE_ENV!=="production"?Jv[n]:"Error message not available in production bundles."}function Yte(n,e,t){return isProgramError(n,e,u,t)}var Kv,Hv,jv,$v,qv,Jv,Qv=a(()=>{D();Kv=6e3,Hv=6001,jv=6002,$v=6003,qv=6004;process.env.NODE_ENV!=="production"&&(Jv={[Hv]:"Default (null) public key cannot be used as admin",[Kv]:"System program cannot be used as admin",[$v]:"Test address cannot be used on mainnet",[jv]:"Unauthorized admin - key does not match protocol admin",[qv]:"Admin validation failed - key failed security checks or is not properly configured"});});var Xv=a(()=>{Qv();});function I(n){if(n==null)throw new Error("Expected a value but received null or undefined.");return n}function S(n){if(!n)throw new Error("Expected a Address.");return typeof n=="object"&&"address"in n?n.address:Array.isArray(n)?n[0]:n}function g(n,e){return t=>{if(!t.value)return Object.freeze({address:n,role:AccountRole.READONLY});let o=t.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:S(t.value),role:Zv(t.value)?upgradeRoleToSigner(o):o,...Zv(t.value)?{signer:t.value}:{}})}}function Zv(n){return !!n&&typeof n=="object"&&"address"in n&&isTransactionSigner(n)}var h=a(()=>{});function mne(){return fixEncoderSize(getBytesEncoder(),8).encode(xm)}function Ga(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),n=>({...n,discriminator:xm}))}function Dm(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function yne(){return combineCodec(Ga(),Dm())}async function Tne(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agentAccount.value||(r.agentAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(S(r.signer.value)),getUtf8Encoder().encode(I(c.agentId))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Ga().encode(c),programAddress:t})}function hm(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Ga().encode(c),programAddress:t})}function fne(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),signer:t(),clock:t()},data:Dm().decode(n.data)}}var xm,tM=a(()=>{D();h();xm=new Uint8Array([252,139,87,21,195,152,29,217]);});function Cne(){return fixEncoderSize(getBytesEncoder(),8).encode(Em)}function Pm(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:Em}))}function Cm(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function bne(){return combineCodec(Pm(),Cm())}function Rne(n,e){let t=e?.programAddress??u,r={escrow:{value:n.escrow??null,isWritable:true},escrowVault:{value:n.escrowVault??null,isWritable:true},agentTokenAccount:{value:n.agentTokenAccount??null,isWritable:true},client:{value:n.client??null,isWritable:false},tokenProgram:{value:n.tokenProgram??null,isWritable:false}};r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");let c=g(t);return Object.freeze({accounts:[c(r.escrow),c(r.escrowVault),c(r.agentTokenAccount),c(r.client),c(r.tokenProgram)],data:Pm().encode({}),programAddress:t})}function Ine(n){if(n.accounts.length<5)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{escrow:t(),escrowVault:t(),agentTokenAccount:t(),client:t(),tokenProgram:t()},data:Cm().decode(n.data)}}var Em,oM=a(()=>{D();h();Em=new Uint8Array([28,233,51,115,33,220,41,28]);});function zne(){return fixEncoderSize(getBytesEncoder(),8).encode(bm)}function Rm(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["decision",ie()]]),n=>({...n,discriminator:bm}))}function Im(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["decision",ce()]])}function One(){return combineCodec(Rm(),Im())}function Fne(n,e){let t=e?.programAddress??u,r={escrow:{value:n.escrow??null,isWritable:true},escrowVault:{value:n.escrowVault??null,isWritable:true},agentTokenAccount:{value:n.agentTokenAccount??null,isWritable:true},clientTokenAccount:{value:n.clientTokenAccount??null,isWritable:true},agentStaking:{value:n.agentStaking??null,isWritable:true},arbitrator:{value:n.arbitrator??null,isWritable:false},tokenProgram:{value:n.tokenProgram??null,isWritable:false}},c={...n};r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");let i=g(t);return Object.freeze({accounts:[i(r.escrow),i(r.escrowVault),i(r.agentTokenAccount),i(r.clientTokenAccount),i(r.agentStaking),i(r.arbitrator),i(r.tokenProgram)],data:Rm().encode(c),programAddress:t})}function Gne(n){if(n.accounts.length<7)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{escrow:t(),escrowVault:t(),agentTokenAccount:t(),clientTokenAccount:t(),agentStaking:t(),arbitrator:t(),tokenProgram:t()},data:Im().decode(n.data)}}var bm,sM=a(()=>{D();h();m();bm=new Uint8Array([225,89,166,101,215,40,191,4]);});function Xne(){return fixEncoderSize(getBytesEncoder(),8).encode(Mm)}function Wa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["paymentAddress",getAddressEncoder()],["firstTxSignature",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["discoverySource",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["initialGhostScore",getOptionEncoder(getU64Encoder())]]),n=>({...n,discriminator:Mm}))}function km(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["paymentAddress",getAddressDecoder()],["firstTxSignature",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["discoverySource",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["initialGhostScore",getOptionDecoder(getU64Decoder())]])}function Zne(){return combineCodec(Wa(),km())}async function Yne(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.agentAccount.value||(r.agentAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(I(c.paymentAddress))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.authority),i(r.systemProgram)],data:Wa().encode(c),programAddress:t})}function ere(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.authority),i(r.systemProgram)],data:Wa().encode(c),programAddress:t})}function tre(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),authority:t(),systemProgram:t()},data:km().decode(n.data)}}var Mm,yM=a(()=>{D();h();Mm=new Uint8Array([50,170,232,73,238,200,180,16]);});function ure(){return fixEncoderSize(getBytesEncoder(),8).encode(wm)}function Um(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["sasCredential",getAddressEncoder()],["sasSchema",getAddressEncoder()],["ipfsMetadataUri",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["network",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),n=>({...n,discriminator:wm}))}function _m(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["sasCredential",getAddressDecoder()],["sasSchema",getAddressDecoder()],["ipfsMetadataUri",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["network",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function gre(){return combineCodec(Um(),_m())}function zm(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},didDocument:{value:n.didDocument??null,isWritable:true},sasAttestation:{value:n.sasAttestation??null,isWritable:false},claimer:{value:n.claimer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.didDocument),i(r.sasAttestation),i(r.claimer),i(r.systemProgram)],data:Um().encode(c),programAddress:t})}function Are(n){if(n.accounts.length<5)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),didDocument:t(),sasAttestation:t(),claimer:t(),systemProgram:t()},data:_m().decode(n.data)}}var wm,RM=a(()=>{D();h();wm=new Uint8Array([149,107,35,233,252,101,148,225]);});var WM={};oe(WM,{CREATE_AGENT_AUTHORIZATION_DISCRIMINATOR:()=>Ba,getCreateAgentAuthorizationDiscriminatorBytes:()=>_M,getCreateAgentAuthorizationInstruction:()=>FM,getCreateAgentAuthorizationInstructionAsync:()=>OM,getCreateAgentAuthorizationInstructionDataCodec:()=>zM,getCreateAgentAuthorizationInstructionDataDecoder:()=>La,getCreateAgentAuthorizationInstructionDataEncoder:()=>Ht,parseCreateAgentAuthorizationInstruction:()=>GM});function _M(){return fixEncoderSize(getBytesEncoder(),8).encode(Ba)}function Ht(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authorizedSource",getAddressEncoder()],["indexLimit",getU64Encoder()],["expiresAt",getI64Encoder()],["network",getU8Encoder()],["signature",fixEncoderSize(getBytesEncoder(),64)],["nonce",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:Ba}))}function La(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authorizedSource",getAddressDecoder()],["indexLimit",getU64Decoder()],["expiresAt",getI64Decoder()],["network",getU8Decoder()],["signature",fixDecoderSize(getBytesDecoder(),64)],["nonce",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function zM(){return combineCodec(Ht(),La())}async function OM(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:false},authorization:{value:n.authorization??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.authorization.value||(r.authorization.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116,95,97,117,116,104])),getAddressEncoder().encode(S(r.agent.value)),getAddressEncoder().encode(I(c.authorizedSource)),getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())).encode(I(c.nonce))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.authorization),i(r.authority),i(r.systemProgram)],data:Ht().encode(c),programAddress:t})}function FM(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:false},authorization:{value:n.authorization??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.authorization),i(r.authority),i(r.systemProgram)],data:Ht().encode(c),programAddress:t})}function GM(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agent:t(),authorization:t(),authority:t(),systemProgram:t()},data:La().decode(n.data)}}var Ba,Gm=a(()=>{D();h();Ba=new Uint8Array([48,219,232,202,151,97,230,20]);});function Wre(){return fixEncoderSize(getBytesEncoder(),8).encode(Hm)}function Ka(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["imageUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["crossmintTemplateId",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:Hm}))}function jm(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["imageUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["crossmintTemplateId",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function Nre(){return combineCodec(Ka(),jm())}async function Bre(n,e){let t=e?.programAddress??u,r={credentialTemplate:{value:n.credentialTemplate??null,isWritable:true},credentialType:{value:n.credentialType??null,isWritable:false},issuer:{value:n.issuer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.credentialTemplate.value||(r.credentialTemplate.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([99,114,101,100,101,110,116,105,97,108,95,116,101,109,112,108,97,116,101])),getAddressEncoder().encode(S(r.credentialType.value)),getUtf8Encoder().encode(I(c.name))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.credentialTemplate),i(r.credentialType),i(r.issuer),i(r.systemProgram)],data:Ka().encode(c),programAddress:t})}function Lre(n,e){let t=e?.programAddress??u,r={credentialTemplate:{value:n.credentialTemplate??null,isWritable:true},credentialType:{value:n.credentialType??null,isWritable:false},issuer:{value:n.issuer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.credentialTemplate),i(r.credentialType),i(r.issuer),i(r.systemProgram)],data:Ka().encode(c),programAddress:t})}function Vre(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credentialTemplate:t(),credentialType:t(),issuer:t(),systemProgram:t()},data:jm().decode(n.data)}}var Hm,BM=a(()=>{D();h();Hm=new Uint8Array([183,109,12,128,134,8,139,144]);});function Xre(){return fixEncoderSize(getBytesEncoder(),8).encode(Ym)}function ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["kind",Ne()],["schemaUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),n=>({...n,discriminator:Ym}))}function e1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["kind",Be()],["schemaUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function Zre(){return combineCodec(ja(),e1())}async function Yre(n,e){let t=e?.programAddress??u,r={credentialType:{value:n.credentialType??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.credentialType.value||(r.credentialType.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([99,114,101,100,101,110,116,105,97,108,95,116,121,112,101])),getUtf8Encoder().encode(I(c.name))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.credentialType),i(r.authority),i(r.systemProgram)],data:ja().encode(c),programAddress:t})}function eoe(n,e){let t=e?.programAddress??u,r={credentialType:{value:n.credentialType??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.credentialType),i(r.authority),i(r.systemProgram)],data:ja().encode(c),programAddress:t})}function toe(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credentialType:t(),authority:t(),systemProgram:t()},data:e1().decode(n.data)}}var Ym,VM=a(()=>{D();h();m();Ym=new Uint8Array([211,208,67,175,20,248,8,227]);});function yoe(){return fixEncoderSize(getBytesEncoder(),8).encode(n1)}function $a(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["didString",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["verificationMethods",getArrayEncoder(Te())],["serviceEndpoints",getArrayEncoder(me())]]),n=>({...n,discriminator:n1}))}function r1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["didString",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["verificationMethods",getArrayDecoder(fe())],["serviceEndpoints",getArrayDecoder(ye())]])}function Toe(){return combineCodec($a(),r1())}async function foe(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:true},controller:{value:n.controller??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.didDocument.value||(r.didDocument.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([100,105,100,95,100,111,99,117,109,101,110,116])),getAddressEncoder().encode(S(r.controller.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.didDocument),i(r.controller),i(r.systemProgram),i(r.clock)],data:$a().encode(c),programAddress:t})}function Soe(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:true},controller:{value:n.controller??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.didDocument),i(r.controller),i(r.systemProgram),i(r.clock)],data:$a().encode(c),programAddress:t})}function xoe(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{didDocument:t(),controller:t(),systemProgram:t(),clock:t()},data:r1().decode(n.data)}}var n1,$M=a(()=>{D();h();m();n1=new Uint8Array([253,40,200,239,69,147,82,182]);});function Foe(){return fixEncoderSize(getBytesEncoder(),8).encode(c1)}function qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["escrowId",getU64Encoder()],["amount",getU64Encoder()],["jobDescription",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["deadline",getI64Encoder()]]),n=>({...n,discriminator:c1}))}function s1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["escrowId",getU64Decoder()],["amount",getU64Decoder()],["jobDescription",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["deadline",getI64Decoder()]])}function Goe(){return combineCodec(qa(),s1())}async function Woe(n,e){let t=e?.programAddress??u,r={escrow:{value:n.escrow??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},clientTokenAccount:{value:n.clientTokenAccount??null,isWritable:true},escrowVault:{value:n.escrowVault??null,isWritable:true},tokenMint:{value:n.tokenMint??null,isWritable:false},client:{value:n.client??null,isWritable:true},tokenProgram:{value:n.tokenProgram??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.escrow.value||(r.escrow.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([103,104,111,115,116,95,112,114,111,116,101,99,116])),getAddressEncoder().encode(S(r.client.value)),getU64Encoder().encode(I(c.escrowId))]})),r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.escrow),i(r.agent),i(r.clientTokenAccount),i(r.escrowVault),i(r.tokenMint),i(r.client),i(r.tokenProgram),i(r.systemProgram)],data:qa().encode(c),programAddress:t})}function Noe(n,e){let t=e?.programAddress??u,r={escrow:{value:n.escrow??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},clientTokenAccount:{value:n.clientTokenAccount??null,isWritable:true},escrowVault:{value:n.escrowVault??null,isWritable:true},tokenMint:{value:n.tokenMint??null,isWritable:false},client:{value:n.client??null,isWritable:true},tokenProgram:{value:n.tokenProgram??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.escrow),i(r.agent),i(r.clientTokenAccount),i(r.escrowVault),i(r.tokenMint),i(r.client),i(r.tokenProgram),i(r.systemProgram)],data:qa().encode(c),programAddress:t})}function Boe(n){if(n.accounts.length<8)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{escrow:t(),agent:t(),clientTokenAccount:t(),escrowVault:t(),tokenMint:t(),client:t(),tokenProgram:t(),systemProgram:t()},data:s1().decode(n.data)}}var c1,QM=a(()=>{D();h();c1=new Uint8Array([253,215,165,116,36,108,68,80]);});function tie(){return fixEncoderSize(getBytesEncoder(),8).encode(d1)}function Ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["multisigId",getU64Encoder()],["threshold",getU8Encoder()],["signers",getArrayEncoder(getAddressEncoder())],["config",Ze()]]),n=>({...n,discriminator:d1}))}function u1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multisigId",getU64Decoder()],["threshold",getU8Decoder()],["signers",getArrayDecoder(getAddressDecoder())],["config",Ye()]])}function nie(){return combineCodec(Ja(),u1())}async function rie(n,e){let t=e?.programAddress??u,r={multisig:{value:n.multisig??null,isWritable:true},owner:{value:n.owner??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.multisig.value||(r.multisig.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,115,105,103])),getAddressEncoder().encode(S(r.owner.value)),getU64Encoder().encode(I(c.multisigId))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.multisig),i(r.owner),i(r.systemProgram)],data:Ja().encode(c),programAddress:t})}function oie(n,e){let t=e?.programAddress??u,r={multisig:{value:n.multisig??null,isWritable:true},owner:{value:n.owner??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.multisig),i(r.owner),i(r.systemProgram)],data:Ja().encode(c),programAddress:t})}function iie(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{multisig:t(),owner:t(),systemProgram:t()},data:u1().decode(n.data)}}var d1,ek=a(()=>{D();h();m();d1=new Uint8Array([148,146,240,10,226,215,167,174]);});function Sie(){return fixEncoderSize(getBytesEncoder(),8).encode(A1)}function Qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),n=>({...n,discriminator:A1}))}function p1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function xie(){return combineCodec(Qa(),p1())}async function Die(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agentAccount.value||(r.agentAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(S(r.signer.value)),getUtf8Encoder().encode(I(c.agentId))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Qa().encode(c),programAddress:t})}function l1(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Qa().encode(c),programAddress:t})}function hie(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),signer:t(),clock:t()},data:p1().decode(n.data)}}var A1,rk=a(()=>{D();h();A1=new Uint8Array([205,171,239,225,82,126,96,166]);});function vie(){return fixEncoderSize(getBytesEncoder(),8).encode(m1)}function y1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:m1}))}function T1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function Mie(){return combineCodec(y1(),T1())}function kie(n,e){let t=e?.programAddress??u,r={credentialTemplate:{value:n.credentialTemplate??null,isWritable:true},issuer:{value:n.issuer??null,isWritable:true}},c=g(t);return Object.freeze({accounts:[c(r.credentialTemplate),c(r.issuer)],data:y1().encode({}),programAddress:t})}function wie(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credentialTemplate:t(),issuer:t()},data:T1().decode(n.data)}}var m1,ck=a(()=>{D();h();m1=new Uint8Array([177,8,195,104,56,34,84,162]);});function Wie(){return fixEncoderSize(getBytesEncoder(),8).encode(f1)}function S1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:f1}))}function x1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function Nie(){return combineCodec(S1(),x1())}function Bie(n,e){let t=e?.programAddress??u,r={credentialType:{value:n.credentialType??null,isWritable:true},authority:{value:n.authority??null,isWritable:true}},c=g(t);return Object.freeze({accounts:[c(r.credentialType),c(r.authority)],data:S1().encode({}),programAddress:t})}function Lie(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credentialType:t(),authority:t()},data:x1().decode(n.data)}}var f1,dk=a(()=>{D();h();f1=new Uint8Array([110,174,221,244,36,206,60,237]);});function Xie(){return fixEncoderSize(getBytesEncoder(),8).encode(h1)}function Xa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:h1}))}function E1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function Zie(){return combineCodec(Xa(),E1())}async function Yie(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:true},controller:{value:n.controller??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}};r.didDocument.value||(r.didDocument.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([100,105,100,95,100,111,99,117,109,101,110,116])),getAddressEncoder().encode(S(r.controller.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.didDocument),c(r.controller),c(r.clock)],data:Xa().encode({}),programAddress:t})}function ece(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:true},controller:{value:n.controller??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.didDocument),c(r.controller),c(r.clock)],data:Xa().encode({}),programAddress:t})}function tce(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{didDocument:t(),controller:t(),clock:t()},data:E1().decode(n.data)}}var h1,gk=a(()=>{D();h();h1=new Uint8Array([77,13,56,161,67,155,206,119]);});function dce(){return fixEncoderSize(getBytesEncoder(),8).encode(C1)}function Za(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:C1}))}function b1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function uce(){return combineCodec(Za(),b1())}async function gce(n,e){let t=e?.programAddress??u,r={config:{value:n.config??null,isWritable:true},authority:{value:n.authority??null,isWritable:false}};r.config.value||(r.config.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([112,114,111,116,111,99,111,108,95,99,111,110,102,105,103]))]}));let c=g(t);return Object.freeze({accounts:[c(r.config),c(r.authority)],data:Za().encode({}),programAddress:t})}function Ace(n,e){let t=e?.programAddress??u,r={config:{value:n.config??null,isWritable:true},authority:{value:n.authority??null,isWritable:false}},c=g(t);return Object.freeze({accounts:[c(r.config),c(r.authority)],data:Za().encode({}),programAddress:t})}function pce(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{config:t(),authority:t()},data:b1().decode(n.data)}}var C1,pk=a(()=>{D();h();C1=new Uint8Array([9,115,79,19,158,209,221,38]);});function bce(){return fixEncoderSize(getBytesEncoder(),8).encode(R1)}function I1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["reason",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),n=>({...n,discriminator:R1}))}function v1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["reason",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function Rce(){return combineCodec(I1(),v1())}function Ice(n,e){let t=e?.programAddress??u,r={escrow:{value:n.escrow??null,isWritable:true},client:{value:n.client??null,isWritable:false}},c={...n},i=g(t);return Object.freeze({accounts:[i(r.escrow),i(r.client)],data:I1().encode(c),programAddress:t})}function vce(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{escrow:t(),client:t()},data:v1().decode(n.data)}}var R1,yk=a(()=>{D();h();R1=new Uint8Array([210,63,221,114,212,97,195,156]);});function Gce(){return fixEncoderSize(getBytesEncoder(),8).encode(k1)}function Ya(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["reportId",getU64Encoder()],["reportType",se()],["dateRangeStart",getI64Encoder()],["dateRangeEnd",getI64Encoder()]]),n=>({...n,discriminator:k1}))}function w1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["reportId",getU64Decoder()],["reportType",ae()],["dateRangeStart",getI64Decoder()],["dateRangeEnd",getI64Decoder()]])}function Wce(){return combineCodec(Ya(),w1())}async function Nce(n,e){let t=e?.programAddress??u,r={report:{value:n.report??null,isWritable:true},auditTrail:{value:n.auditTrail??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.report.value||(r.report.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([99,111,109,112,108,105,97,110,99,101,95,114,101,112,111,114,116])),getU64Encoder().encode(I(c.reportId))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.report),i(r.auditTrail),i(r.authority),i(r.systemProgram)],data:Ya().encode(c),programAddress:t})}function Bce(n,e){let t=e?.programAddress??u,r={report:{value:n.report??null,isWritable:true},auditTrail:{value:n.auditTrail??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.report),i(r.auditTrail),i(r.authority),i(r.systemProgram)],data:Ya().encode(c),programAddress:t})}function Lce(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{report:t(),auditTrail:t(),authority:t(),systemProgram:t()},data:w1().decode(n.data)}}var k1,Dk=a(()=>{D();h();m();k1=new Uint8Array([213,97,79,234,22,228,14,32]);});function rse(){return fixEncoderSize(getBytesEncoder(),8).encode(_1)}function ed(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["entityType",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["config",Ge()]]),n=>({...n,discriminator:_1}))}function z1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["entityType",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["config",We()]])}function ose(){return combineCodec(ed(),z1())}async function ise(n,e){let t=e?.programAddress??u,r={auditTrail:{value:n.auditTrail??null,isWritable:true},entity:{value:n.entity??null,isWritable:false},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.auditTrail.value||(r.auditTrail.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,117,100,105,116,95,116,114,97,105,108])),getAddressEncoder().encode(S(r.entity.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.auditTrail),i(r.entity),i(r.authority),i(r.systemProgram)],data:ed().encode(c),programAddress:t})}function cse(n,e){let t=e?.programAddress??u,r={auditTrail:{value:n.auditTrail??null,isWritable:true},entity:{value:n.entity??null,isWritable:false},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.auditTrail),i(r.entity),i(r.authority),i(r.systemProgram)],data:ed().encode(c),programAddress:t})}function sse(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{auditTrail:t(),entity:t(),authority:t(),systemProgram:t()},data:z1().decode(n.data)}}var _1,Ek=a(()=>{D();h();m();_1=new Uint8Array([145,182,236,249,212,17,175,161]);});function yse(){return fixEncoderSize(getBytesEncoder(),8).encode(F1)}function td(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["proposalId",getU64Encoder()],["title",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["proposalType",de()],["executionParams",qe()]]),n=>({...n,discriminator:F1}))}function G1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["proposalId",getU64Decoder()],["title",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["proposalType",ue()],["executionParams",Je()]])}function Tse(){return combineCodec(td(),G1())}async function jt(n,e){let t=e?.programAddress??u,r={proposal:{value:n.proposal??null,isWritable:true},proposer:{value:n.proposer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.proposal.value||(r.proposal.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([103,111,118,101,114,110,97,110,99,101,95,112,114,111,112,111,115,97,108])),getU64Encoder().encode(I(c.proposalId))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.proposal),i(r.proposer),i(r.systemProgram)],data:td().encode(c),programAddress:t})}function fse(n,e){let t=e?.programAddress??u,r={proposal:{value:n.proposal??null,isWritable:true},proposer:{value:n.proposer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.proposal),i(r.proposer),i(r.systemProgram)],data:td().encode(c),programAddress:t})}function Sse(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{proposal:t(),proposer:t(),systemProgram:t()},data:G1().decode(n.data)}}var F1,wk=a(()=>{D();h();m();F1=new Uint8Array([137,84,234,206,17,58,54,215]);});function Rse(){return fixEncoderSize(getBytesEncoder(),8).encode(N1)}function nd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:N1}))}function B1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function Ise(){return combineCodec(nd(),B1())}async function vse(n,e){let t=e?.programAddress??u,r={config:{value:n.config??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},treasury:{value:n.treasury??null,isWritable:false},buybackPool:{value:n.buybackPool??null,isWritable:false},moderatorPool:{value:n.moderatorPool??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false}};r.config.value||(r.config.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([112,114,111,116,111,99,111,108,95,99,111,110,102,105,103]))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.config),c(r.authority),c(r.treasury),c(r.buybackPool),c(r.moderatorPool),c(r.systemProgram)],data:nd().encode({}),programAddress:t})}function Mse(n,e){let t=e?.programAddress??u,r={config:{value:n.config??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},treasury:{value:n.treasury??null,isWritable:false},buybackPool:{value:n.buybackPool??null,isWritable:false},moderatorPool:{value:n.moderatorPool??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false}};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.config),c(r.authority),c(r.treasury),c(r.buybackPool),c(r.moderatorPool),c(r.systemProgram)],data:nd().encode({}),programAddress:t})}function kse(n){if(n.accounts.length<6)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{config:t(),authority:t(),treasury:t(),buybackPool:t(),moderatorPool:t(),systemProgram:t()},data:B1().decode(n.data)}}var N1,_k=a(()=>{D();h();N1=new Uint8Array([28,50,43,233,244,98,123,118]);});function Lse(){return fixEncoderSize(getBytesEncoder(),8).encode(V1)}function rd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["initialRoles",getArrayEncoder(at())]]),n=>({...n,discriminator:V1}))}function K1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["initialRoles",getArrayDecoder(dt())]])}function Vse(){return combineCodec(rd(),K1())}async function Kse(n,e){let t=e?.programAddress??u,r={rbacConfig:{value:n.rbacConfig??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.rbacConfig.value||(r.rbacConfig.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,98,97,99,95,99,111,110,102,105,103])),getAddressEncoder().encode(S(r.authority.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.rbacConfig),i(r.authority),i(r.systemProgram)],data:rd().encode(c),programAddress:t})}function Hse(n,e){let t=e?.programAddress??u,r={rbacConfig:{value:n.rbacConfig??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.rbacConfig),i(r.authority),i(r.systemProgram)],data:rd().encode(c),programAddress:t})}function jse(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{rbacConfig:t(),authority:t(),systemProgram:t()},data:K1().decode(n.data)}}var V1,Ok=a(()=>{D();h();m();V1=new Uint8Array([215,68,129,228,237,165,0,240]);});function tae(){return fixEncoderSize(getBytesEncoder(),8).encode(j1)}function od(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:j1}))}function $1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function nae(){return combineCodec(od(),$1())}async function rae(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}};r.reputationMetrics.value||(r.reputationMetrics.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,112,117,116,97,116,105,111,110,95,109,101,116,114,105,99,115])),getAddressEncoder().encode(S(r.agent.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.reputationMetrics),c(r.agent),c(r.authority),c(r.systemProgram),c(r.clock)],data:od().encode({}),programAddress:t})}function oae(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.reputationMetrics),c(r.agent),c(r.authority),c(r.systemProgram),c(r.clock)],data:od().encode({}),programAddress:t})}function iae(n){if(n.accounts.length<5)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reputationMetrics:t(),agent:t(),authority:t(),systemProgram:t(),clock:t()},data:$1().decode(n.data)}}var j1,Gk=a(()=>{D();h();j1=new Uint8Array([228,11,207,44,52,188,169,237]);});function Tae(){return fixEncoderSize(getBytesEncoder(),8).encode(J1)}function id(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["minStake",getU64Encoder()],["treasury",getAddressEncoder()]]),n=>({...n,discriminator:J1}))}function Q1(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["minStake",getU64Decoder()],["treasury",getAddressDecoder()]])}function fae(){return combineCodec(id(),Q1())}async function X1(n,e){let t=e?.programAddress??u,r={stakingConfig:{value:n.stakingConfig??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.stakingConfig.value||(r.stakingConfig.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103,95,99,111,110,102,105,103]))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.stakingConfig),i(r.authority),i(r.systemProgram)],data:id().encode(c),programAddress:t})}function Sae(n,e){let t=e?.programAddress??u,r={stakingConfig:{value:n.stakingConfig??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.stakingConfig),i(r.authority),i(r.systemProgram)],data:id().encode(c),programAddress:t})}function xae(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{stakingConfig:t(),authority:t(),systemProgram:t()},data:Q1().decode(n.data)}}var J1,Nk=a(()=>{D();h();J1=new Uint8Array([78,164,6,115,206,48,168,105]);});function Iae(){return fixEncoderSize(getBytesEncoder(),8).encode(Y1)}function cd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:Y1}))}function ey(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function vae(){return combineCodec(cd(),ey())}async function Mae(n,e){let t=e?.programAddress??u,r={reentrancyGuard:{value:n.reentrancyGuard??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}};r.reentrancyGuard.value||(r.reentrancyGuard.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,101,110,116,114,97,110,99,121,95,103,117,97,114,100]))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.reentrancyGuard),c(r.authority),c(r.systemProgram)],data:cd().encode({}),programAddress:t})}function kae(n,e){let t=e?.programAddress??u,r={reentrancyGuard:{value:n.reentrancyGuard??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let c=g(t);return Object.freeze({accounts:[c(r.reentrancyGuard),c(r.authority),c(r.systemProgram)],data:cd().encode({}),programAddress:t})}function wae(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reentrancyGuard:t(),authority:t(),systemProgram:t()},data:ey().decode(n.data)}}var Y1,Lk=a(()=>{D();h();Y1=new Uint8Array([156,109,115,85,12,60,245,99]);});function Bae(){return fixEncoderSize(getBytesEncoder(),8).encode(oy)}function ad(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["credentialId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["subjectDataHash",fixEncoderSize(getBytesEncoder(),32)],["subjectDataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["expiresAt",getOptionEncoder(getI64Encoder())],["sourceAccount",getOptionEncoder(getAddressEncoder())]]),n=>({...n,discriminator:oy}))}function iy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["credentialId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["subjectDataHash",fixDecoderSize(getBytesDecoder(),32)],["subjectDataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["expiresAt",getOptionDecoder(getI64Decoder())],["sourceAccount",getOptionDecoder(getAddressDecoder())]])}function Lae(){return combineCodec(ad(),iy())}async function Vae(n,e){let t=e?.programAddress??u,r={credential:{value:n.credential??null,isWritable:true},credentialTemplate:{value:n.credentialTemplate??null,isWritable:true},credentialType:{value:n.credentialType??null,isWritable:true},subject:{value:n.subject??null,isWritable:false},issuer:{value:n.issuer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.credential.value||(r.credential.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([99,114,101,100,101,110,116,105,97,108])),getAddressEncoder().encode(S(r.credentialTemplate.value)),getAddressEncoder().encode(S(r.subject.value)),getUtf8Encoder().encode(I(c.credentialId))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.credential),i(r.credentialTemplate),i(r.credentialType),i(r.subject),i(r.issuer),i(r.systemProgram)],data:ad().encode(c),programAddress:t})}function Kae(n,e){let t=e?.programAddress??u,r={credential:{value:n.credential??null,isWritable:true},credentialTemplate:{value:n.credentialTemplate??null,isWritable:true},credentialType:{value:n.credentialType??null,isWritable:true},subject:{value:n.subject??null,isWritable:false},issuer:{value:n.issuer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.credential),i(r.credentialTemplate),i(r.credentialType),i(r.subject),i(r.issuer),i(r.systemProgram)],data:ad().encode(c),programAddress:t})}function Hae(n){if(n.accounts.length<6)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credential:t(),credentialTemplate:t(),credentialType:t(),subject:t(),issuer:t(),systemProgram:t()},data:iy().decode(n.data)}}var oy,Zk=a(()=>{D();h();oy=new Uint8Array([255,193,171,224,68,171,194,87]);});function tde(){return fixEncoderSize(getBytesEncoder(),8).encode(sy)}function ud(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["platform",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["externalId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["verified",getBooleanEncoder()]]),n=>({...n,discriminator:sy}))}function ay(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["platform",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["externalId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["verified",getBooleanDecoder()]])}function nde(){return combineCodec(ud(),ay())}async function rde(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},externalIdMapping:{value:n.externalIdMapping??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.externalIdMapping.value||(r.externalIdMapping.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([101,120,116,101,114,110,97,108,95,105,100])),getUtf8Encoder().encode(I(c.platform)),getUtf8Encoder().encode(I(c.externalId))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.externalIdMapping),i(r.authority),i(r.systemProgram)],data:ud().encode(c),programAddress:t})}function ode(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},externalIdMapping:{value:n.externalIdMapping??null,isWritable:true},authority:{value:n.authority??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.externalIdMapping),i(r.authority),i(r.systemProgram)],data:ud().encode(c),programAddress:t})}function ide(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),externalIdMapping:t(),authority:t(),systemProgram:t()},data:ay().decode(n.data)}}var sy,iw=a(()=>{D();h();sy=new Uint8Array([156,102,141,155,175,13,29,86]);});function yde(){return fixEncoderSize(getBytesEncoder(),8).encode(uy)}function gd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["newStatus",getBooleanEncoder()]]),n=>({...n,discriminator:uy}))}function gy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["newStatus",getBooleanDecoder()]])}function Tde(){return combineCodec(gd(),gy())}async function fde(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:true},owner:{value:n.owner??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agent.value||(r.agent.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(S(r.owner.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.owner),i(r.clock)],data:gd().encode(c),programAddress:t})}function Sde(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:true},owner:{value:n.owner??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.owner),i(r.clock)],data:gd().encode(c),programAddress:t})}function xde(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agent:t(),owner:t(),clock:t()},data:gy().decode(n.data)}}var uy,sw=a(()=>{D();h();uy=new Uint8Array([164,219,91,38,45,31,33,47]);});function Fde(){return fixEncoderSize(getBytesEncoder(),8).encode(py)}function Ad(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["paymentSignature",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["amount",getU64Encoder()],["responseTimeMs",getU64Encoder()],["success",getBooleanEncoder()]]),n=>({...n,discriminator:py}))}function ly(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["paymentSignature",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["amount",getU64Decoder()],["responseTimeMs",getU64Decoder()],["success",getBooleanDecoder()]])}function Gde(){return combineCodec(Ad(),ly())}async function Wde(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.reputationMetrics.value||(r.reputationMetrics.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,112,117,116,97,116,105,111,110,95,109,101,116,114,105,99,115])),getAddressEncoder().encode(S(r.agent.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.authority),i(r.clock)],data:Ad().encode(c),programAddress:t})}function Nde(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.authority),i(r.clock)],data:Ad().encode(c),programAddress:t})}function Bde(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reputationMetrics:t(),agent:t(),authority:t(),clock:t()},data:ly().decode(n.data)}}var py,gw=a(()=>{D();h();py=new Uint8Array([165,202,159,139,65,65,36,163]);});function Qde(){return fixEncoderSize(getBytesEncoder(),8).encode(my)}function Sd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentType",getU8Encoder()],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["metadataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["pricingModel",J()]]),n=>({...n,discriminator:my}))}function yy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentType",getU8Decoder()],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["metadataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["pricingModel",Q()]])}function Xde(){return combineCodec(Sd(),yy())}async function Ty(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},stakingAccount:{value:n.stakingAccount??null,isWritable:false},signer:{value:n.signer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agentAccount.value||(r.agentAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(S(r.signer.value)),getUtf8Encoder().encode(I(c.agentId))]})),r.stakingAccount.value||(r.stakingAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103])),getAddressEncoder().encode(S(r.signer.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.stakingAccount),i(r.signer),i(r.systemProgram),i(r.clock)],data:Sd().encode(c),programAddress:t})}function Zde(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},stakingAccount:{value:n.stakingAccount??null,isWritable:false},signer:{value:n.signer??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.stakingAccount),i(r.signer),i(r.systemProgram),i(r.clock)],data:Sd().encode(c),programAddress:t})}function Yde(n){if(n.accounts.length<5)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),stakingAccount:t(),signer:t(),systemProgram:t(),clock:t()},data:yy().decode(n.data)}}var my,mw=a(()=>{D();h();m();my=new Uint8Array([135,157,66,195,2,113,175,30]);});function aue(){return fixEncoderSize(getBytesEncoder(),8).encode(fy)}function Rd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentType",getU8Encoder()],["metadataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["pricingModel",J()]]),n=>({...n,discriminator:fy}))}function Sy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentType",getU8Decoder()],["metadataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["pricingModel",Q()]])}function due(){return combineCodec(Rd(),Sy())}async function xy(n,e){let t=e?.programAddress??u,r={treeAuthority:{value:n.treeAuthority??null,isWritable:true},merkleTree:{value:n.merkleTree??null,isWritable:true},userRegistry:{value:n.userRegistry??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},compressionProgram:{value:n.compressionProgram??null,isWritable:false},logWrapper:{value:n.logWrapper??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.treeAuthority.value||(r.treeAuthority.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116,95,116,114,101,101,95,99,111,110,102,105,103])),getAddressEncoder().encode(S(r.signer.value))]})),r.userRegistry.value||(r.userRegistry.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114,95,114,101,103,105,115,116,114,121])),getAddressEncoder().encode(S(r.signer.value))]})),r.compressionProgram.value||(r.compressionProgram.value="cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK"),r.logWrapper.value||(r.logWrapper.value="noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV"),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.treeAuthority),i(r.merkleTree),i(r.userRegistry),i(r.signer),i(r.compressionProgram),i(r.logWrapper),i(r.systemProgram),i(r.clock)],data:Rd().encode(c),programAddress:t})}function uue(n,e){let t=e?.programAddress??u,r={treeAuthority:{value:n.treeAuthority??null,isWritable:true},merkleTree:{value:n.merkleTree??null,isWritable:true},userRegistry:{value:n.userRegistry??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},compressionProgram:{value:n.compressionProgram??null,isWritable:false},logWrapper:{value:n.logWrapper??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.compressionProgram.value||(r.compressionProgram.value="cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK"),r.logWrapper.value||(r.logWrapper.value="noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV"),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.treeAuthority),i(r.merkleTree),i(r.userRegistry),i(r.signer),i(r.compressionProgram),i(r.logWrapper),i(r.systemProgram),i(r.clock)],data:Rd().encode(c),programAddress:t})}function gue(n){if(n.accounts.length<8)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{treeAuthority:t(),merkleTree:t(),userRegistry:t(),signer:t(),compressionProgram:t(),logWrapper:t(),systemProgram:t(),clock:t()},data:Sy().decode(n.data)}}var fy,Sw=a(()=>{D();h();m();fy=new Uint8Array([15,6,94,55,65,80,123,248]);});function hue(){return fixEncoderSize(getBytesEncoder(),8).encode(Dy)}function hy(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["name",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["description",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["capabilities",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["serviceEndpoint",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:Dy}))}function Ey(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["name",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["description",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["capabilities",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["serviceEndpoint",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function Eue(){return combineCodec(hy(),Ey())}function Pue(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},authority:{value:n.authority??null,isWritable:true}},c={...n},i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.authority)],data:hy().encode(c),programAddress:t})}function Cue(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),authority:t()},data:Ey().decode(n.data)}}var Dy,hw=a(()=>{D();h();Dy=new Uint8Array([34,233,111,236,212,22,26,254]);});function Uue(){return fixEncoderSize(getBytesEncoder(),8).encode(Cy)}function _d(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:Cy}))}function by(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function _ue(){return combineCodec(_d(),by())}async function zue(n,e){let t=e?.programAddress??u,r={reentrancyGuard:{value:n.reentrancyGuard??null,isWritable:true},authority:{value:n.authority??null,isWritable:true}};r.reentrancyGuard.value||(r.reentrancyGuard.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,101,110,116,114,97,110,99,121,95,103,117,97,114,100]))]}));let c=g(t);return Object.freeze({accounts:[c(r.reentrancyGuard),c(r.authority)],data:_d().encode({}),programAddress:t})}function Oue(n,e){let t=e?.programAddress??u,r={reentrancyGuard:{value:n.reentrancyGuard??null,isWritable:true},authority:{value:n.authority??null,isWritable:true}},c=g(t);return Object.freeze({accounts:[c(r.reentrancyGuard),c(r.authority)],data:_d().encode({}),programAddress:t})}function Fue(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reentrancyGuard:t(),authority:t()},data:by().decode(n.data)}}var Cy,Pw=a(()=>{D();h();Cy=new Uint8Array([93,74,168,125,46,153,9,255]);});function jue(){return fixEncoderSize(getBytesEncoder(),8).encode(Iy)}function zd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:Iy}))}function vy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function $ue(){return combineCodec(zd(),vy())}async function que(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:false},didController:{value:n.didController??null,isWritable:false}};r.didDocument.value||(r.didDocument.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([100,105,100,95,100,111,99,117,109,101,110,116])),getAddressEncoder().encode(S(r.didController.value))]}));let c=g(t);return Object.freeze({accounts:[c(r.didDocument),c(r.didController)],data:zd().encode({}),programAddress:t})}function Jue(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:false},didController:{value:n.didController??null,isWritable:false}},c=g(t);return Object.freeze({accounts:[c(r.didDocument),c(r.didController)],data:zd().encode({}),programAddress:t})}function Que(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{didDocument:t(),didController:t()},data:vy().decode(n.data)}}var Iy,bw=a(()=>{D();h();Iy=new Uint8Array([168,180,218,211,184,19,102,12]);});var Uw={};oe(Uw,{REVOKE_AUTHORIZATION_DISCRIMINATOR:()=>Od,getRevokeAuthorizationDiscriminatorBytes:()=>vw,getRevokeAuthorizationInstruction:()=>kw,getRevokeAuthorizationInstructionDataCodec:()=>Mw,getRevokeAuthorizationInstructionDataDecoder:()=>Gd,getRevokeAuthorizationInstructionDataEncoder:()=>Fd,parseRevokeAuthorizationInstruction:()=>ww});function vw(){return fixEncoderSize(getBytesEncoder(),8).encode(Od)}function Fd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["nonce",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:Od}))}function Gd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["nonce",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function Mw(){return combineCodec(Fd(),Gd())}function kw(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:false},authorization:{value:n.authorization??null,isWritable:true},authority:{value:n.authority??null,isWritable:false}},c={...n},i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.authorization),i(r.authority)],data:Fd().encode(c),programAddress:t})}function ww(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agent:t(),authorization:t(),authority:t()},data:Gd().decode(n.data)}}var Od,My=a(()=>{D();h();Od=new Uint8Array([222,179,207,59,191,78,24,248]);});function Tge(){return fixEncoderSize(getBytesEncoder(),8).encode(ky)}function wy(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:ky}))}function Uy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function fge(){return combineCodec(wy(),Uy())}function Sge(n,e){let t=e?.programAddress??u,r={credential:{value:n.credential??null,isWritable:true},issuer:{value:n.issuer??null,isWritable:true}},c=g(t);return Object.freeze({accounts:[c(r.credential),c(r.issuer)],data:wy().encode({}),programAddress:t})}function xge(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credential:t(),issuer:t()},data:Uy().decode(n.data)}}var ky,Ow=a(()=>{D();h();ky=new Uint8Array([38,123,95,95,223,158,169,87]);});function wge(){return fixEncoderSize(getBytesEncoder(),8).encode(Oy)}function Wd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["owner",getAddressEncoder()],["reason",Qe()],["customAmount",getOptionEncoder(getU64Encoder())]]),n=>({...n,discriminator:Oy}))}function Fy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["owner",getAddressDecoder()],["reason",Xe()],["customAmount",getOptionDecoder(getU64Decoder())]])}function Uge(){return combineCodec(Wd(),Fy())}async function _ge(n,e){let t=e?.programAddress??u,r={stakingAccount:{value:n.stakingAccount??null,isWritable:true},stakingConfig:{value:n.stakingConfig??null,isWritable:false},stakingVault:{value:n.stakingVault??null,isWritable:true},treasury:{value:n.treasury??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},tokenProgram:{value:n.tokenProgram??null,isWritable:false}},c={...n};r.stakingAccount.value||(r.stakingAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103])),getAddressEncoder().encode(I(c.owner))]})),r.stakingConfig.value||(r.stakingConfig.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103,95,99,111,110,102,105,103]))]})),r.stakingVault.value||(r.stakingVault.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103,95,118,97,117,108,116])),getAddressEncoder().encode(S(r.stakingConfig.value))]})),r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");let i=g(t);return Object.freeze({accounts:[i(r.stakingAccount),i(r.stakingConfig),i(r.stakingVault),i(r.treasury),i(r.authority),i(r.tokenProgram)],data:Wd().encode(c),programAddress:t})}function zge(n,e){let t=e?.programAddress??u,r={stakingAccount:{value:n.stakingAccount??null,isWritable:true},stakingConfig:{value:n.stakingConfig??null,isWritable:false},stakingVault:{value:n.stakingVault??null,isWritable:true},treasury:{value:n.treasury??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},tokenProgram:{value:n.tokenProgram??null,isWritable:false}},c={...n};r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");let i=g(t);return Object.freeze({accounts:[i(r.stakingAccount),i(r.stakingConfig),i(r.stakingVault),i(r.treasury),i(r.authority),i(r.tokenProgram)],data:Wd().encode(c),programAddress:t})}function Oge(n){if(n.accounts.length<6)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{stakingAccount:t(),stakingConfig:t(),stakingVault:t(),treasury:t(),authority:t(),tokenProgram:t()},data:Fy().decode(n.data)}}var Oy,Gw=a(()=>{D();h();m();Oy=new Uint8Array([190,242,137,27,41,18,233,37]);});function $ge(){return fixEncoderSize(getBytesEncoder(),8).encode(Gy)}function Bd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["amount",getU64Encoder()],["lockDuration",getI64Encoder()]]),n=>({...n,discriminator:Gy}))}function Wy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["amount",getU64Decoder()],["lockDuration",getI64Decoder()]])}function qge(){return combineCodec(Bd(),Wy())}async function Ny(n,e){let t=e?.programAddress??u,r={stakingAccount:{value:n.stakingAccount??null,isWritable:true},ownerTokenAccount:{value:n.ownerTokenAccount??null,isWritable:true},stakingVault:{value:n.stakingVault??null,isWritable:true},stakingConfig:{value:n.stakingConfig??null,isWritable:false},ghostMint:{value:n.ghostMint??null,isWritable:false},owner:{value:n.owner??null,isWritable:true},tokenProgram:{value:n.tokenProgram??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false},rent:{value:n.rent??null,isWritable:false}},c={...n};r.stakingAccount.value||(r.stakingAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103])),getAddressEncoder().encode(S(r.owner.value))]})),r.stakingVault.value||(r.stakingVault.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103,95,118,97,117,108,116])),getAddressEncoder().encode(S(r.stakingConfig.value))]})),r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.rent.value||(r.rent.value="SysvarRent111111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.stakingAccount),i(r.ownerTokenAccount),i(r.stakingVault),i(r.stakingConfig),i(r.ghostMint),i(r.owner),i(r.tokenProgram),i(r.systemProgram),i(r.rent)],data:Bd().encode(c),programAddress:t})}function Jge(n,e){let t=e?.programAddress??u,r={stakingAccount:{value:n.stakingAccount??null,isWritable:true},ownerTokenAccount:{value:n.ownerTokenAccount??null,isWritable:true},stakingVault:{value:n.stakingVault??null,isWritable:true},stakingConfig:{value:n.stakingConfig??null,isWritable:false},ghostMint:{value:n.ghostMint??null,isWritable:false},owner:{value:n.owner??null,isWritable:true},tokenProgram:{value:n.tokenProgram??null,isWritable:false},systemProgram:{value:n.systemProgram??null,isWritable:false},rent:{value:n.rent??null,isWritable:false}},c={...n};r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.rent.value||(r.rent.value="SysvarRent111111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.stakingAccount),i(r.ownerTokenAccount),i(r.stakingVault),i(r.stakingConfig),i(r.ghostMint),i(r.owner),i(r.tokenProgram),i(r.systemProgram),i(r.rent)],data:Bd().encode(c),programAddress:t})}function Qge(n){if(n.accounts.length<9)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{stakingAccount:t(),ownerTokenAccount:t(),stakingVault:t(),stakingConfig:t(),ghostMint:t(),owner:t(),tokenProgram:t(),systemProgram:t(),rent:t()},data:Wy().decode(n.data)}}var Gy,Lw=a(()=>{D();h();Gy=new Uint8Array([5,196,24,54,196,56,173,191]);});function dAe(){return fixEncoderSize(getBytesEncoder(),8).encode(By)}function Ly(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["deliveryProof",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),n=>({...n,discriminator:By}))}function Vy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["deliveryProof",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function uAe(){return combineCodec(Ly(),Vy())}function gAe(n,e){let t=e?.programAddress??u,r={escrow:{value:n.escrow??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},agentOwner:{value:n.agentOwner??null,isWritable:false}},c={...n},i=g(t);return Object.freeze({accounts:[i(r.escrow),i(r.agent),i(r.agentOwner)],data:Ly().encode(c),programAddress:t})}function AAe(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{escrow:t(),agent:t(),agentOwner:t()},data:Vy().decode(n.data)}}var By,Hw=a(()=>{D();h();By=new Uint8Array([217,177,33,54,136,185,123,96]);});function vAe(){return fixEncoderSize(getBytesEncoder(),8).encode(Hy)}function Ld(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["rating",getU8Encoder()],["paymentSignature",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),n=>({...n,discriminator:Hy}))}function jy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["rating",getU8Decoder()],["paymentSignature",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function MAe(){return combineCodec(Ld(),jy())}async function kAe(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},client:{value:n.client??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.reputationMetrics.value||(r.reputationMetrics.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,112,117,116,97,116,105,111,110,95,109,101,116,114,105,99,115])),getAddressEncoder().encode(S(r.agent.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.client),i(r.clock)],data:Ld().encode(c),programAddress:t})}function wAe(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},client:{value:n.client??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.client),i(r.clock)],data:Ld().encode(c),programAddress:t})}function UAe(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reputationMetrics:t(),agent:t(),client:t(),clock:t()},data:jy().decode(n.data)}}var Hy,$w=a(()=>{D();h();Hy=new Uint8Array([23,160,228,88,168,145,129,19]);});function NAe(){return fixEncoderSize(getBytesEncoder(),8).encode(qy)}function Vd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)]]),n=>({...n,discriminator:qy}))}function Jy(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)]])}function BAe(){return combineCodec(Vd(),Jy())}async function Qy(n,e){let t=e?.programAddress??u,r={stakingAccount:{value:n.stakingAccount??null,isWritable:true},stakingConfig:{value:n.stakingConfig??null,isWritable:false},stakingVault:{value:n.stakingVault??null,isWritable:true},ownerTokenAccount:{value:n.ownerTokenAccount??null,isWritable:true},owner:{value:n.owner??null,isWritable:true},tokenProgram:{value:n.tokenProgram??null,isWritable:false}};r.stakingAccount.value||(r.stakingAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103])),getAddressEncoder().encode(S(r.owner.value))]})),r.stakingConfig.value||(r.stakingConfig.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103,95,99,111,110,102,105,103]))]})),r.stakingVault.value||(r.stakingVault.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([115,116,97,107,105,110,103,95,118,97,117,108,116])),getAddressEncoder().encode(S(r.stakingConfig.value))]})),r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");let c=g(t);return Object.freeze({accounts:[c(r.stakingAccount),c(r.stakingConfig),c(r.stakingVault),c(r.ownerTokenAccount),c(r.owner),c(r.tokenProgram)],data:Vd().encode({}),programAddress:t})}function LAe(n,e){let t=e?.programAddress??u,r={stakingAccount:{value:n.stakingAccount??null,isWritable:true},stakingConfig:{value:n.stakingConfig??null,isWritable:false},stakingVault:{value:n.stakingVault??null,isWritable:true},ownerTokenAccount:{value:n.ownerTokenAccount??null,isWritable:true},owner:{value:n.owner??null,isWritable:true},tokenProgram:{value:n.tokenProgram??null,isWritable:false}};r.tokenProgram.value||(r.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");let c=g(t);return Object.freeze({accounts:[c(r.stakingAccount),c(r.stakingConfig),c(r.stakingVault),c(r.ownerTokenAccount),c(r.owner),c(r.tokenProgram)],data:Vd().encode({}),programAddress:t})}function VAe(n){if(n.accounts.length<6)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{stakingAccount:t(),stakingConfig:t(),stakingVault:t(),ownerTokenAccount:t(),owner:t(),tokenProgram:t()},data:Jy().decode(n.data)}}var qy,Qw=a(()=>{D();h();qy=new Uint8Array([252,101,172,252,1,4,12,116]);});function epe(){return fixEncoderSize(getBytesEncoder(),8).encode(eT)}function Jd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentType",getU8Encoder()],["name",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["description",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["metadataUri",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["pricingModel",getOptionEncoder(J())]]),n=>({...n,discriminator:eT}))}function tT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentType",getU8Decoder()],["name",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["description",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["metadataUri",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["pricingModel",getOptionDecoder(Q())]])}function tpe(){return combineCodec(Jd(),tT())}async function npe(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agentAccount.value||(r.agentAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(S(r.signer.value)),getUtf8Encoder().encode(I(c.agentId))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Jd().encode(c),programAddress:t})}function nT(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Jd().encode(c),programAddress:t})}function rpe(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),signer:t(),clock:t()},data:tT().decode(n.data)}}var eT,Zw=a(()=>{D();h();m();eT=new Uint8Array([85,2,178,9,119,139,102,164]);});function Spe(){return fixEncoderSize(getBytesEncoder(),8).encode(oT)}function Qd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["reputationScore",getU64Encoder()]]),n=>({...n,discriminator:oT}))}function iT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["reputationScore",getU64Decoder()]])}function xpe(){return combineCodec(Qd(),iT())}async function Dpe(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agentAccount.value||(r.agentAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(S(r.signer.value)),getUtf8Encoder().encode(I(c.agentId))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Qd().encode(c),programAddress:t})}function hpe(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},signer:{value:n.signer??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.signer),i(r.clock)],data:Qd().encode(c),programAddress:t})}function Epe(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),signer:t(),clock:t()},data:iT().decode(n.data)}}var oT,tU=a(()=>{D();h();oT=new Uint8Array([80,227,92,245,231,37,99,180]);});function Npe(){return fixEncoderSize(getBytesEncoder(),8).encode(pT)}function Xd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentPubkey",getAddressEncoder()],["serviceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["isActive",getBooleanEncoder()],["lastUpdated",getI64Encoder()],["metadataUri",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["capabilities",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:pT}))}function lT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentPubkey",getAddressDecoder()],["serviceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["isActive",getBooleanDecoder()],["lastUpdated",getI64Decoder()],["metadataUri",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["capabilities",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function Bpe(){return combineCodec(Xd(),lT())}async function Lpe(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:true},owner:{value:n.owner??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.agent.value||(r.agent.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(S(r.owner.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.owner),i(r.systemProgram)],data:Xd().encode(c),programAddress:t})}function Vpe(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:true},owner:{value:n.owner??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.owner),i(r.systemProgram)],data:Xd().encode(c),programAddress:t})}function Kpe(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agent:t(),owner:t(),systemProgram:t()},data:lT().decode(n.data)}}var pT,oU=a(()=>{D();h();pT=new Uint8Array([87,146,181,198,252,68,243,102]);});function rle(){return fixEncoderSize(getBytesEncoder(),8).encode(mT)}function yT(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["crossmintCredentialId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["status",Le()]]),n=>({...n,discriminator:mT}))}function TT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["crossmintCredentialId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["status",Ve()]])}function ole(){return combineCodec(yT(),TT())}function ile(n,e){let t=e?.programAddress??u,r={credential:{value:n.credential??null,isWritable:true},issuer:{value:n.issuer??null,isWritable:true}},c={...n},i=g(t);return Object.freeze({accounts:[i(r.credential),i(r.issuer)],data:yT().encode(c),programAddress:t})}function cle(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{credential:t(),issuer:t()},data:TT().decode(n.data)}}var mT,sU=a(()=>{D();h();m();mT=new Uint8Array([22,167,59,238,22,231,239,146]);});function mle(){return fixEncoderSize(getBytesEncoder(),8).encode(ST)}function eu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["addVerificationMethod",getOptionEncoder(Te())],["removeVerificationMethodId",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["addServiceEndpoint",getOptionEncoder(me())],["removeServiceEndpointId",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:ST}))}function xT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["addVerificationMethod",getOptionDecoder(fe())],["removeVerificationMethodId",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["addServiceEndpoint",getOptionDecoder(ye())],["removeServiceEndpointId",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function yle(){return combineCodec(eu(),xT())}async function Tle(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:true},controller:{value:n.controller??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.didDocument.value||(r.didDocument.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([100,105,100,95,100,111,99,117,109,101,110,116])),getAddressEncoder().encode(S(r.controller.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.didDocument),i(r.controller),i(r.clock)],data:eu().encode(c),programAddress:t})}function fle(n,e){let t=e?.programAddress??u,r={didDocument:{value:n.didDocument??null,isWritable:true},controller:{value:n.controller??null,isWritable:true},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.didDocument),i(r.controller),i(r.clock)],data:eu().encode(c),programAddress:t})}function Sle(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{didDocument:t(),controller:t(),clock:t()},data:xT().decode(n.data)}}var ST,mU=a(()=>{D();h();m();ST=new Uint8Array([64,216,17,91,205,94,45,57]);});function wle(){return fixEncoderSize(getBytesEncoder(),8).encode(DT)}function hT(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["newScore",getU64Encoder()],["components",getOptionEncoder(getArrayEncoder(ct()))]]),n=>({...n,discriminator:DT}))}function ET(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["newScore",getU64Decoder()],["components",getOptionDecoder(getArrayDecoder(st()))]])}function Ule(){return combineCodec(hT(),ET())}function _le(n,e){let t=e?.programAddress??u,r={agentAccount:{value:n.agentAccount??null,isWritable:true},authority:{value:n.authority??null,isWritable:false}},c={...n},i=g(t);return Object.freeze({accounts:[i(r.agentAccount),i(r.authority)],data:hT().encode(c),programAddress:t})}function zle(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentAccount:t(),authority:t()},data:ET().decode(n.data)}}var DT,fU=a(()=>{D();h();m();DT=new Uint8Array([213,152,5,80,163,224,151,120]);});function Hle(){return fixEncoderSize(getBytesEncoder(),8).encode(RT)}function tu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["escrowFeeBps",getOptionEncoder(getU16Encoder())],["agentRegistrationFee",getOptionEncoder(getU64Encoder())],["listingFee",getOptionEncoder(getU64Encoder())],["disputeFeeBps",getOptionEncoder(getU16Encoder())],["feesEnabled",getOptionEncoder(getBooleanEncoder())],["treasury",getOptionEncoder(getAddressEncoder())],["buybackPool",getOptionEncoder(getAddressEncoder())],["moderatorPool",getOptionEncoder(getAddressEncoder())]]),n=>({...n,discriminator:RT}))}function IT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["escrowFeeBps",getOptionDecoder(getU16Decoder())],["agentRegistrationFee",getOptionDecoder(getU64Decoder())],["listingFee",getOptionDecoder(getU64Decoder())],["disputeFeeBps",getOptionDecoder(getU16Decoder())],["feesEnabled",getOptionDecoder(getBooleanDecoder())],["treasury",getOptionDecoder(getAddressDecoder())],["buybackPool",getOptionDecoder(getAddressDecoder())],["moderatorPool",getOptionDecoder(getAddressDecoder())]])}function jle(){return combineCodec(tu(),IT())}async function $le(n,e){let t=e?.programAddress??u,r={config:{value:n.config??null,isWritable:true},authority:{value:n.authority??null,isWritable:false}},c={...n};r.config.value||(r.config.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([112,114,111,116,111,99,111,108,95,99,111,110,102,105,103]))]}));let i=g(t);return Object.freeze({accounts:[i(r.config),i(r.authority)],data:tu().encode(c),programAddress:t})}function qle(n,e){let t=e?.programAddress??u,r={config:{value:n.config??null,isWritable:true},authority:{value:n.authority??null,isWritable:false}},c={...n},i=g(t);return Object.freeze({accounts:[i(r.config),i(r.authority)],data:tu().encode(c),programAddress:t})}function Jle(n){if(n.accounts.length<2)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{config:t(),authority:t()},data:IT().decode(n.data)}}var RT,PU=a(()=>{D();h();RT=new Uint8Array([197,97,123,54,221,168,11,135]);});function ome(){return fixEncoderSize(getBytesEncoder(),8).encode(OT)}function ou(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["skillTags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["behaviorTags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["complianceTags",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["tagScores",getArrayEncoder(ut())]]),n=>({...n,discriminator:OT}))}function FT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["skillTags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["behaviorTags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["complianceTags",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["tagScores",getArrayDecoder(gt())]])}function ime(){return combineCodec(ou(),FT())}async function cme(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.reputationMetrics.value||(r.reputationMetrics.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,112,117,116,97,116,105,111,110,95,109,101,116,114,105,99,115])),getAddressEncoder().encode(S(r.agent.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.authority),i(r.clock)],data:ou().encode(c),programAddress:t})}function sme(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.authority),i(r.clock)],data:ou().encode(c),programAddress:t})}function ame(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reputationMetrics:t(),agent:t(),authority:t(),clock:t()},data:FT().decode(n.data)}}var OT,bU=a(()=>{D();h();m();OT=new Uint8Array([206,96,254,186,129,180,103,198]);});var zU={};oe(zU,{UPDATE_REPUTATION_WITH_AUTH_DISCRIMINATOR:()=>du,getUpdateReputationWithAuthDiscriminatorBytes:()=>MU,getUpdateReputationWithAuthInstruction:()=>UU,getUpdateReputationWithAuthInstructionAsync:()=>wU,getUpdateReputationWithAuthInstructionDataCodec:()=>kU,getUpdateReputationWithAuthInstructionDataDecoder:()=>uu,getUpdateReputationWithAuthInstructionDataEncoder:()=>Xt,parseUpdateReputationWithAuthInstruction:()=>_U});function MU(){return fixEncoderSize(getBytesEncoder(),8).encode(du)}function Xt(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["reputationChange",getI64Encoder()],["transactionSignature",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["metadata",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["nonce",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:du}))}function uu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["reputationChange",getI64Decoder()],["transactionSignature",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["metadata",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["nonce",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function kU(){return combineCodec(Xt(),uu())}async function wU(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:false},reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},authorization:{value:n.authorization??null,isWritable:true},usageRecord:{value:n.usageRecord??null,isWritable:true},authorizedSource:{value:n.authorizedSource??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.reputationMetrics.value||(r.reputationMetrics.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,112,117,116,97,116,105,111,110,95,109,101,116,114,105,99,115])),getAddressEncoder().encode(S(r.agent.value))]})),r.authorization.value||(r.authorization.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116,95,97,117,116,104])),getAddressEncoder().encode(S(r.agent.value)),getAddressEncoder().encode(S(r.authorizedSource.value)),getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())).encode(I(c.nonce))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.reputationMetrics),i(r.authorization),i(r.usageRecord),i(r.authorizedSource),i(r.systemProgram),i(r.clock)],data:Xt().encode(c),programAddress:t})}function UU(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:false},reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},authorization:{value:n.authorization??null,isWritable:true},usageRecord:{value:n.usageRecord??null,isWritable:true},authorizedSource:{value:n.authorizedSource??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.reputationMetrics),i(r.authorization),i(r.usageRecord),i(r.authorizedSource),i(r.systemProgram),i(r.clock)],data:Xt().encode(c),programAddress:t})}function _U(n){if(n.accounts.length<7)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agent:t(),reputationMetrics:t(),authorization:t(),usageRecord:t(),authorizedSource:t(),systemProgram:t(),clock:t()},data:uu().decode(n.data)}}var du,VT=a(()=>{D();h();du=new Uint8Array([61,236,225,167,134,43,53,93]);});function vme(){return fixEncoderSize(getBytesEncoder(),8).encode($T)}function gu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["sourceName",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["score",getU16Encoder()],["weight",getU16Encoder()],["dataPoints",getU32Encoder()],["reliability",getU16Encoder()]]),n=>({...n,discriminator:$T}))}function qT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["sourceName",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["score",getU16Decoder()],["weight",getU16Decoder()],["dataPoints",getU32Decoder()],["reliability",getU16Decoder()]])}function Mme(){return combineCodec(gu(),qT())}async function kme(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.reputationMetrics.value||(r.reputationMetrics.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([114,101,112,117,116,97,116,105,111,110,95,109,101,116,114,105,99,115])),getAddressEncoder().encode(S(r.agent.value))]})),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.authority),i(r.clock)],data:gu().encode(c),programAddress:t})}function wme(n,e){let t=e?.programAddress??u,r={reputationMetrics:{value:n.reputationMetrics??null,isWritable:true},agent:{value:n.agent??null,isWritable:true},authority:{value:n.authority??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.reputationMetrics),i(r.agent),i(r.authority),i(r.clock)],data:gu().encode(c),programAddress:t})}function Ume(n){if(n.accounts.length<4)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{reputationMetrics:t(),agent:t(),authority:t(),clock:t()},data:qT().decode(n.data)}}var $T,WU=a(()=>{D();h();$T=new Uint8Array([161,240,255,69,130,227,71,123]);});function e1e(){return fixEncoderSize(getBytesEncoder(),8).encode(XT)}function Au(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["agentPubkey",getAddressEncoder()],["serviceEndpoint",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["supportedCapabilities",getArrayEncoder(getU64Encoder())],["verifiedAt",getI64Encoder()]]),n=>({...n,discriminator:XT}))}function ZT(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["agentPubkey",getAddressDecoder()],["serviceEndpoint",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["supportedCapabilities",getArrayDecoder(getU64Decoder())],["verifiedAt",getI64Decoder()]])}function t1e(){return combineCodec(Au(),ZT())}async function YT(n,e){let t=e?.programAddress??u,r={agentVerification:{value:n.agentVerification??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},verifier:{value:n.verifier??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.agentVerification.value||(r.agentVerification.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116,95,118,101,114,105,102,105,99,97,116,105,111,110])),getAddressEncoder().encode(S(r.agent.value)),getAddressEncoder().encode(S(r.verifier.value))]})),r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentVerification),i(r.agent),i(r.verifier),i(r.systemProgram),i(r.clock)],data:Au().encode(c),programAddress:t})}function n1e(n,e){let t=e?.programAddress??u,r={agentVerification:{value:n.agentVerification??null,isWritable:true},agent:{value:n.agent??null,isWritable:false},verifier:{value:n.verifier??null,isWritable:true},systemProgram:{value:n.systemProgram??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.systemProgram.value||(r.systemProgram.value="11111111111111111111111111111111"),r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agentVerification),i(r.agent),i(r.verifier),i(r.systemProgram),i(r.clock)],data:Au().encode(c),programAddress:t})}function r1e(n){if(n.accounts.length<5)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agentVerification:t(),agent:t(),verifier:t(),systemProgram:t(),clock:t()},data:ZT().decode(n.data)}}var XT,BU=a(()=>{D();h();XT=new Uint8Array([206,212,108,12,105,61,100,66]);});function f1e(){return fixEncoderSize(getBytesEncoder(),8).encode(ef)}function tf(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["nonce",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),n=>({...n,discriminator:ef}))}function nf(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["nonce",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function S1e(){return combineCodec(tf(),nf())}function x1e(n,e){let t=e?.programAddress??u,r={agent:{value:n.agent??null,isWritable:false},authorization:{value:n.authorization??null,isWritable:false},clock:{value:n.clock??null,isWritable:false}},c={...n};r.clock.value||(r.clock.value="SysvarC1ock11111111111111111111111111111111");let i=g(t);return Object.freeze({accounts:[i(r.agent),i(r.authorization),i(r.clock)],data:tf().encode(c),programAddress:t})}function D1e(n){if(n.accounts.length<3)throw new Error("Not enough accounts");let e=0,t=()=>{let o=n.accounts[e];return e+=1,o};return {programAddress:n.programAddress,accounts:{agent:t(),authorization:t(),clock:t()},data:nf().decode(n.data)}}var ef,KU=a(()=>{D();h();ef=new Uint8Array([43,9,131,59,74,118,113,170]);});var HU=a(()=>{tM();oM();sM();yM();RM();Gm();BM();VM();$M();QM();ek();rk();ck();dk();gk();pk();yk();Dk();Ek();wk();_k();Ok();Gk();Nk();Lk();Zk();iw();sw();gw();mw();Sw();hw();Pw();bw();My();Ow();Gw();Lw();Hw();$w();Qw();Zw();tU();oU();sU();mU();fU();PU();bU();VT();WU();BU();KU();});var pu={};oe(pu,{ACTIVATE_AGENT_DISCRIMINATOR:()=>xm,AGENT_DISCRIMINATOR:()=>ep,AGENT_REPUTATION_AUTH_DISCRIMINATOR:()=>ip,AGENT_TREE_CONFIG_DISCRIMINATOR:()=>ap,AGENT_VERIFICATION_DISCRIMINATOR:()=>gp,APPROVE_DELIVERY_DISCRIMINATOR:()=>Em,ARBITRATE_DISPUTE_DISCRIMINATOR:()=>bm,AUDIT_TRAIL_DISCRIMINATOR:()=>yp,AUTHORIZATION_USAGE_RECORD_DISCRIMINATOR:()=>Dp,AUTO_CREATE_GHOST_DISCRIMINATOR:()=>Mm,AccessTier:()=>vn,ActivationRequirementType:()=>Nn,AgentStatus:()=>Bn,AuditAction:()=>Zn,AuthenticationLevel:()=>dr,AuthenticationMethod:()=>Ar,BackupFrequency:()=>Cr,BiometricStorageMethod:()=>wr,BiometricType:()=>Ur,CLAIM_GHOST_DISCRIMINATOR:()=>wm,COMPLIANCE_REPORT_DISCRIMINATOR:()=>Ip,CREATE_AGENT_AUTHORIZATION_DISCRIMINATOR:()=>Ba,CREATE_CREDENTIAL_TEMPLATE_DISCRIMINATOR:()=>Hm,CREATE_CREDENTIAL_TYPE_DISCRIMINATOR:()=>Ym,CREATE_DID_DOCUMENT_DISCRIMINATOR:()=>n1,CREATE_ESCROW_DISCRIMINATOR:()=>c1,CREATE_MULTISIG_DISCRIMINATOR:()=>d1,CREDENTIAL_DISCRIMINATOR:()=>Bp,CREDENTIAL_TEMPLATE_DISCRIMINATOR:()=>Qp,CREDENTIAL_TYPE_DISCRIMINATOR:()=>il,ConditionType:()=>Nr,ConstraintOperator:()=>Jr,CredentialKind:()=>Qr,CredentialStatus:()=>Xr,CrossChainStatus:()=>eo,DEACTIVATE_AGENT_DISCRIMINATOR:()=>A1,DEACTIVATE_CREDENTIAL_TEMPLATE_DISCRIMINATOR:()=>m1,DEACTIVATE_CREDENTIAL_TYPE_DISCRIMINATOR:()=>f1,DEACTIVATE_DID_DOCUMENT_DISCRIMINATOR:()=>h1,DID_DOCUMENT_DISCRIMINATOR:()=>ll,DataAccessLevel:()=>to,DegradationHandling:()=>co,ENABLE_PROTOCOL_FEES_DISCRIMINATOR:()=>C1,EXTERNAL_ID_MAPPING_DISCRIMINATOR:()=>Tl,EnforcementLevel:()=>yo,EscrowStatus:()=>To,FILE_DISPUTE_DISCRIMINATOR:()=>R1,GENERATE_COMPLIANCE_REPORT_DISCRIMINATOR:()=>k1,GHOSTSPEAK_MARKETPLACE_ERROR__DEFAULT_KEY_AS_ADMIN:()=>Hv,GHOSTSPEAK_MARKETPLACE_ERROR__SYSTEM_PROGRAM_AS_ADMIN:()=>Kv,GHOSTSPEAK_MARKETPLACE_ERROR__TEST_ADDRESS_ON_MAINNET:()=>$v,GHOSTSPEAK_MARKETPLACE_ERROR__UNAUTHORIZED_ADMIN:()=>jv,GHOSTSPEAK_MARKETPLACE_ERROR__VALIDATION_FAILED:()=>qv,GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS:()=>u,GHOST_PROTECT_ESCROW_DISCRIMINATOR:()=>Ml,GOVERNANCE_PROPOSAL_DISCRIMINATOR:()=>zl,GhostspeakMarketplaceAccount:()=>Bv,GhostspeakMarketplaceInstruction:()=>Lv,INITIALIZE_AUDIT_TRAIL_DISCRIMINATOR:()=>_1,INITIALIZE_GOVERNANCE_PROPOSAL_DISCRIMINATOR:()=>F1,INITIALIZE_PROTOCOL_CONFIG_DISCRIMINATOR:()=>N1,INITIALIZE_RBAC_CONFIG_DISCRIMINATOR:()=>V1,INITIALIZE_REPUTATION_METRICS_DISCRIMINATOR:()=>j1,INITIALIZE_STAKING_CONFIG_DISCRIMINATOR:()=>J1,INIT_REENTRANCY_GUARD_DISCRIMINATOR:()=>Y1,ISSUE_CREDENTIAL_DISCRIMINATOR:()=>oy,LINK_EXTERNAL_ID_DISCRIMINATOR:()=>sy,MANAGE_AGENT_STATUS_DISCRIMINATOR:()=>uy,MULTISIG_DISCRIMINATOR:()=>Nl,MultisigType:()=>Ko,NotificationMethod:()=>Jo,NotificationPriority:()=>Zo,NotificationTargetType:()=>di,NotificationTiming:()=>ui,PROTOCOL_CONFIG_DISCRIMINATOR:()=>Hl,PermissionConstraintType:()=>Fi,PolicyStatus:()=>ec,PolicyType:()=>tc,PricingModel:()=>Et,ProposalStatus:()=>ac,ProposalType:()=>Pt,QuorumMethod:()=>gc,RBAC_CONFIG_DISCRIMINATOR:()=>Zl,RECORD_PAYAI_PAYMENT_DISCRIMINATOR:()=>py,REENTRANCY_GUARD_DISCRIMINATOR:()=>tm,REGISTER_AGENT_COMPRESSED_DISCRIMINATOR:()=>fy,REGISTER_AGENT_DISCRIMINATOR:()=>my,REGISTER_GHOST_METADATA_DISCRIMINATOR:()=>Dy,REPUTATION_METRICS_DISCRIMINATOR:()=>om,RESET_REENTRANCY_GUARD_DISCRIMINATOR:()=>Cy,RESOLVE_DID_DOCUMENT_DISCRIMINATOR:()=>Iy,REVOKE_AUTHORIZATION_DISCRIMINATOR:()=>Od,REVOKE_CREDENTIAL_DISCRIMINATOR:()=>ky,ReentrancyState:()=>yc,ReportStatus:()=>Ic,ReportType:()=>kc,ReportingFrequency:()=>Rc,ReputationSourceType:()=>_c,RiskCategory:()=>Vc,RiskLevel:()=>Qc,RoleStatus:()=>ms,RoleType:()=>ys,RuleEffect:()=>Ts,SLASH_STAKE_DISCRIMINATOR:()=>Oy,STAKE_GHOST_DISCRIMINATOR:()=>Gy,STAKING_ACCOUNT_DISCRIMINATOR:()=>dm,STAKING_CONFIG_DISCRIMINATOR:()=>Am,SUBMIT_DELIVERY_DISCRIMINATOR:()=>By,SUBMIT_SERVICE_RATING_DISCRIMINATOR:()=>Hy,ScopeInheritance:()=>xs,ScopeType:()=>Ds,SecurityEventType:()=>hs,ServiceEndpointType:()=>vs,SlashReason:()=>Ms,SodConstraintType:()=>Us,StepUpTrigger:()=>Os,TimeLockType:()=>Bs,TransactionPriority:()=>Ls,TransactionStatus:()=>Vs,TransactionType:()=>Ks,TrendDirection:()=>Hs,UNSTAKE_GHOST_DISCRIMINATOR:()=>qy,UPDATE_AGENT_DISCRIMINATOR:()=>eT,UPDATE_AGENT_REPUTATION_DISCRIMINATOR:()=>oT,UPDATE_AGENT_SERVICE_DISCRIMINATOR:()=>pT,UPDATE_CROSSCHAIN_STATUS_DISCRIMINATOR:()=>mT,UPDATE_DID_DOCUMENT_DISCRIMINATOR:()=>ST,UPDATE_GHOST_SCORE_DISCRIMINATOR:()=>DT,UPDATE_PROTOCOL_CONFIG_DISCRIMINATOR:()=>RT,UPDATE_REPUTATION_TAGS_DISCRIMINATOR:()=>OT,UPDATE_REPUTATION_WITH_AUTH_DISCRIMINATOR:()=>du,UPDATE_SOURCE_REPUTATION_DISCRIMINATOR:()=>$T,USER_REGISTRY_DISCRIMINATOR:()=>mm,UnlockMethod:()=>js,VERIFY_AGENT_DISCRIMINATOR:()=>XT,VERIFY_AUTHORIZATION_DISCRIMINATOR:()=>ef,ValueType:()=>$s,VerificationMethodType:()=>Zs,VerificationRelationship:()=>Ys,ViolationSeverity:()=>ea,VoteChoice:()=>ia,arbitratorDecision:()=>SO,decodeAgent:()=>np,decodeAgentReputationAuth:()=>sp,decodeAgentTreeConfig:()=>up,decodeAgentVerification:()=>pp,decodeAuditTrail:()=>fp,decodeAuthorizationUsageRecord:()=>Ep,decodeComplianceReport:()=>Mp,decodeCredential:()=>Vp,decodeCredentialTemplate:()=>Zp,decodeCredentialType:()=>sl,decodeDidDocument:()=>yl,decodeExternalIdMapping:()=>Sl,decodeGhostProtectEscrow:()=>wl,decodeGovernanceProposal:()=>Fl,decodeMultisig:()=>Ll,decodeProtocolConfig:()=>$l,decodeRbacConfig:()=>em,decodeReentrancyGuard:()=>rm,decodeReputationMetrics:()=>cm,decodeStakingAccount:()=>gm,decodeStakingConfig:()=>lm,decodeUserRegistry:()=>Tm,delegationScope:()=>d2,fetchAgent:()=>Q$,fetchAgentReputationAuth:()=>Tq,fetchAgentTreeConfig:()=>Oq,fetchAgentVerification:()=>nJ,fetchAllAgent:()=>X$,fetchAllAgentReputationAuth:()=>fq,fetchAllAgentTreeConfig:()=>Fq,fetchAllAgentVerification:()=>rJ,fetchAllAuditTrail:()=>hJ,fetchAllAuthorizationUsageRecord:()=>VJ,fetchAllComplianceReport:()=>cQ,fetchAllCredential:()=>DQ,fetchAllCredentialTemplate:()=>jQ,fetchAllCredentialType:()=>TX,fetchAllDidDocument:()=>NX,fetchAllExternalIdMapping:()=>dZ,fetchAllGhostProtectEscrow:()=>bZ,fetchAllGovernanceProposal:()=>HZ,fetchAllMaybeAgent:()=>yb,fetchAllMaybeAgentReputationAuth:()=>Mb,fetchAllMaybeAgentTreeConfig:()=>Gb,fetchAllMaybeAgentVerification:()=>qb,fetchAllMaybeAuditTrail:()=>nR,fetchAllMaybeAuthorizationUsageRecord:()=>yR,fetchAllMaybeComplianceReport:()=>xR,fetchAllMaybeCredential:()=>PR,fetchAllMaybeCredentialTemplate:()=>wR,fetchAllMaybeCredentialType:()=>GR,fetchAllMaybeDidDocument:()=>KR,fetchAllMaybeExternalIdMapping:()=>oI,fetchAllMaybeGhostProtectEscrow:()=>AI,fetchAllMaybeGovernanceProposal:()=>PI,fetchAllMaybeMultisig:()=>GI,fetchAllMaybeProtocolConfig:()=>qI,fetchAllMaybeRbacConfig:()=>nv,fetchAllMaybeReentrancyGuard:()=>av,fetchAllMaybeReputationMetrics:()=>lv,fetchAllMaybeStakingAccount:()=>hv,fetchAllMaybeStakingConfig:()=>wv,fetchAllMaybeUserRegistry:()=>Gv,fetchAllMultisig:()=>cY,fetchAllProtocolConfig:()=>CY,fetchAllRbacConfig:()=>VY,fetchAllReentrancyGuard:()=>Aee,fetchAllReputationMetrics:()=>wee,fetchAllStakingAccount:()=>tte,fetchAllStakingConfig:()=>Ete,fetchAllUserRegistry:()=>$te,fetchAuditTrail:()=>DJ,fetchAuthorizationUsageRecord:()=>LJ,fetchComplianceReport:()=>iQ,fetchCredential:()=>xQ,fetchCredentialTemplate:()=>HQ,fetchCredentialType:()=>yX,fetchDidDocument:()=>WX,fetchExternalIdMapping:()=>aZ,fetchGhostProtectEscrow:()=>CZ,fetchGovernanceProposal:()=>KZ,fetchMaybeAgent:()=>mb,fetchMaybeAgentReputationAuth:()=>vb,fetchMaybeAgentTreeConfig:()=>Fb,fetchMaybeAgentVerification:()=>$b,fetchMaybeAuditTrail:()=>tR,fetchMaybeAuthorizationUsageRecord:()=>mR,fetchMaybeComplianceReport:()=>SR,fetchMaybeCredential:()=>ER,fetchMaybeCredentialTemplate:()=>kR,fetchMaybeCredentialType:()=>FR,fetchMaybeDidDocument:()=>VR,fetchMaybeExternalIdMapping:()=>rI,fetchMaybeGhostProtectEscrow:()=>gI,fetchMaybeGovernanceProposal:()=>EI,fetchMaybeMultisig:()=>FI,fetchMaybeProtocolConfig:()=>$I,fetchMaybeRbacConfig:()=>tv,fetchMaybeReentrancyGuard:()=>sv,fetchMaybeReputationMetrics:()=>pv,fetchMaybeStakingAccount:()=>Dv,fetchMaybeStakingConfig:()=>kv,fetchMaybeUserRegistry:()=>Fv,fetchMultisig:()=>iY,fetchProtocolConfig:()=>PY,fetchRbacConfig:()=>LY,fetchReentrancyGuard:()=>gee,fetchReputationMetrics:()=>kee,fetchStakingAccount:()=>ete,fetchStakingConfig:()=>hte,fetchUserRegistry:()=>jte,getAccessAuditConfigCodec:()=>_0,getAccessAuditConfigDecoder:()=>yn,getAccessAuditConfigEncoder:()=>mn,getAccessPolicyCodec:()=>K0,getAccessPolicyDecoder:()=>fn,getAccessPolicyEncoder:()=>Tn,getAccessTierCodec:()=>q0,getAccessTierDecoder:()=>$,getAccessTierEncoder:()=>j,getAccountLockoutPoliciesCodec:()=>l_,getAccountLockoutPoliciesDecoder:()=>Un,getAccountLockoutPoliciesEncoder:()=>wn,getActionCodec:()=>o_,getActionDecoder:()=>kn,getActionEncoder:()=>Mn,getActivateAgentDiscriminatorBytes:()=>mne,getActivateAgentInstruction:()=>hm,getActivateAgentInstructionAsync:()=>Tne,getActivateAgentInstructionDataCodec:()=>yne,getActivateAgentInstructionDataDecoder:()=>Dm,getActivateAgentInstructionDataEncoder:()=>Ga,getActivationRequirementCodec:()=>M_,getActivationRequirementDecoder:()=>Fn,getActivationRequirementEncoder:()=>On,getActivationRequirementTypeCodec:()=>__,getActivationRequirementTypeDecoder:()=>Wn,getActivationRequirementTypeEncoder:()=>Gn,getAgentCodec:()=>J$,getAgentDecoder:()=>tp,getAgentDiscriminatorBytes:()=>q$,getAgentEncoder:()=>lb,getAgentRegisteredEventCodec:()=>j_,getAgentRegisteredEventDecoder:()=>tS,getAgentRegisteredEventEncoder:()=>eS,getAgentReputationAuthCodec:()=>yq,getAgentReputationAuthDecoder:()=>cp,getAgentReputationAuthDiscriminatorBytes:()=>mq,getAgentReputationAuthEncoder:()=>Ib,getAgentServiceUpdatedEventCodec:()=>cz,getAgentServiceUpdatedEventDecoder:()=>cS,getAgentServiceUpdatedEventEncoder:()=>iS,getAgentStatusChangedEventCodec:()=>yz,getAgentStatusChangedEventDecoder:()=>lS,getAgentStatusChangedEventEncoder:()=>pS,getAgentStatusCodec:()=>uz,getAgentStatusDecoder:()=>Vn,getAgentStatusEncoder:()=>Ln,getAgentTreeConfigCodec:()=>zq,getAgentTreeConfigDecoder:()=>dp,getAgentTreeConfigDiscriminatorBytes:()=>_q,getAgentTreeConfigEncoder:()=>Ob,getAgentTreeConfigSize:()=>Gq,getAgentUpdatedEventCodec:()=>hz,getAgentUpdatedEventDecoder:()=>SS,getAgentUpdatedEventEncoder:()=>fS,getAgentVerificationCodec:()=>tJ,getAgentVerificationDataCodec:()=>Nz,getAgentVerificationDataDecoder:()=>Hn,getAgentVerificationDataEncoder:()=>Kn,getAgentVerificationDecoder:()=>Ap,getAgentVerificationDiscriminatorBytes:()=>eJ,getAgentVerificationEncoder:()=>jb,getAgingPolicyCodec:()=>eO,getAgingPolicyDecoder:()=>$n,getAgingPolicyEncoder:()=>jn,getApprovalLevelCodec:()=>AO,getApprovalLevelDecoder:()=>Xn,getApprovalLevelEncoder:()=>Qn,getApproveDeliveryDiscriminatorBytes:()=>Cne,getApproveDeliveryInstruction:()=>Rne,getApproveDeliveryInstructionDataCodec:()=>bne,getApproveDeliveryInstructionDataDecoder:()=>Cm,getApproveDeliveryInstructionDataEncoder:()=>Pm,getArbitrateDisputeDiscriminatorBytes:()=>zne,getArbitrateDisputeInstruction:()=>Fne,getArbitrateDisputeInstructionDataCodec:()=>One,getArbitrateDisputeInstructionDataDecoder:()=>Im,getArbitrateDisputeInstructionDataEncoder:()=>Rm,getArbitratorDecisionCodec:()=>fO,getArbitratorDecisionDecoder:()=>ce,getArbitratorDecisionEncoder:()=>ie,getAuditActionCodec:()=>PO,getAuditActionDecoder:()=>Fe,getAuditActionEncoder:()=>Oe,getAuditConfigCodec:()=>_O,getAuditConfigDecoder:()=>We,getAuditConfigEncoder:()=>Ge,getAuditContextCodec:()=>KO,getAuditContextDecoder:()=>or,getAuditContextEncoder:()=>rr,getAuditEntryCodec:()=>ZO,getAuditEntryDecoder:()=>cr,getAuditEntryEncoder:()=>ir,getAuditTrailCodec:()=>xJ,getAuditTrailDecoder:()=>Tp,getAuditTrailDiscriminatorBytes:()=>SJ,getAuditTrailEncoder:()=>eR,getAuditTrailInitializedEventCodec:()=>A8,getAuditTrailInitializedEventDecoder:()=>OS,getAuditTrailInitializedEventEncoder:()=>zS,getAuthenticationLevelCodec:()=>y8,getAuthenticationLevelDecoder:()=>gr,getAuthenticationLevelEncoder:()=>ur,getAuthenticationMethodCodec:()=>x8,getAuthenticationMethodDecoder:()=>lr,getAuthenticationMethodEncoder:()=>pr,getAuthenticationPoliciesCodec:()=>M8,getAuthenticationPoliciesDecoder:()=>yr,getAuthenticationPoliciesEncoder:()=>mr,getAuthenticationStrengthCodec:()=>O8,getAuthenticationStrengthDecoder:()=>fr,getAuthenticationStrengthEncoder:()=>Tr,getAuthorizationPoliciesCodec:()=>N8,getAuthorizationPoliciesDecoder:()=>Pr,getAuthorizationPoliciesEncoder:()=>Er,getAuthorizationUsageRecordCodec:()=>BJ,getAuthorizationUsageRecordDecoder:()=>hp,getAuthorizationUsageRecordDiscriminatorBytes:()=>NJ,getAuthorizationUsageRecordEncoder:()=>lR,getAutoCreateGhostDiscriminatorBytes:()=>Xne,getAutoCreateGhostInstruction:()=>ere,getAutoCreateGhostInstructionAsync:()=>Yne,getAutoCreateGhostInstructionDataCodec:()=>Zne,getAutoCreateGhostInstructionDataDecoder:()=>km,getAutoCreateGhostInstructionDataEncoder:()=>Wa,getBackupFrequencyCodec:()=>K8,getBackupFrequencyDecoder:()=>er,getBackupFrequencyEncoder:()=>Yn,getBiometricPoliciesCodec:()=>Z8,getBiometricPoliciesDecoder:()=>xr,getBiometricPoliciesEncoder:()=>Sr,getBiometricProtectionCodec:()=>oF,getBiometricProtectionDecoder:()=>Rr,getBiometricProtectionEncoder:()=>br,getBiometricQualityCodec:()=>uF,getBiometricQualityDecoder:()=>vr,getBiometricQualityEncoder:()=>Ir,getBiometricStorageMethodCodec:()=>lF,getBiometricStorageMethodDecoder:()=>kr,getBiometricStorageMethodEncoder:()=>Mr,getBiometricTypeCodec:()=>fF,getBiometricTypeDecoder:()=>ze,getBiometricTypeEncoder:()=>_e,getClaimGhostDiscriminatorBytes:()=>ure,getClaimGhostInstruction:()=>zm,getClaimGhostInstructionDataCodec:()=>gre,getClaimGhostInstructionDataDecoder:()=>_m,getClaimGhostInstructionDataEncoder:()=>Um,getComplianceFlagsCodec:()=>MF,getComplianceFlagsDecoder:()=>ar,getComplianceFlagsEncoder:()=>sr,getComplianceMetricsCodec:()=>OF,getComplianceMetricsDecoder:()=>zr,getComplianceMetricsEncoder:()=>_r,getCompliancePoliciesCodec:()=>NF,getCompliancePoliciesDecoder:()=>Fr,getCompliancePoliciesEncoder:()=>Or,getComplianceReportCodec:()=>oQ,getComplianceReportDecoder:()=>vp,getComplianceReportDiscriminatorBytes:()=>rQ,getComplianceReportEncoder:()=>fR,getComplianceReportGeneratedEventCodec:()=>jF,getComplianceReportGeneratedEventDecoder:()=>sx,getComplianceReportGeneratedEventEncoder:()=>cx,getComplianceStatusCodec:()=>ZF,getComplianceStatusDecoder:()=>Wr,getComplianceStatusEncoder:()=>Gr,getCompressedAgentCreatedEventCodec:()=>uG,getCompressedAgentCreatedEventDecoder:()=>Tx,getCompressedAgentCreatedEventEncoder:()=>yx,getConditionTypeCodec:()=>lG,getConditionTypeDecoder:()=>Lr,getConditionTypeEncoder:()=>Br,getConstraintConditionCodec:()=>fG,getConstraintConditionDecoder:()=>Kr,getConstraintConditionEncoder:()=>Vr,getConstraintOperatorCodec:()=>hG,getConstraintOperatorDecoder:()=>jr,getConstraintOperatorEncoder:()=>Hr,getCreateAgentAuthorizationDiscriminatorBytes:()=>_M,getCreateAgentAuthorizationInstruction:()=>FM,getCreateAgentAuthorizationInstructionAsync:()=>OM,getCreateAgentAuthorizationInstructionDataCodec:()=>zM,getCreateAgentAuthorizationInstructionDataDecoder:()=>La,getCreateAgentAuthorizationInstructionDataEncoder:()=>Ht,getCreateCredentialTemplateDiscriminatorBytes:()=>Wre,getCreateCredentialTemplateInstruction:()=>Lre,getCreateCredentialTemplateInstructionAsync:()=>Bre,getCreateCredentialTemplateInstructionDataCodec:()=>Nre,getCreateCredentialTemplateInstructionDataDecoder:()=>jm,getCreateCredentialTemplateInstructionDataEncoder:()=>Ka,getCreateCredentialTypeDiscriminatorBytes:()=>Xre,getCreateCredentialTypeInstruction:()=>eoe,getCreateCredentialTypeInstructionAsync:()=>Yre,getCreateCredentialTypeInstructionDataCodec:()=>Zre,getCreateCredentialTypeInstructionDataDecoder:()=>e1,getCreateCredentialTypeInstructionDataEncoder:()=>ja,getCreateDidDocumentDiscriminatorBytes:()=>yoe,getCreateDidDocumentInstruction:()=>Soe,getCreateDidDocumentInstructionAsync:()=>foe,getCreateDidDocumentInstructionDataCodec:()=>Toe,getCreateDidDocumentInstructionDataDecoder:()=>r1,getCreateDidDocumentInstructionDataEncoder:()=>$a,getCreateEscrowDiscriminatorBytes:()=>Foe,getCreateEscrowInstruction:()=>Noe,getCreateEscrowInstructionAsync:()=>Woe,getCreateEscrowInstructionDataCodec:()=>Goe,getCreateEscrowInstructionDataDecoder:()=>s1,getCreateEscrowInstructionDataEncoder:()=>qa,getCreateMultisigDiscriminatorBytes:()=>tie,getCreateMultisigInstruction:()=>oie,getCreateMultisigInstructionAsync:()=>rie,getCreateMultisigInstructionDataCodec:()=>nie,getCreateMultisigInstructionDataDecoder:()=>u1,getCreateMultisigInstructionDataEncoder:()=>Ja,getCredentialCodec:()=>SQ,getCredentialDecoder:()=>Lp,getCredentialDiscriminatorBytes:()=>fQ,getCredentialEncoder:()=>hR,getCredentialKindCodec:()=>bG,getCredentialKindDecoder:()=>Be,getCredentialKindEncoder:()=>Ne,getCredentialStatusCodec:()=>MG,getCredentialStatusDecoder:()=>Yr,getCredentialStatusEncoder:()=>Zr,getCredentialTemplateCodec:()=>KQ,getCredentialTemplateDecoder:()=>Xp,getCredentialTemplateDiscriminatorBytes:()=>VQ,getCredentialTemplateEncoder:()=>MR,getCredentialTypeCodec:()=>mX,getCredentialTypeDecoder:()=>cl,getCredentialTypeDiscriminatorBytes:()=>lX,getCredentialTypeEncoder:()=>OR,getCrossChainStatusCodec:()=>_G,getCrossChainStatusDecoder:()=>Ve,getCrossChainStatusEncoder:()=>Le,getDataAccessLevelCodec:()=>GG,getDataAccessLevelDecoder:()=>ro,getDataAccessLevelEncoder:()=>no,getDataProtectionPoliciesCodec:()=>LG,getDataProtectionPoliciesDecoder:()=>io,getDataProtectionPoliciesEncoder:()=>oo,getDeactivateAgentDiscriminatorBytes:()=>Sie,getDeactivateAgentInstruction:()=>l1,getDeactivateAgentInstructionAsync:()=>Die,getDeactivateAgentInstructionDataCodec:()=>xie,getDeactivateAgentInstructionDataDecoder:()=>p1,getDeactivateAgentInstructionDataEncoder:()=>Qa,getDeactivateCredentialTemplateDiscriminatorBytes:()=>vie,getDeactivateCredentialTemplateInstruction:()=>kie,getDeactivateCredentialTemplateInstructionDataCodec:()=>Mie,getDeactivateCredentialTemplateInstructionDataDecoder:()=>T1,getDeactivateCredentialTemplateInstructionDataEncoder:()=>y1,getDeactivateCredentialTypeDiscriminatorBytes:()=>Wie,getDeactivateCredentialTypeInstruction:()=>Bie,getDeactivateCredentialTypeInstructionDataCodec:()=>Nie,getDeactivateCredentialTypeInstructionDataDecoder:()=>x1,getDeactivateCredentialTypeInstructionDataEncoder:()=>S1,getDeactivateDidDocumentDiscriminatorBytes:()=>Xie,getDeactivateDidDocumentInstruction:()=>ece,getDeactivateDidDocumentInstructionAsync:()=>Yie,getDeactivateDidDocumentInstructionDataCodec:()=>Zie,getDeactivateDidDocumentInstructionDataDecoder:()=>E1,getDeactivateDidDocumentInstructionDataEncoder:()=>Xa,getDegradationHandlingCodec:()=>jG,getDegradationHandlingDecoder:()=>Jn,getDegradationHandlingEncoder:()=>qn,getDelegationInfoCodec:()=>e2,getDelegationInfoDecoder:()=>ao,getDelegationInfoEncoder:()=>so,getDelegationScopeCodec:()=>a2,getDelegationScopeDecoder:()=>go,getDelegationScopeEncoder:()=>uo,getDeliverySubmittedEventCodec:()=>P2,getDeliverySubmittedEventDecoder:()=>Wx,getDeliverySubmittedEventEncoder:()=>Gx,getDidDocumentCodec:()=>GX,getDidDocumentDecoder:()=>ml,getDidDocumentDiscriminatorBytes:()=>FX,getDidDocumentEncoder:()=>LR,getDisputeFiledEventCodec:()=>G2,getDisputeFiledEventDecoder:()=>Lx,getDisputeFiledEventEncoder:()=>Bx,getDisputeResolvedEventCodec:()=>j2,getDisputeResolvedEventDecoder:()=>Hx,getDisputeResolvedEventEncoder:()=>Kx,getEmergencyAccessConfigCodec:()=>eW,getEmergencyAccessConfigDecoder:()=>po,getEmergencyAccessConfigEncoder:()=>Ao,getEmergencyConfigCodec:()=>aW,getEmergencyConfigDecoder:()=>mo,getEmergencyConfigEncoder:()=>lo,getEnableProtocolFeesDiscriminatorBytes:()=>dce,getEnableProtocolFeesInstruction:()=>Ace,getEnableProtocolFeesInstructionAsync:()=>gce,getEnableProtocolFeesInstructionDataCodec:()=>uce,getEnableProtocolFeesInstructionDataDecoder:()=>b1,getEnableProtocolFeesInstructionDataEncoder:()=>Za,getEnforcementLevelCodec:()=>AW,getEnforcementLevelDecoder:()=>$e,getEnforcementLevelEncoder:()=>je,getEscrowCompletedEventCodec:()=>fW,getEscrowCompletedEventDecoder:()=>sD,getEscrowCompletedEventEncoder:()=>cD,getEscrowCreatedEventCodec:()=>PW,getEscrowCreatedEventDecoder:()=>lD,getEscrowCreatedEventEncoder:()=>pD,getEscrowStatusCodec:()=>IW,getEscrowStatusDecoder:()=>So,getEscrowStatusEncoder:()=>fo,getExecutionConditionCodec:()=>NW,getExecutionConditionDecoder:()=>Ae,getExecutionConditionEncoder:()=>ge,getExecutionParamsCodec:()=>qW,getExecutionParamsDecoder:()=>Je,getExecutionParamsEncoder:()=>qe,getExternalIdMappingCodec:()=>sZ,getExternalIdMappingDecoder:()=>fl,getExternalIdMappingDiscriminatorBytes:()=>cZ,getExternalIdMappingEncoder:()=>nI,getExternalIdentifierCodec:()=>n6,getExternalIdentifierDecoder:()=>Eo,getExternalIdentifierEncoder:()=>ho,getFileDisputeDiscriminatorBytes:()=>bce,getFileDisputeInstruction:()=>Ice,getFileDisputeInstructionDataCodec:()=>Rce,getFileDisputeInstructionDataDecoder:()=>v1,getFileDisputeInstructionDataEncoder:()=>I1,getGenerateComplianceReportDiscriminatorBytes:()=>Gce,getGenerateComplianceReportInstruction:()=>Bce,getGenerateComplianceReportInstructionAsync:()=>Nce,getGenerateComplianceReportInstructionDataCodec:()=>Wce,getGenerateComplianceReportInstructionDataDecoder:()=>w1,getGenerateComplianceReportInstructionDataEncoder:()=>Ya,getGeographicRegionCodec:()=>A6,getGeographicRegionDecoder:()=>Co,getGeographicRegionEncoder:()=>Po,getGhostProtectEscrowCodec:()=>PZ,getGhostProtectEscrowDecoder:()=>kl,getGhostProtectEscrowDiscriminatorBytes:()=>EZ,getGhostProtectEscrowEncoder:()=>uI,getGhostSlashedEventCodec:()=>x6,getGhostSlashedEventDecoder:()=>OD,getGhostSlashedEventEncoder:()=>zD,getGhostStakedEventCodec:()=>w6,getGhostStakedEventDecoder:()=>BD,getGhostStakedEventEncoder:()=>ND,getGhostUnstakedEventCodec:()=>N6,getGhostUnstakedEventDecoder:()=>KD,getGhostUnstakedEventEncoder:()=>VD,getGhostspeakMarketplaceErrorMessage:()=>Zte,getGovernanceProposalCodec:()=>VZ,getGovernanceProposalCreatedEventCodec:()=>Z6,getGovernanceProposalCreatedEventDecoder:()=>JD,getGovernanceProposalCreatedEventEncoder:()=>qD,getGovernanceProposalDecoder:()=>Ol,getGovernanceProposalDiscriminatorBytes:()=>LZ,getGovernanceProposalEncoder:()=>hI,getHierarchicalBoundaryCodec:()=>oN,getHierarchicalBoundaryDecoder:()=>ko,getHierarchicalBoundaryEncoder:()=>Mo,getIncidentResponsePoliciesCodec:()=>yN,getIncidentResponsePoliciesDecoder:()=>Uo,getIncidentResponsePoliciesEncoder:()=>wo,getInitReentrancyGuardDiscriminatorBytes:()=>Iae,getInitReentrancyGuardInstruction:()=>kae,getInitReentrancyGuardInstructionAsync:()=>Mae,getInitReentrancyGuardInstructionDataCodec:()=>vae,getInitReentrancyGuardInstructionDataDecoder:()=>ey,getInitReentrancyGuardInstructionDataEncoder:()=>cd,getInitializeAuditTrailDiscriminatorBytes:()=>rse,getInitializeAuditTrailInstruction:()=>cse,getInitializeAuditTrailInstructionAsync:()=>ise,getInitializeAuditTrailInstructionDataCodec:()=>ose,getInitializeAuditTrailInstructionDataDecoder:()=>z1,getInitializeAuditTrailInstructionDataEncoder:()=>ed,getInitializeGovernanceProposalDiscriminatorBytes:()=>yse,getInitializeGovernanceProposalInstruction:()=>fse,getInitializeGovernanceProposalInstructionAsync:()=>jt,getInitializeGovernanceProposalInstructionDataCodec:()=>Tse,getInitializeGovernanceProposalInstructionDataDecoder:()=>G1,getInitializeGovernanceProposalInstructionDataEncoder:()=>td,getInitializeProtocolConfigDiscriminatorBytes:()=>Rse,getInitializeProtocolConfigInstruction:()=>Mse,getInitializeProtocolConfigInstructionAsync:()=>vse,getInitializeProtocolConfigInstructionDataCodec:()=>Ise,getInitializeProtocolConfigInstructionDataDecoder:()=>B1,getInitializeProtocolConfigInstructionDataEncoder:()=>nd,getInitializeRbacConfigDiscriminatorBytes:()=>Lse,getInitializeRbacConfigInstruction:()=>Hse,getInitializeRbacConfigInstructionAsync:()=>Kse,getInitializeRbacConfigInstructionDataCodec:()=>Vse,getInitializeRbacConfigInstructionDataDecoder:()=>K1,getInitializeRbacConfigInstructionDataEncoder:()=>rd,getInitializeReputationMetricsDiscriminatorBytes:()=>tae,getInitializeReputationMetricsInstruction:()=>oae,getInitializeReputationMetricsInstructionAsync:()=>rae,getInitializeReputationMetricsInstructionDataCodec:()=>nae,getInitializeReputationMetricsInstructionDataDecoder:()=>$1,getInitializeReputationMetricsInstructionDataEncoder:()=>od,getInitializeStakingConfigDiscriminatorBytes:()=>Tae,getInitializeStakingConfigInstruction:()=>Sae,getInitializeStakingConfigInstructionAsync:()=>X1,getInitializeStakingConfigInstructionDataCodec:()=>fae,getInitializeStakingConfigInstructionDataDecoder:()=>Q1,getInitializeStakingConfigInstructionDataEncoder:()=>id,getIssueCredentialDiscriminatorBytes:()=>Bae,getIssueCredentialInstruction:()=>Kae,getIssueCredentialInstructionAsync:()=>Vae,getIssueCredentialInstructionDataCodec:()=>Lae,getIssueCredentialInstructionDataDecoder:()=>iy,getIssueCredentialInstructionDataEncoder:()=>ad,getLatitudeRangeCodec:()=>xN,getLatitudeRangeDecoder:()=>Ro,getLatitudeRangeEncoder:()=>bo,getLinkExternalIdDiscriminatorBytes:()=>tde,getLinkExternalIdInstruction:()=>ode,getLinkExternalIdInstructionAsync:()=>rde,getLinkExternalIdInstructionDataCodec:()=>nde,getLinkExternalIdInstructionDataDecoder:()=>ay,getLinkExternalIdInstructionDataEncoder:()=>ud,getLocationConstraintsCodec:()=>bN,getLocationConstraintsDecoder:()=>Bo,getLocationConstraintsEncoder:()=>No,getLongitudeRangeCodec:()=>MN,getLongitudeRangeDecoder:()=>vo,getLongitudeRangeEncoder:()=>Io,getManageAgentStatusDiscriminatorBytes:()=>yde,getManageAgentStatusInstruction:()=>Sde,getManageAgentStatusInstructionAsync:()=>fde,getManageAgentStatusInstructionDataCodec:()=>Tde,getManageAgentStatusInstructionDataDecoder:()=>gy,getManageAgentStatusInstructionDataEncoder:()=>gd,getMultisigCodec:()=>oY,getMultisigConfigCodec:()=>ON,getMultisigConfigDecoder:()=>Ye,getMultisigConfigEncoder:()=>Ze,getMultisigCreatedEventCodec:()=>jN,getMultisigCreatedEventDecoder:()=>yh,getMultisigCreatedEventEncoder:()=>mh,getMultisigDecoder:()=>Bl,getMultisigDiscriminatorBytes:()=>rY,getMultisigEncoder:()=>OI,getMultisigSignatureCodec:()=>c4,getMultisigSignatureDecoder:()=>Vo,getMultisigSignatureEncoder:()=>Lo,getMultisigTypeCodec:()=>u4,getMultisigTypeConfigCodec:()=>h4,getMultisigTypeConfigDecoder:()=>jo,getMultisigTypeConfigEncoder:()=>Ho,getMultisigTypeDecoder:()=>le,getMultisigTypeEncoder:()=>pe,getNetworkSecurityPoliciesCodec:()=>b4,getNetworkSecurityPoliciesDecoder:()=>qo,getNetworkSecurityPoliciesEncoder:()=>$o,getNotificationMethodCodec:()=>M4,getNotificationMethodDecoder:()=>Xo,getNotificationMethodEncoder:()=>Qo,getNotificationPriorityCodec:()=>_4,getNotificationPriorityDecoder:()=>ei,getNotificationPriorityEncoder:()=>Yo,getNotificationRequirementCodec:()=>N4,getNotificationRequirementDecoder:()=>Ue,getNotificationRequirementEncoder:()=>we,getNotificationTargetCodec:()=>Q4,getNotificationTargetDecoder:()=>ni,getNotificationTargetEncoder:()=>ti,getNotificationTargetTypeCodec:()=>eB,getNotificationTargetTypeDecoder:()=>ai,getNotificationTargetTypeEncoder:()=>si,getNotificationTimingCodec:()=>oB,getNotificationTimingDecoder:()=>oi,getNotificationTimingEncoder:()=>ri,getPasswordPoliciesCodec:()=>fB,getPasswordPoliciesDecoder:()=>Ai,getPasswordPoliciesEncoder:()=>gi,getPendingTransactionCodec:()=>OB,getPendingTransactionDecoder:()=>li,getPendingTransactionEncoder:()=>pi,getPermissionCodec:()=>NB,getPermissionConstraintCodec:()=>jB,getPermissionConstraintDecoder:()=>Mi,getPermissionConstraintEncoder:()=>vi,getPermissionConstraintTypeCodec:()=>QB,getPermissionConstraintTypeDecoder:()=>Oi,getPermissionConstraintTypeEncoder:()=>zi,getPermissionDecoder:()=>Ii,getPermissionEncoder:()=>Ri,getPermissionMetadataCodec:()=>nL,getPermissionMetadataDecoder:()=>wi,getPermissionMetadataEncoder:()=>ki,getPermissionScopeCodec:()=>cL,getPermissionScopeDecoder:()=>_i,getPermissionScopeEncoder:()=>Ui,getPolicyMetadataCodec:()=>lL,getPolicyMetadataDecoder:()=>xn,getPolicyMetadataEncoder:()=>Sn,getPolicyRuleCodec:()=>ML,getPolicyRuleDecoder:()=>hn,getPolicyRuleEncoder:()=>Dn,getPolicyScopeCodec:()=>_L,getPolicyScopeDecoder:()=>Pn,getPolicyScopeEncoder:()=>En,getPolicyStatusCodec:()=>GL,getPolicyStatusDecoder:()=>bn,getPolicyStatusEncoder:()=>Cn,getPolicyTypeCodec:()=>LL,getPolicyTypeDecoder:()=>In,getPolicyTypeEncoder:()=>Rn,getPricingModelCodec:()=>jL,getPricingModelDecoder:()=>Q,getPricingModelEncoder:()=>J,getProposalAccountCodec:()=>oV,getProposalAccountDecoder:()=>rc,getProposalAccountEncoder:()=>nc,getProposalInstructionCodec:()=>yV,getProposalInstructionDecoder:()=>Do,getProposalInstructionEncoder:()=>xo,getProposalMetadataCodec:()=>xV,getProposalMetadataDecoder:()=>sc,getProposalMetadataEncoder:()=>cc,getProposalStatusCodec:()=>PV,getProposalStatusDecoder:()=>uc,getProposalStatusEncoder:()=>dc,getProposalTypeCodec:()=>IV,getProposalTypeDecoder:()=>ue,getProposalTypeEncoder:()=>de,getProtocolConfigCodec:()=>EY,getProtocolConfigDecoder:()=>jl,getProtocolConfigDiscriminatorBytes:()=>hY,getProtocolConfigEncoder:()=>jI,getProtocolConfigSize:()=>bY,getProtocolConfigUpdatedEventCodec:()=>GV,getProtocolConfigUpdatedEventDecoder:()=>ME,getProtocolConfigUpdatedEventEncoder:()=>vE,getQuorumMethodCodec:()=>LV,getQuorumMethodDecoder:()=>pc,getQuorumMethodEncoder:()=>Ac,getQuorumRequirementsCodec:()=>QV,getQuorumRequirementsDecoder:()=>mc,getQuorumRequirementsEncoder:()=>lc,getRbacConfigCodec:()=>BY,getRbacConfigDecoder:()=>Yl,getRbacConfigDiscriminatorBytes:()=>NY,getRbacConfigEncoder:()=>ev,getRbacConfigInitializedEventCodec:()=>n3,getRbacConfigInitializedEventDecoder:()=>WE,getRbacConfigInitializedEventEncoder:()=>GE,getRecordPayaiPaymentDiscriminatorBytes:()=>Fde,getRecordPayaiPaymentInstruction:()=>Nde,getRecordPayaiPaymentInstructionAsync:()=>Wde,getRecordPayaiPaymentInstructionDataCodec:()=>Gde,getRecordPayaiPaymentInstructionDataDecoder:()=>ly,getRecordPayaiPaymentInstructionDataEncoder:()=>Ad,getReentrancyGuardCodec:()=>uee,getReentrancyGuardDecoder:()=>nm,getReentrancyGuardDiscriminatorBytes:()=>dee,getReentrancyGuardEncoder:()=>cv,getReentrancyGuardSize:()=>pee,getReentrancyStateCodec:()=>c3,getReentrancyStateDecoder:()=>fc,getReentrancyStateEncoder:()=>Tc,getRegisterAgentCompressedDiscriminatorBytes:()=>aue,getRegisterAgentCompressedInstruction:()=>uue,getRegisterAgentCompressedInstructionAsync:()=>xy,getRegisterAgentCompressedInstructionDataCodec:()=>due,getRegisterAgentCompressedInstructionDataDecoder:()=>Sy,getRegisterAgentCompressedInstructionDataEncoder:()=>Rd,getRegisterAgentDiscriminatorBytes:()=>Qde,getRegisterAgentInstruction:()=>Zde,getRegisterAgentInstructionAsync:()=>Ty,getRegisterAgentInstructionDataCodec:()=>Xde,getRegisterAgentInstructionDataDecoder:()=>yy,getRegisterAgentInstructionDataEncoder:()=>Sd,getRegisterGhostMetadataDiscriminatorBytes:()=>hue,getRegisterGhostMetadataInstruction:()=>Pue,getRegisterGhostMetadataInstructionDataCodec:()=>Eue,getRegisterGhostMetadataInstructionDataDecoder:()=>Ey,getRegisterGhostMetadataInstructionDataEncoder:()=>hy,getReportDataCodec:()=>y3,getReportDataDecoder:()=>xc,getReportDataEncoder:()=>Sc,getReportEntryCodec:()=>b3,getReportEntryDecoder:()=>hc,getReportEntryEncoder:()=>Dc,getReportStatusCodec:()=>_3,getReportStatusDecoder:()=>Mc,getReportStatusEncoder:()=>vc,getReportSummaryCodec:()=>N3,getReportSummaryDecoder:()=>Pc,getReportSummaryEncoder:()=>Ec,getReportTypeCodec:()=>K3,getReportTypeDecoder:()=>ae,getReportTypeEncoder:()=>se,getReportingFrequencyCodec:()=>M3,getReportingFrequencyDecoder:()=>nr,getReportingFrequencyEncoder:()=>tr,getReputationComponentCodec:()=>Z3,getReputationComponentDecoder:()=>st,getReputationComponentEncoder:()=>ct,getReputationMetricsCodec:()=>Mee,getReputationMetricsDecoder:()=>im,getReputationMetricsDiscriminatorBytes:()=>vee,getReputationMetricsEncoder:()=>Av,getReputationMetricsInitializedEventCodec:()=>c5,getReputationMetricsInitializedEventDecoder:()=>ZE,getReputationMetricsInitializedEventEncoder:()=>XE,getReputationPaymentRecordedEventCodec:()=>h5,getReputationPaymentRecordedEventDecoder:()=>tP,getReputationPaymentRecordedEventEncoder:()=>eP,getReputationRatingSubmittedEventCodec:()=>w5,getReputationRatingSubmittedEventDecoder:()=>cP,getReputationRatingSubmittedEventEncoder:()=>iP,getReputationSourceTypeCodec:()=>O5,getReputationSourceTypeDecoder:()=>Uc,getReputationSourceTypeEncoder:()=>wc,getReputationTagsUpdatedEventCodec:()=>K5,getReputationTagsUpdatedEventDecoder:()=>uP,getReputationTagsUpdatedEventEncoder:()=>dP,getResetReentrancyGuardDiscriminatorBytes:()=>Uue,getResetReentrancyGuardInstruction:()=>Oue,getResetReentrancyGuardInstructionAsync:()=>zue,getResetReentrancyGuardInstructionDataCodec:()=>_ue,getResetReentrancyGuardInstructionDataDecoder:()=>by,getResetReentrancyGuardInstructionDataEncoder:()=>_d,getResolveDidDocumentDiscriminatorBytes:()=>jue,getResolveDidDocumentInstruction:()=>Jue,getResolveDidDocumentInstructionAsync:()=>que,getResolveDidDocumentInstructionDataCodec:()=>$ue,getResolveDidDocumentInstructionDataDecoder:()=>vy,getResolveDidDocumentInstructionDataEncoder:()=>zd,getResourceConstraintsCodec:()=>Q5,getResourceConstraintsDecoder:()=>Oc,getResourceConstraintsEncoder:()=>zc,getReviewScheduleCodec:()=>u9,getReviewScheduleDecoder:()=>$i,getReviewScheduleEncoder:()=>ji,getRevokeAuthorizationDiscriminatorBytes:()=>vw,getRevokeAuthorizationInstruction:()=>kw,getRevokeAuthorizationInstructionDataCodec:()=>Mw,getRevokeAuthorizationInstructionDataDecoder:()=>Gd,getRevokeAuthorizationInstructionDataEncoder:()=>Fd,getRevokeCredentialDiscriminatorBytes:()=>Tge,getRevokeCredentialInstruction:()=>Sge,getRevokeCredentialInstructionDataCodec:()=>fge,getRevokeCredentialInstructionDataDecoder:()=>Uy,getRevokeCredentialInstructionDataEncoder:()=>wy,getRiskAcceptanceCodec:()=>P9,getRiskAcceptanceDecoder:()=>Nc,getRiskAcceptanceEncoder:()=>Wc,getRiskAssessmentCodec:()=>O9,getRiskAssessmentDecoder:()=>Wi,getRiskAssessmentEncoder:()=>Gi,getRiskCategoryCodec:()=>N9,getRiskCategoryDecoder:()=>Hc,getRiskCategoryEncoder:()=>Kc,getRiskFactorCodec:()=>Q9,getRiskFactorDecoder:()=>Lc,getRiskFactorEncoder:()=>Bc,getRiskIndicatorCodec:()=>nK,getRiskIndicatorDecoder:()=>bc,getRiskIndicatorEncoder:()=>Cc,getRiskLevelCodec:()=>cK,getRiskLevelDecoder:()=>Zc,getRiskLevelEncoder:()=>Xc,getRoleCodec:()=>uK,getRoleConstraintsCodec:()=>yK,getRoleConstraintsDecoder:()=>es,getRoleConstraintsEncoder:()=>Yc,getRoleDecoder:()=>dt,getRoleEncoder:()=>at,getRoleMetadataCodec:()=>hK,getRoleMetadataDecoder:()=>ns,getRoleMetadataEncoder:()=>ts,getRoleStatusCodec:()=>bK,getRoleStatusDecoder:()=>os,getRoleStatusEncoder:()=>rs,getRoleTypeCodec:()=>MK,getRoleTypeDecoder:()=>cs,getRoleTypeEncoder:()=>is,getRuleConditionCodec:()=>NK,getRuleConditionDecoder:()=>Ji,getRuleConditionEncoder:()=>qi,getRuleEffectCodec:()=>KK,getRuleEffectDecoder:()=>Xi,getRuleEffectEncoder:()=>Qi,getScopeBoundariesCodec:()=>qK,getScopeBoundariesDecoder:()=>Bi,getScopeBoundariesEncoder:()=>Ni,getScopeInheritanceCodec:()=>ZK,getScopeInheritanceDecoder:()=>Yi,getScopeInheritanceEncoder:()=>Zi,getScopeTypeCodec:()=>nH,getScopeTypeDecoder:()=>Vi,getScopeTypeEncoder:()=>Li,getSecurityEventTypeCodec:()=>cH,getSecurityEventTypeDecoder:()=>ci,getSecurityEventTypeEncoder:()=>ii,getSecurityPoliciesCodec:()=>uH,getSecurityPoliciesDecoder:()=>Ps,getSecurityPoliciesEncoder:()=>Es,getServiceEndpointCodec:()=>lH,getServiceEndpointDecoder:()=>ye,getServiceEndpointEncoder:()=>me,getServiceEndpointTypeCodec:()=>fH,getServiceEndpointTypeDecoder:()=>Is,getServiceEndpointTypeEncoder:()=>Rs,getSessionConstraintsCodec:()=>hH,getSessionConstraintsDecoder:()=>as,getSessionConstraintsEncoder:()=>ss,getSessionPoliciesCodec:()=>IH,getSessionPoliciesDecoder:()=>bs,getSessionPoliciesEncoder:()=>Cs,getSlashReasonCodec:()=>wH,getSlashReasonDecoder:()=>Xe,getSlashReasonEncoder:()=>Qe,getSlashStakeDiscriminatorBytes:()=>wge,getSlashStakeInstruction:()=>zge,getSlashStakeInstructionAsync:()=>_ge,getSlashStakeInstructionDataCodec:()=>Uge,getSlashStakeInstructionDataDecoder:()=>Fy,getSlashStakeInstructionDataEncoder:()=>Wd,getSodConstraintCodec:()=>OH,getSodConstraintDecoder:()=>us,getSodConstraintEncoder:()=>ds,getSodConstraintTypeCodec:()=>NH,getSodConstraintTypeDecoder:()=>ws,getSodConstraintTypeEncoder:()=>ks,getSourceReputationUpdatedEventCodec:()=>o7,getSourceReputationUpdatedEventDecoder:()=>xC,getSourceReputationUpdatedEventEncoder:()=>SC,getSourceScoreCodec:()=>l7,getSourceScoreDecoder:()=>zs,getSourceScoreEncoder:()=>_s,getStakeGhostDiscriminatorBytes:()=>$ge,getStakeGhostInstruction:()=>Jge,getStakeGhostInstructionAsync:()=>Ny,getStakeGhostInstructionDataCodec:()=>qge,getStakeGhostInstructionDataDecoder:()=>Wy,getStakeGhostInstructionDataEncoder:()=>Bd,getStakingAccountCodec:()=>Yee,getStakingAccountDecoder:()=>um,getStakingAccountDiscriminatorBytes:()=>Zee,getStakingAccountEncoder:()=>xv,getStakingAccountSize:()=>nte,getStakingConfigCodec:()=>Dte,getStakingConfigDecoder:()=>pm,getStakingConfigDiscriminatorBytes:()=>xte,getStakingConfigEncoder:()=>Mv,getStakingConfigSize:()=>Pte,getStepUpTriggerCodec:()=>f7,getStepUpTriggerDecoder:()=>hr,getStepUpTriggerEncoder:()=>Dr,getSubmissionDetailsCodec:()=>P7,getSubmissionDetailsDecoder:()=>Gs,getSubmissionDetailsEncoder:()=>Fs,getSubmitDeliveryDiscriminatorBytes:()=>dAe,getSubmitDeliveryInstruction:()=>gAe,getSubmitDeliveryInstructionDataCodec:()=>uAe,getSubmitDeliveryInstructionDataDecoder:()=>Vy,getSubmitDeliveryInstructionDataEncoder:()=>Ly,getSubmitServiceRatingDiscriminatorBytes:()=>vAe,getSubmitServiceRatingInstruction:()=>wAe,getSubmitServiceRatingInstructionAsync:()=>kAe,getSubmitServiceRatingInstructionDataCodec:()=>MAe,getSubmitServiceRatingInstructionDataDecoder:()=>jy,getSubmitServiceRatingInstructionDataEncoder:()=>Ld,getTagDecayAppliedEventCodec:()=>w7,getTagDecayAppliedEventDecoder:()=>_C,getTagDecayAppliedEventEncoder:()=>UC,getTagScoreCodec:()=>K7,getTagScoreDecoder:()=>gt,getTagScoreEncoder:()=>ut,getTierUpdatedEventCodec:()=>Z7,getTierUpdatedEventDecoder:()=>LC,getTierUpdatedEventEncoder:()=>BC,getTimeConstraintsCodec:()=>oj,getTimeConstraintsDecoder:()=>As,getTimeConstraintsEncoder:()=>gs,getTimeLockCodec:()=>Aj,getTimeLockDecoder:()=>yi,getTimeLockEncoder:()=>mi,getTimeLockTypeCodec:()=>yj,getTimeLockTypeDecoder:()=>Ns,getTimeLockTypeEncoder:()=>Ws,getTransactionPriorityCodec:()=>xj,getTransactionPriorityDecoder:()=>fi,getTransactionPriorityEncoder:()=>Ti,getTransactionStatusCodec:()=>Pj,getTransactionStatusDecoder:()=>xi,getTransactionStatusEncoder:()=>Si,getTransactionTypeCodec:()=>Ij,getTransactionTypeDecoder:()=>He,getTransactionTypeEncoder:()=>Ke,getTrendDirectionCodec:()=>wj,getTrendDirectionDecoder:()=>$c,getTrendDirectionEncoder:()=>jc,getUnlockMethodCodec:()=>Oj,getUnlockMethodDecoder:()=>zn,getUnlockMethodEncoder:()=>_n,getUnstakeGhostDiscriminatorBytes:()=>NAe,getUnstakeGhostInstruction:()=>LAe,getUnstakeGhostInstructionAsync:()=>Qy,getUnstakeGhostInstructionDataCodec:()=>BAe,getUnstakeGhostInstructionDataDecoder:()=>Jy,getUnstakeGhostInstructionDataEncoder:()=>Vd,getUpdateAgentDiscriminatorBytes:()=>epe,getUpdateAgentInstruction:()=>nT,getUpdateAgentInstructionAsync:()=>npe,getUpdateAgentInstructionDataCodec:()=>tpe,getUpdateAgentInstructionDataDecoder:()=>tT,getUpdateAgentInstructionDataEncoder:()=>Jd,getUpdateAgentReputationDiscriminatorBytes:()=>Spe,getUpdateAgentReputationInstruction:()=>hpe,getUpdateAgentReputationInstructionAsync:()=>Dpe,getUpdateAgentReputationInstructionDataCodec:()=>xpe,getUpdateAgentReputationInstructionDataDecoder:()=>iT,getUpdateAgentReputationInstructionDataEncoder:()=>Qd,getUpdateAgentServiceDiscriminatorBytes:()=>Npe,getUpdateAgentServiceInstruction:()=>Vpe,getUpdateAgentServiceInstructionAsync:()=>Lpe,getUpdateAgentServiceInstructionDataCodec:()=>Bpe,getUpdateAgentServiceInstructionDataDecoder:()=>lT,getUpdateAgentServiceInstructionDataEncoder:()=>Xd,getUpdateCrosschainStatusDiscriminatorBytes:()=>rle,getUpdateCrosschainStatusInstruction:()=>ile,getUpdateCrosschainStatusInstructionDataCodec:()=>ole,getUpdateCrosschainStatusInstructionDataDecoder:()=>TT,getUpdateCrosschainStatusInstructionDataEncoder:()=>yT,getUpdateDidDocumentDiscriminatorBytes:()=>mle,getUpdateDidDocumentInstruction:()=>fle,getUpdateDidDocumentInstructionAsync:()=>Tle,getUpdateDidDocumentInstructionDataCodec:()=>yle,getUpdateDidDocumentInstructionDataDecoder:()=>xT,getUpdateDidDocumentInstructionDataEncoder:()=>eu,getUpdateGhostScoreDiscriminatorBytes:()=>wle,getUpdateGhostScoreInstruction:()=>_le,getUpdateGhostScoreInstructionDataCodec:()=>Ule,getUpdateGhostScoreInstructionDataDecoder:()=>ET,getUpdateGhostScoreInstructionDataEncoder:()=>hT,getUpdateProtocolConfigDiscriminatorBytes:()=>Hle,getUpdateProtocolConfigInstruction:()=>qle,getUpdateProtocolConfigInstructionAsync:()=>$le,getUpdateProtocolConfigInstructionDataCodec:()=>jle,getUpdateProtocolConfigInstructionDataDecoder:()=>IT,getUpdateProtocolConfigInstructionDataEncoder:()=>tu,getUpdateReputationTagsDiscriminatorBytes:()=>ome,getUpdateReputationTagsInstruction:()=>sme,getUpdateReputationTagsInstructionAsync:()=>cme,getUpdateReputationTagsInstructionDataCodec:()=>ime,getUpdateReputationTagsInstructionDataDecoder:()=>FT,getUpdateReputationTagsInstructionDataEncoder:()=>ou,getUpdateReputationWithAuthDiscriminatorBytes:()=>MU,getUpdateReputationWithAuthInstruction:()=>UU,getUpdateReputationWithAuthInstructionAsync:()=>wU,getUpdateReputationWithAuthInstructionDataCodec:()=>kU,getUpdateReputationWithAuthInstructionDataDecoder:()=>uu,getUpdateReputationWithAuthInstructionDataEncoder:()=>Xt,getUpdateSourceReputationDiscriminatorBytes:()=>vme,getUpdateSourceReputationInstruction:()=>wme,getUpdateSourceReputationInstructionAsync:()=>kme,getUpdateSourceReputationInstructionDataCodec:()=>Mme,getUpdateSourceReputationInstructionDataDecoder:()=>qT,getUpdateSourceReputationInstructionDataEncoder:()=>gu,getUserRegistryCodec:()=>Hte,getUserRegistryDecoder:()=>ym,getUserRegistryDiscriminatorBytes:()=>Kte,getUserRegistryEncoder:()=>Ov,getUserRegistrySize:()=>qte,getValueTypeCodec:()=>Nj,getValueTypeDecoder:()=>qr,getValueTypeEncoder:()=>$r,getVerificationMethodCodec:()=>Qj,getVerificationMethodDecoder:()=>fe,getVerificationMethodEncoder:()=>Te,getVerificationMethodTypeCodec:()=>e$,getVerificationMethodTypeDecoder:()=>Js,getVerificationMethodTypeEncoder:()=>qs,getVerificationRelationshipCodec:()=>o$,getVerificationRelationshipDecoder:()=>Xs,getVerificationRelationshipEncoder:()=>Qs,getVerifyAgentDiscriminatorBytes:()=>e1e,getVerifyAgentInstruction:()=>n1e,getVerifyAgentInstructionAsync:()=>YT,getVerifyAgentInstructionDataCodec:()=>t1e,getVerifyAgentInstructionDataDecoder:()=>ZT,getVerifyAgentInstructionDataEncoder:()=>Au,getVerifyAuthorizationDiscriminatorBytes:()=>f1e,getVerifyAuthorizationInstruction:()=>x1e,getVerifyAuthorizationInstructionDataCodec:()=>S1e,getVerifyAuthorizationInstructionDataDecoder:()=>nf,getVerifyAuthorizationInstructionDataEncoder:()=>tf,getViolationSeverityCodec:()=>a$,getViolationSeverityDecoder:()=>Jc,getViolationSeverityEncoder:()=>qc,getVoteChoiceCodec:()=>I$,getVoteChoiceDecoder:()=>oa,getVoteChoiceEncoder:()=>ra,getVoteCodec:()=>P$,getVoteDecoder:()=>na,getVoteEncoder:()=>ta,getVotingResultsCodec:()=>O$,getVotingResultsDecoder:()=>da,getVotingResultsEncoder:()=>aa,identifyGhostspeakMarketplaceAccount:()=>Jte,identifyGhostspeakMarketplaceInstruction:()=>Qte,isArbitratorDecision:()=>xO,isDelegationScope:()=>u2,isGhostspeakMarketplaceError:()=>Yte,parseActivateAgentInstruction:()=>fne,parseApproveDeliveryInstruction:()=>Ine,parseArbitrateDisputeInstruction:()=>Gne,parseAutoCreateGhostInstruction:()=>tre,parseClaimGhostInstruction:()=>Are,parseCreateAgentAuthorizationInstruction:()=>GM,parseCreateCredentialTemplateInstruction:()=>Vre,parseCreateCredentialTypeInstruction:()=>toe,parseCreateDidDocumentInstruction:()=>xoe,parseCreateEscrowInstruction:()=>Boe,parseCreateMultisigInstruction:()=>iie,parseDeactivateAgentInstruction:()=>hie,parseDeactivateCredentialTemplateInstruction:()=>wie,parseDeactivateCredentialTypeInstruction:()=>Lie,parseDeactivateDidDocumentInstruction:()=>tce,parseEnableProtocolFeesInstruction:()=>pce,parseFileDisputeInstruction:()=>vce,parseGenerateComplianceReportInstruction:()=>Lce,parseInitReentrancyGuardInstruction:()=>wae,parseInitializeAuditTrailInstruction:()=>sse,parseInitializeGovernanceProposalInstruction:()=>Sse,parseInitializeProtocolConfigInstruction:()=>kse,parseInitializeRbacConfigInstruction:()=>jse,parseInitializeReputationMetricsInstruction:()=>iae,parseInitializeStakingConfigInstruction:()=>xae,parseIssueCredentialInstruction:()=>Hae,parseLinkExternalIdInstruction:()=>ide,parseManageAgentStatusInstruction:()=>xde,parseRecordPayaiPaymentInstruction:()=>Bde,parseRegisterAgentCompressedInstruction:()=>gue,parseRegisterAgentInstruction:()=>Yde,parseRegisterGhostMetadataInstruction:()=>Cue,parseResetReentrancyGuardInstruction:()=>Fue,parseResolveDidDocumentInstruction:()=>Que,parseRevokeAuthorizationInstruction:()=>ww,parseRevokeCredentialInstruction:()=>xge,parseSlashStakeInstruction:()=>Oge,parseStakeGhostInstruction:()=>Qge,parseSubmitDeliveryInstruction:()=>AAe,parseSubmitServiceRatingInstruction:()=>UAe,parseUnstakeGhostInstruction:()=>VAe,parseUpdateAgentInstruction:()=>rpe,parseUpdateAgentReputationInstruction:()=>Epe,parseUpdateAgentServiceInstruction:()=>Kpe,parseUpdateCrosschainStatusInstruction:()=>cle,parseUpdateDidDocumentInstruction:()=>Sle,parseUpdateGhostScoreInstruction:()=>zle,parseUpdateProtocolConfigInstruction:()=>Jle,parseUpdateReputationTagsInstruction:()=>ame,parseUpdateReputationWithAuthInstruction:()=>_U,parseUpdateSourceReputationInstruction:()=>Ume,parseVerifyAgentInstruction:()=>r1e,parseVerifyAuthorizationInstruction:()=>D1e});var te=a(()=>{Nv();Xv();HU();D();m();});var lu,mu,yu,z,rf,of=a(()=>{lu=(l=>(l.CodeGeneration="code-generation",l.DataAnalysis="data-analysis",l.ContentCreation="content-creation",l.ImageGeneration="image-generation",l.AudioProcessing="audio-processing",l.VideoProcessing="video-processing",l.NaturalLanguageProcessing="nlp-specialist",l.ComputerVision="computer-vision",l.ReinforcementLearning="reinforcement-learning",l.DeFiExpert="defi-expert",l.NFTSpecialist="nft-specialist",l.SmartContractAudit="smart-contract-audit",l.BlockchainDevelopment="blockchain-dev",l.DAOGovernance="dao-governance",l.GameDevelopment="game-dev",l.WebDevelopment="web-dev",l.MobileDevelopment="mobile-dev",l.APIIntegration="api-integration",l.DatabaseManagement="database-management",l.DevOpsAutomation="devops-automation",l.FinancialAnalysis="financial-analysis",l.MarketResearch="market-research",l.LegalCompliance="legal-compliance",l.CustomerSupport="customer-support",l.TranslationServices="translation-services",l.SecurityAudit="security-audit",l.PenetrationTesting="penetration-testing",l.ThreatDetection="threat-detection",l.IncidentResponse="incident-response",l.DataEngineering="data-engineering",l.DataVisualization="data-visualization",l.PredictiveModeling="predictive-modeling",l.StatisticalAnalysis="statistical-analysis",l))(lu||{}),mu=(M=>(M.FastResponder="fast-responder",M.QuickResponder="quick-responder",M.SameDay="same-day",M.ConsistentQuality="consistent-quality",M.HighQuality="high-quality",M.TopRated="top-rated",M.PerfectRecord="perfect-record",M.HighVolume="high-volume",M.VeryHighVolume="very-high-volume",M.MegaVolume="mega-volume",M.LongTermActive="long-term-active",M.MultiYear="multi-year",M.CategorySpecialist="category-specialist",M.MultiDomain="multi-domain",M.Generalist="generalist",M.DisputeFree="dispute-free",M.LowDispute="low-dispute",M.HighResolution="high-resolution",M.PlatinumTier="platinum-tier",M.GoldTier="gold-tier",M.SilverTier="silver-tier",M.BronzeTier="bronze-tier",M.Responsive="responsive",M.Communicative="communicative",M.Proactive="proactive",M.DetailOriented="detail-oriented",M.VerifiedIdentity="verified-identity",M.LongStanding="long-standing",M.CommunityTrusted="community-trusted",M.ClientFavorite="client-favorite",M))(mu||{}),yu=(_=>(_.KYCVerified="kyc-verified",_.KYBVerified="kyb-verified",_.AccreditedInvestor="accredited-investor",_.SOC2Compliant="soc2-compliant",_.ISO27001="iso-27001",_.GDPR="gdpr-compliant",_.HIPAA="hipaa-compliant",_.PCI_DSS="pci-dss",_.AuditedCode="audited-code",_.BugBounty="bug-bounty",_.OpenSource="open-source",_.InsuredService="insured-service",_.BondedAgent="bonded-agent",_.LicensedProfessional="licensed-professional",_.RegulatedEntity="regulated-entity",_.PublicAuditTrail="public-audit-trail",_.TransparentPricing="transparent-pricing",_.VerifiedMetrics="verified-metrics",_))(yu||{}),z={MAX_SKILL_TAGS:20,MAX_BEHAVIOR_TAGS:20,MAX_COMPLIANCE_TAGS:10,MAX_TAG_SCORES:50,MAX_TAG_NAME_LENGTH:32,STALE_TAG_THRESHOLD:7776e3,MIN_TAG_CONFIDENCE:5e3,MAX_TAG_CONFIDENCE:1e4,BASIS_POINTS_MAX:1e4},rf={decayRatePerDay:10,minConfidence:2e3,maxAgeSeconds:2160*60*60};});var mf={};oe(mf,{batchGetAccounts:()=>Ru,batchGetAccountsWithRetry:()=>YU,batchGetAndMap:()=>ZU,batchGetExistingAccounts:()=>XU,createBatchFetcher:()=>F1e});function QU(n,e){let t=[];for(let o=0;o<n.length;o+=e)t.push(n.slice(o,o+e));return t}async function Ru(n,e,t={}){let o=Math.min(t.batchSize??100,100);if(e.length===0)return [];if(e.length<=o)return (await n.getMultipleAccounts(e).send()).value;let r=QU(e,o),c=[],i=0,d=r.map(async s=>{let p=await n.getMultipleAccounts(s).send();return i+=s.length,t.onProgress?.(i,e.length),p.value});return c.push(...await Promise.all(d)),c.flat()}async function XU(n,e,t={}){let o=await Ru(n,e,t),r=[];for(let c=0;c<o.length;c++){let i=o[c];i!==null&&r.push({address:e[c],account:i});}return r}async function ZU(n,e,t,o={}){return (await Ru(n,e,o)).map((c,i)=>t(c,e[i],i))}async function YU(n,e,t={},o=3){let r=Math.min(t.batchSize??100,100);if(e.length===0)return [];let c=QU(e,r),i=new Array(e.length),d=0;return await Promise.all(c.map(async(s,p)=>{let E=0,b=false;for(;!b&&E<=o;)try{(await n.getMultipleAccounts(s).send()).value.forEach((P,w)=>{i[p*r+w]=P;}),d+=s.length,t.onProgress?.(d,e.length),b=!0;}catch(x){if(E++,E>o)throw new Error(`Batch ${p} failed after ${o} retries: ${x}`);await new Promise(k=>setTimeout(k,100*Math.pow(2,E-1)));}})),i}function F1e(n,e={}){return {getAccounts:(t,o)=>Ru(n,t,{...e,...o}),getExisting:(t,o)=>XU(n,t,{...e,...o}),getAndMap:(t,o,r)=>ZU(n,t,o,{...e,...r}),getWithRetry:(t,o,r)=>YU(n,t,{...e,...o},r)}}var yf=a(()=>{});var vu={};oe(vu,{deriveA2AMessagePda:()=>L1e,deriveA2ASessionPda:()=>B1e,deriveA2ASessionPdaOriginal:()=>N1e,deriveAgentPda:()=>W1e,deriveAgentPdaOriginal:()=>G1e,deriveAgentTreeConfigPda:()=>H1e,deriveAgentVerificationPda:()=>K1e,deriveEscrowPDA:()=>q1e,deriveEscrowPDAOriginal:()=>$1e,deriveEscrowPda:()=>J1e,deriveMessagePda:()=>X1e,deriveTokenAccountPda:()=>Q1e,deriveUserRegistryPda:()=>V1e,findProgramDerivedAddress:()=>j1e});async function G1e(n,e,t){let[o]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(e),getUtf8Encoder().encode(t)]});return o}async function W1e(n){let[e,t]=await getProgramDerivedAddress({programAddress:n.programAddress,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116])),getAddressEncoder().encode(n.owner),getUtf8Encoder().encode(n.agentId)]});return [e,t]}async function N1e(n,e){let[t]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([97,50,97,95,115,101,115,115,105,111,110])),getAddressEncoder().encode(e)]});return t}async function B1e(n){let e=await getProgramDerivedAddress({programAddress:n.programAddress,seeds:[getBytesEncoder().encode(new Uint8Array([97,50,97,95,115,101,115,115,105,111,110])),getAddressEncoder().encode(n.initiator)]});return [e[0],e[1]]}async function L1e(n,e,t){let o=new Uint8Array(8);new DataView(o.buffer).setBigInt64(0,t,true);let[c]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([97,50,97,95,109,101,115,115,97,103,101])),getAddressEncoder().encode(e),o]});return c}async function V1e(n,e){let[t]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114,95,114,101,103,105,115,116,114,121])),getAddressEncoder().encode(e)]});return t}async function K1e(n,e,t){let[o]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116,95,118,101,114,105,102,105,99,97,116,105,111,110])),getAddressEncoder().encode(e),getAddressEncoder().encode(t)]});return o}async function H1e(n,e){let[t]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([97,103,101,110,116,95,116,114,101,101,95,99,111,110,102,105,103])),getAddressEncoder().encode(e)]});return t}async function j1e(n,e){let t=n.map(r=>typeof r=="string"?getUtf8Encoder().encode(r):typeof r=="object"&&r.constructor===Uint8Array?r:getAddressEncoder().encode(r)),o=await getProgramDerivedAddress({programAddress:e,seeds:t});return [o[0],o[1]]}async function $1e(n,e){let t=[getBytesEncoder().encode(new Uint8Array([101,115,99,114,111,119])),getAddressEncoder().encode(n)],o=await getProgramDerivedAddress({programAddress:e,seeds:t});return [o[0],o[1]]}async function q1e(n){let e=[getBytesEncoder().encode(new Uint8Array([101,115,99,114,111,119])),getUtf8Encoder().encode(n.escrowId)],t=await getProgramDerivedAddress({programAddress:n.programAddress,seeds:e});return [t[0],t[1]]}async function J1e(n,e,t,o){let r=new Uint8Array(8);new DataView(r.buffer).setUint32(0,o,true);let[i]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([101,115,99,114,111,119])),getAddressEncoder().encode(e),getAddressEncoder().encode(t),r.slice(0,4)]});return i}async function Q1e(n,e){let t="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",o="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",[r]=await getProgramDerivedAddress({programAddress:t,seeds:[getAddressEncoder().encode(n),getAddressEncoder().encode(o),getAddressEncoder().encode(e)]});return r}async function X1e(n,e,t){let o=new Uint8Array(4);new DataView(o.buffer).setUint32(0,t,true);let[c]=await getProgramDerivedAddress({programAddress:n,seeds:[getBytesEncoder().encode(new Uint8Array([109,101,115,115,97,103,101])),getAddressEncoder().encode(e),o]});return c}var Mu=a(()=>{});var u0={};oe(u0,{ReputationTagEngine:()=>gn});var gn,xf=a(()=>{of();gn=class{tagCriteria=[];decayConfig;constructor(e=rf){this.decayConfig=e,this.initializeTagCriteria();}initializeTagCriteria(){this.tagCriteria=[{tag:"fast-responder",category:"behavior",minConfidence:z.MIN_TAG_CONFIDENCE,evaluate:e=>{if(e.responseTimeCount===0n)return {shouldAssign:false,confidence:0,evidenceCount:0};let t=e.avgResponseTime,o=Number(e.responseTimeCount);return t<6e4?{shouldAssign:true,confidence:Math.min(1e4,1e4-Math.floor(t/6e4*2e3)),evidenceCount:o,reason:`Average response time ${t}ms`}:{shouldAssign:false,confidence:0,evidenceCount:o}}},{tag:"quick-responder",category:"behavior",minConfidence:z.MIN_TAG_CONFIDENCE,evaluate:e=>{if(e.responseTimeCount===0n)return {shouldAssign:false,confidence:0,evidenceCount:0};let t=e.avgResponseTime,o=Number(e.responseTimeCount);return t<3e5?{shouldAssign:true,confidence:Math.min(1e4,1e4-Math.floor(t/3e5*3e3)),evidenceCount:o,reason:`Average response time ${t}ms`}:{shouldAssign:false,confidence:0,evidenceCount:o}}},{tag:"dispute-free",category:"behavior",minConfidence:z.MIN_TAG_CONFIDENCE,evaluate:e=>{let t=Number(e.successfulPayments+e.failedPayments);return t<10?{shouldAssign:false,confidence:0,evidenceCount:0}:e.totalDisputes===0?{shouldAssign:true,confidence:Math.min(1e4,7e3+t*10),evidenceCount:t,reason:`0 disputes over ${t} transactions`}:{shouldAssign:false,confidence:0,evidenceCount:t}}},{tag:"low-dispute",category:"behavior",minConfidence:z.MIN_TAG_CONFIDENCE,evaluate:e=>{let t=Number(e.successfulPayments+e.failedPayments);if(t<100)return {shouldAssign:false,confidence:0,evidenceCount:0};let o=e.totalDisputes/t*100;return o<1?{shouldAssign:true,confidence:Math.min(1e4,1e4-Math.floor(o*1e3)),evidenceCount:t,reason:`${o.toFixed(2)}% dispute rate`}:{shouldAssign:false,confidence:0,evidenceCount:t}}},{tag:"high-volume",category:"behavior",minConfidence:z.MIN_TAG_CONFIDENCE,evaluate:e=>{let t=Number(e.successfulPayments);return t>=1e3?{shouldAssign:true,confidence:Math.min(1e4,6e3+Math.floor(t/100)),evidenceCount:t,reason:`${t} successful transactions`}:{shouldAssign:false,confidence:0,evidenceCount:t}}},{tag:"very-high-volume",category:"behavior",minConfidence:z.MIN_TAG_CONFIDENCE,evaluate:e=>{let t=Number(e.successfulPayments);return t>=1e4?{shouldAssign:true,confidence:Math.min(1e4,8e3+Math.floor(t/1e3)),evidenceCount:t,reason:`${t} successful transactions`}:{shouldAssign:false,confidence:0,evidenceCount:t}}},{tag:"top-rated",category:"behavior",minConfidence:z.MIN_TAG_CONFIDENCE,evaluate:e=>{if(e.totalRatingsCount<10)return {shouldAssign:false,confidence:0,evidenceCount:0};let t=e.avgRating/20,o=e.totalRatingsCount;return t>4.8?{shouldAssign:true,confidence:Math.min(1e4,Math.floor((t-4.8)*5e4)+8e3),evidenceCount:o,reason:`Average rating ${t.toFixed(2)}/5.0`}:{shouldAssign:false,confidence:0,evidenceCount:o}}},{tag:"high-quality",category:"behavior",minConfidence:z.MIN_TAG_CONFIDENCE,evaluate:e=>{if(e.totalRatingsCount<5)return {shouldAssign:false,confidence:0,evidenceCount:0};let t=e.avgRating/20,o=e.totalRatingsCount;return t>4.5?{shouldAssign:true,confidence:Math.min(1e4,Math.floor((t-4.5)*2e4)+7e3),evidenceCount:o,reason:`Average rating ${t.toFixed(2)}/5.0`}:{shouldAssign:false,confidence:0,evidenceCount:o}}},{tag:"consistent-quality",category:"behavior",minConfidence:z.MIN_TAG_CONFIDENCE,evaluate:e=>{if(e.totalRatingsCount<20)return {shouldAssign:false,confidence:0,evidenceCount:0};let t=e.avgRating/20,o=e.totalRatingsCount;return t>4.3?{shouldAssign:true,confidence:Math.min(1e4,Math.floor((t-4)*1e4)+5e3),evidenceCount:o,reason:`Consistent high ratings (${t.toFixed(2)}/5.0)`}:{shouldAssign:false,confidence:0,evidenceCount:o}}},{tag:"perfect-record",category:"behavior",minConfidence:z.MIN_TAG_CONFIDENCE,evaluate:e=>{let t=Number(e.successfulPayments+e.failedPayments);return t<50?{shouldAssign:false,confidence:0,evidenceCount:0}:e.successRate/100===100&&e.failedPayments===0n?{shouldAssign:true,confidence:Math.min(1e4,8e3+Math.floor(t/10)),evidenceCount:t,reason:`100% success rate over ${t} transactions`}:{shouldAssign:false,confidence:0,evidenceCount:t}}},{tag:"high-resolution",category:"behavior",minConfidence:z.MIN_TAG_CONFIDENCE,evaluate:e=>{if(e.totalDisputes<5)return {shouldAssign:false,confidence:0,evidenceCount:0};let t=e.disputesResolved/e.totalDisputes*100,o=e.totalDisputes;return t>90?{shouldAssign:true,confidence:Math.min(1e4,Math.floor((t-90)*1e3)+8e3),evidenceCount:o,reason:`${t.toFixed(1)}% disputes resolved favorably`}:{shouldAssign:false,confidence:0,evidenceCount:o}}},{tag:"long-term-active",category:"behavior",minConfidence:z.MIN_TAG_CONFIDENCE,evaluate:e=>{let r=(Math.floor(Date.now()/1e3)-e.createdAt)/(365*24*60*60);return r>=1?{shouldAssign:true,confidence:Math.min(1e4,Math.floor(r*2e3)+6e3),evidenceCount:Math.floor(r),reason:`Active for ${r.toFixed(1)} years`}:{shouldAssign:false,confidence:0,evidenceCount:0}}},{tag:"multi-year",category:"behavior",minConfidence:z.MIN_TAG_CONFIDENCE,evaluate:e=>{let r=(Math.floor(Date.now()/1e3)-e.createdAt)/(365*24*60*60);return r>=3?{shouldAssign:true,confidence:Math.min(1e4,Math.floor(r*1e3)+7e3),evidenceCount:Math.floor(r),reason:`Active for ${r.toFixed(1)} years`}:{shouldAssign:false,confidence:0,evidenceCount:0}}}];}async calculateTags(e){let t=[],o=Math.floor(Date.now()/1e3);for(let r of this.tagCriteria){let c=r.evaluate(e);c.shouldAssign&&c.confidence>=r.minConfidence&&t.push({tagName:r.tag,confidence:c.confidence,evidenceCount:c.evidenceCount,lastUpdated:o});}return t}applyTagDecay(e,t){let o=t||Math.floor(Date.now()/1e3),r=[];for(let c of e){let i=o-c.lastUpdated,d=i/(1440*60),s=Math.floor(d*this.decayConfig.decayRatePerDay),p=Math.max(0,c.confidence-s);p>=this.decayConfig.minConfidence&&i<=this.decayConfig.maxAgeSeconds&&r.push({...c,confidence:p});}return r}mergeTags(e,t){let o=new Map;for(let r of e)o.set(r.tagName,r);for(let r of t){let c=o.get(r.tagName);c?(r.confidence>c.confidence||r.evidenceCount>c.evidenceCount)&&o.set(r.tagName,r):o.set(r.tagName,r);}return Array.from(o.values())}filterTags(e,t){let o=[...e],r=Math.floor(Date.now()/1e3);return t.category&&(o=o.filter(c=>this.getTagCategory(c.tagName)===t.category)),t.minConfidence!==void 0&&(o=o.filter(c=>c.confidence>=t.minConfidence)),t.maxAge!==void 0&&(o=o.filter(c=>r-c.lastUpdated<=t.maxAge)),t.activeOnly&&(o=o.filter(c=>r-c.lastUpdated<=z.STALE_TAG_THRESHOLD&&c.confidence>=this.decayConfig.minConfidence)),o}getTagCategory(e){return Object.values(lu).includes(e)?"skill":Object.values(mu).includes(e)?"behavior":Object.values(yu).includes(e)?"compliance":"behavior"}validateTagName(e){return e.length>0&&e.length<=z.MAX_TAG_NAME_LENGTH}validateConfidence(e){return e>=0&&e<=z.MAX_TAG_CONFIDENCE}getConfidenceLevel(e){return e>=1e4?"Absolute":e>=9500?"Very High":e>=8e3?"High":e>=6e3?"Medium":e>=4e3?"Low":"Very Low"}sortByConfidence(e){return [...e].sort((t,o)=>o.confidence-t.confidence)}sortByEvidence(e){return [...e].sort((t,o)=>o.evidenceCount-t.evidenceCount)}sortByRecent(e){return [...e].sort((t,o)=>o.lastUpdated-t.lastUpdated)}getTopTags(e,t){return this.sortByConfidence(e).slice(0,t)}categorizeTags(e){let t=[],o=[],r=[],c=[];for(let i of e)switch(c.push(i.tagName),this.getTagCategory(i.tagName)){case "skill":t.push(i.tagName);break;case "behavior":o.push(i.tagName);break;case "compliance":r.push(i.tagName);break}return {allTags:c,skillTags:t,behaviorTags:o,complianceTags:r,tagScores:e,lastUpdated:e.length>0?Math.max(...e.map(i=>i.lastUpdated)):0}}};});var E0={};oe(E0,{MultiSourceAggregator:()=>hf});var hf,P0=a(()=>{hf=class{adapters=new Map;configs=new Map;CONFLICT_THRESHOLD=300;constructor(){}addSource(e,t){t.enabled&&(this.adapters.set(e.source,e),this.configs.set(e.source,t));}removeSource(e){this.adapters.delete(e),this.configs.delete(e);}updateSourceWeight(e,t){let o=this.configs.get(e);o&&(o.weight=t);}updateSourceReliability(e,t){let o=this.configs.get(e);o&&(o.reliability=t);}async aggregateReputation(e){let t=[];for(let[s,p]of this.adapters.entries())try{let E=await p.fetchReputationData(e.toString());p.validateData(E)&&t.push(E);}catch(E){console.warn(`Failed to fetch reputation from ${s}:`,E);}let o=this.calculateWeightedScore(t),{hasConflicts:r,conflicts:c}=this.detectConflicts(t),i=this.buildSourceBreakdowns(t),d=t.reduce((s,p)=>s+p.dataPoints,0);return {agentId:e,aggregateScore:o,sourceScores:i,hasConflicts:r,conflicts:c,totalDataPoints:d,timestamp:new Date}}calculateWeightedScore(e){if(e.length===0)return 0;let t=0,o=0;for(let r of e){let c=this.configs.get(r.source);if(!c)continue;let i=c.weight/1e4,d=r.reliability,s=r.score*i*d,p=i*d;t+=s,o+=p;}return o===0?0:Math.round(t/o)}detectConflicts(e){if(e.length<2)return {hasConflicts:false,conflicts:[]};let t=e.map(d=>d.score),o=Math.max(...t),r=Math.min(...t),c=o-r,i=[];if(c>this.CONFLICT_THRESHOLD){let d=e.find(p=>p.score===o)?.source,s=e.find(p=>p.score===r)?.source;return i.push(`High variance detected: ${c} (${(c/1e3*100).toFixed(1)}%) between ${d} (${o}) and ${s} (${r})`),{hasConflicts:true,conflicts:i}}return {hasConflicts:false,conflicts:[]}}buildSourceBreakdowns(e){return e.map(t=>{let o=this.configs.get(t.source);if(!o)throw new Error(`No config found for source: ${t.source}`);let r=o.weight,c=t.reliability*1e4,i=t.score*(r/1e4)*(c/1e4)/this.calculateNormalizationFactor(e);return {source:t.source,score:t.score,weight:r,reliability:Math.round(c),dataPoints:t.dataPoints,contribution:Math.round(i),lastUpdated:t.timestamp}})}calculateNormalizationFactor(e){let t=0;for(let o of e){let r=this.configs.get(o.source);if(!r)continue;let c=r.weight/1e4,i=o.reliability;t+=c*i;}return t||1}async getSourceBreakdown(e){return (await this.aggregateReputation(e)).sourceScores}getRegisteredSources(){return Array.from(this.adapters.keys())}getSourceConfig(e){return this.configs.get(e)}enableSource(e){let t=this.configs.get(e);t&&(t.enabled=true);}disableSource(e){let t=this.configs.get(e);t&&(t.enabled=false);}isSourceEnabled(e){return this.configs.get(e)?.enabled??false}};});te();of();var cf={CONSERVATIVE:{name:"Conservative",mode:"TierOnly",metricVisibility:{showScore:"Private",showJobsCompleted:"Private",showSuccessRate:"Private",showResponseTime:"Private",showDisputes:"Private",showEarnings:"Private",showRatings:"Private",showBadges:"Public"},autoGrantClients:false},BALANCED:{name:"Balanced",mode:"Custom",metricVisibility:{showScore:"Private",showJobsCompleted:"Public",showSuccessRate:"Public",showResponseTime:"Public",showDisputes:"Private",showEarnings:"Private",showRatings:"Public",showBadges:"Public"},autoGrantClients:true},OPEN:{name:"Open",mode:"Public",metricVisibility:{showScore:"Public",showJobsCompleted:"Public",showSuccessRate:"Public",showResponseTime:"Public",showDisputes:"Public",showEarnings:"Public",showRatings:"Public",showBadges:"Public"},autoGrantClients:true}},De={SCORE_RANGES:{LOW:{min:2e3},MEDIUM:{min:5e3},HIGH:{min:7500},VERY_HIGH:{min:9e3}},TIER_THRESHOLDS:{BRONZE:2e3,SILVER:5e3,GOLD:7500,PLATINUM:9e3},MAX_AUTHORIZED_VIEWERS:100};D();function jU(n){return typeof n!="object"||n===null?false:typeof n.IpfsHash=="string"}var yt=class{rpc;rpcSubscriptions;commitment;endpoint;maxRetries;retryDelay;timeout;constructor(e){this.endpoint=e.endpoint,this.rpc=createSolanaRpc(e.endpoint),this.commitment=e.commitment??"confirmed",this.maxRetries=e.maxRetries??3,this.retryDelay=e.retryDelay??1e3,this.timeout=e.timeout??6e4,e.wsEndpoint&&(this.rpcSubscriptions=createSolanaRpcSubscriptions(e.wsEndpoint));}async getAccountInfo(e,t){return this.withRetry(async()=>{let o=await this.rpc.getAccountInfo(e,{commitment:t?.commitment??this.commitment,encoding:"base64"}).send();return o.value?this.parseAccountInfo(o.value):null})}async getMultipleAccounts(e,t){return this.withRetry(async()=>(await this.rpc.getMultipleAccounts(e,{commitment:t?.commitment??this.commitment,encoding:"base64"}).send()).value.map(r=>r?this.parseAccountInfo(r):null))}async getProgramAccounts(e,t){return this.withRetry(async()=>(await this.rpc.getProgramAccounts(e,{commitment:t?.commitment??this.commitment,encoding:"base64",filters:t?.filters}).send()).map(r=>{let c=r;return {pubkey:c.pubkey,account:this.parseAccountInfo(c.account)}}))}blockhashCache=null;async getLatestBlockhash(){let e=Date.now();if(this.blockhashCache&&e-this.blockhashCache.timestamp<1e3)return this.blockhashCache.value;let t=await this.withRetry(async()=>{let o=await this.rpc.getLatestBlockhash({commitment:this.commitment}).send();return {blockhash:o.value.blockhash,lastValidBlockHeight:BigInt(o.value.lastValidBlockHeight)}});return this.blockhashCache={value:t,timestamp:e},t}async sendTransaction(e,t){return this.withRetry(async()=>await this.rpc.sendTransaction(e,{encoding:"base64",skipPreflight:t?.skipPreflight??false,preflightCommitment:t?.preflightCommitment??this.commitment,maxRetries:t?.maxRetries?BigInt(t.maxRetries):void 0}).send())}async getSignatureStatuses(e){return this.withRetry(async()=>(await this.rpc.getSignatureStatuses(e).send()).value.map(o=>{if(!o)return null;let r=o;return {slot:r.slot,confirmations:r.confirmations,err:r.err,confirmationStatus:r.confirmationStatus}}))}async simulateTransaction(e,t){return this.withRetry(async()=>{let o=await this.rpc.simulateTransaction(e,{encoding:"base64",commitment:t?.commitment??this.commitment,replaceRecentBlockhash:t?.replaceRecentBlockhash??false}).send();return {err:o.value.err,logs:o.value.logs??[],unitsConsumed:o.value.unitsConsumed?BigInt(o.value.unitsConsumed):void 0,returnData:o.value.returnData}})}async getFeeForMessage(e){return this.withRetry(async()=>{let t=await this.rpc.getFeeForMessage(e,{commitment:this.commitment}).send();return t.value?BigInt(t.value):null})}async isHealthy(){try{return await this.rpc.getHealth().send(),!0}catch{return false}}async getVersion(){return await this.rpc.getVersion().send()}async subscribeToAccount(e,t){if(!this.rpcSubscriptions)throw new Error("WebSocket endpoint not configured");console.warn("Account subscription is not fully implemented in this version");let o=setInterval(async()=>{try{let r=await this.getAccountInfo(e);t(r);}catch(r){console.error("Subscription polling error:",r);}},5e3);return ()=>{clearInterval(o);}}async withRetry(e,t=this.maxRetries){let o;for(let r=0;r<=t;r++)try{return await e()}catch(c){o=c,r<t&&await new Promise(i=>setTimeout(i,this.retryDelay*Math.pow(2,r)));}throw o}parseAccountInfo(e){let t=e,o=t.data,r=Array.isArray(o)?o[0]:o;return {executable:t.executable,lamports:typeof t.lamports=="number"?lamports(BigInt(t.lamports)):t.lamports,owner:t.owner,rentEpoch:t.rentEpoch!==void 0?typeof t.rentEpoch=="number"?BigInt(t.rentEpoch):t.rentEpoch:BigInt(0),data:Buffer.from(r,"base64"),space:t.space?typeof t.space=="number"?BigInt(t.space):t.space:void 0}}};function v1e(n,e="mainnet-beta"){let t="https://explorer.solana.com/tx";switch(e){case "devnet":return `${t}/${n}?cluster=devnet`;case "testnet":return `${t}/${n}?cluster=testnet`;case "localnet":return `${t}/${n}?cluster=custom&customUrl=http://localhost:8899`;default:return `${t}/${n}`}}function M1e(n,e="mainnet-beta"){let t="https://solscan.io/tx";switch(e){case "devnet":return `${t}/${n}?cluster=devnet`;case "testnet":return `${t}/${n}?cluster=testnet`;case "localnet":return `Local transaction: ${n} (not viewable on Solscan)`;default:return `${t}/${n}`}}function k1e(n,e="mainnet-beta"){let t="https://solana.fm/tx";switch(e){case "devnet":return `${t}/${n}?cluster=devnet-solana`;case "testnet":return `${t}/${n}?cluster=testnet-solana`;case "localnet":return `Local transaction: ${n} (not viewable on SolanaFM)`;default:return `${t}/${n}`}}function w1e(n,e="mainnet-beta"){let t="https://xray.helius.xyz/tx";switch(e){case "devnet":return `${t}/${n}?network=devnet`;case "testnet":return `${t}/${n}?network=testnet`;case "localnet":return `Local transaction: ${n} (not viewable on XRAY)`;default:return `${t}/${n}`}}function U1e(n,e="mainnet-beta"){return {solanaExplorer:v1e(n,e),solscan:M1e(n,e),solanaFM:k1e(n,e),xray:w1e(n,e)}}function sf(n,e,t="confirmed"){return {signature:n,cluster:e,urls:U1e(n,e),commitment:t,timestamp:Date.now()}}function af(n,e){console.error("\u{1F6A8} GhostSpeak SDK Error:",n.message),e&&(e.operation&&console.error("\u{1F527} Operation:",e.operation),e.instructionName&&console.error("\u{1F4CB} Instruction:",e.instructionName),e.accounts&&(console.error("\u{1F3E6} Accounts provided:",e.accounts.length),e.accounts.forEach((t,o)=>{if(typeof t=="string")console.error(` ${o+1}. ${t}`);else if(typeof t=="object"){let r="address"in t?t.address:t,c="name"in t?t.name:void 0;console.error(` ${o+1}. ${r}${c?` (${c})`:""}`);}else console.error(` ${o+1}. ${String(t)}`);})),e.params&&console.error("\u2699\uFE0F Parameters:",e.params)),console.error(`
|
|
2
|
+
\u{1F4A1} Troubleshooting tips:`),console.error(" 1. Check that all required accounts are provided"),console.error(" 2. Verify account addresses are correct"),console.error(" 3. Ensure signers have sufficient SOL for transaction fees"),console.error(" 4. Confirm the program is deployed on the target network");}function df(n,e,t,o){return {operation:n,instructionName:e,accounts:t,params:o}}var Tu=class n{static instance=null;rpcClient;config;isDevelopment;logs=[];timings=new Map;constructor(e){this.config=e,this.rpcClient=new yt({endpoint:e.rpcEndpoint??"https://api.devnet.solana.com",commitment:e.commitment}),this.isDevelopment=process.env.NODE_ENV==="development"||e.cluster==="localnet"||false;}static getInstance(e){if(!n.instance&&e&&(n.instance=new n(e)),!n.instance)throw new Error("DevTools not initialized. Call with config first.");return n.instance}enableDevMode(){this.isDevelopment=true,console.log("\u{1F6E0}\uFE0F GhostSpeak Development Mode Enabled"),console.log(" - Transaction simulation before sending"),console.log(" - Cost estimates for all operations"),console.log(" - Enhanced error messages"),console.log(" - Performance timing");}isDevMode(){return this.isDevelopment}analyzeTransaction(e){let t=new Set,o=new Set,r=new Set,c=[],i=64,d=e.map((E,b)=>{i+=32,i+=(E.accounts?.length??0)*32,i+=E.data?.length??0;let x=(E.accounts??[]).map(P=>{let w=P.role.toString().includes("writable")||P.role.toString().includes("WRITABLE")||P.role===1||P.role===3,W=P.role.toString().includes("signer")||P.role.toString().includes("SIGNER")||typeof P=="object"&&"signer"in P||P.role===3;return w?t.add(P.address):o.add(P.address),W&&r.add(P.address),{address:P.address,isWritable:w,isSigner:W,role:P.role}}),k=this.getInstructionDescription(E,b);return {index:b,programId:E.programAddress,accountCount:x.length,dataSize:E.data?.length??0,humanReadable:k,accounts:x}}),s=this.estimateComputeUnits(e),p=this.estimateFee(s,e.length);return i>1232&&c.push(`Transaction size (${i} bytes) exceeds limit (1232 bytes)`),r.size===0&&c.push("No signers found in transaction"),s>BigInt(14e5)&&c.push(`High compute usage: ${s} units`),{instructions:d,totalAccounts:t.size+o.size,signerCount:r.size,writableAccounts:Array.from(t),readonlyAccounts:Array.from(o),estimatedSize:i,estimatedComputeUnits:s,estimatedFee:p,warnings:c}}getInstructionDescription(e,t){let o=e.programAddress;return o===this.config.programId?this.decodeGhostSpeakInstruction(e):o==="11111111111111111111111111111111"?"System Program: Transfer or Create Account":o==="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"?"Token Program: Token Operation":o==="TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"?"Token-2022 Program: Advanced Token Operation":"Unknown Instruction"}decodeGhostSpeakInstruction(e){if(!e.data||e.data.length<8)return "GhostSpeak: Unknown Instruction";let t=Array.from(e.data.slice(0,8)).map(r=>r.toString(16).padStart(2,"0")).join("");return `GhostSpeak: ${{a8c5e109d3d1b8d5:"Register Agent",b7f3c8e0a2d4e9f1:"Create Escrow",c4d2f7a9b8e1c3f5:"Send Message",d9e8f2b5c1a7e4f8:"Create Channel"}[t]??"Custom Instruction"}`}estimateComputeUnits(e){let t=BigInt(0);for(let o of e)t+=BigInt(200),t+=BigInt((o.accounts?.length??0)*150),t+=BigInt((o.data?.length??0)*10),o.programAddress===this.config.programId&&(t+=BigInt(5e3));return t}estimateFee(e,t){let o=BigInt(5e3),r=e*BigInt(5)/BigInt(1e6),c=BigInt(t*1e3);return o+r+c}log(e,t){if(!this.isDevelopment)return;let r=`[${new Date().toISOString()}] ${e}`;this.logs.push(r),console.log(`\u{1F50D} ${r}`),t&&console.log(" Data:",t);}startTiming(e){if(!this.isDevelopment)return;let t=typeof performance<"u"?performance.now():Date.now();this.timings.set(e,t);}endTiming(e){if(!this.isDevelopment)return;let t=this.timings.get(e);if(!t)return;let r=(typeof performance<"u"?performance.now():Date.now())-t;this.log(`${e} took ${r.toFixed(2)}ms`),this.timings.delete(e);}formatTransaction(e){let t=["\u{1F4CB} Transaction Analysis","\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550",`Instructions: ${e.instructions.length}`,`Total Accounts: ${e.totalAccounts}`,`Signers: ${e.signerCount}`,`Estimated Size: ${e.estimatedSize} bytes`,`Estimated Compute Units: ${e.estimatedComputeUnits.toLocaleString()}`,`Estimated Fee: ${(Number(e.estimatedFee)/1e9).toFixed(6)} SOL`,""];t.push("Instructions:");for(let o of e.instructions)t.push(` ${o.index+1}. ${o.humanReadable}`),t.push(` Program: ${o.programId.slice(0,8)}...`),t.push(` Accounts: ${o.accountCount}, Data: ${o.dataSize} bytes`);if(e.warnings.length>0){t.push(""),t.push("\u26A0\uFE0F Warnings:");for(let o of e.warnings)t.push(` - ${o}`);}return t.push("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"),t.join(`
|
|
3
|
+
`)}exportLogs(){return [...this.logs]}clearLogs(){this.logs=[],this.timings.clear();}};function xu(n){if(!n.programAddress)throw new Error("Invalid instruction format")}var Du=class{rpcClient;config;devTools;debugMode=false;constructor(e){this.config=e,this.rpcClient=new yt({endpoint:e.rpcEndpoint??"https://api.devnet.solana.com",wsEndpoint:e.wsEndpoint,commitment:e.commitment??"confirmed"}),this.devTools=Tu.getInstance(e);}async execute(e,t,o,r){let c=df("execute",e,o.map(i=>({address:i.address,name:"signer"})),{programId:this.config.programId});try{this.devTools.isDevMode()&&this.devTools.startTiming(e);let i=await Promise.resolve(t());if(xu(i),this.debugMode||this.devTools.isDevMode()){let k=this.devTools.analyzeTransaction([i]);console.log(this.devTools.formatTransaction(k)),this.debugMode=!1;}if(r?.simulate)return await this.simulateInstruction(i,o);let d=await this.rpcClient.getLatestBlockhash(),s={blockhash:d.blockhash,lastValidBlockHeight:d.lastValidBlockHeight},p=pipe(createTransactionMessage({version:0}),k=>setTransactionMessageFeePayerSigner(o[0],k),k=>setTransactionMessageLifetimeUsingBlockhash(s,k),k=>appendTransactionMessageInstructions([i],k)),E=await signTransactionMessageWithSigners(p),b=await this.sendAndConfirm(E,r?.skipPreflight??!1,r?.maxRetries??30);if(typeof b!="string")throw new Error("Transaction signature is not a string");let x=b;if(r?.returnDetails){let k=this.config.cluster??"devnet",P=sf(x,k,this.config.commitment??"confirmed");return this.devTools.isDevMode()&&this.devTools.endTiming(e),P}return this.devTools.isDevMode()&&this.devTools.endTiming(e),x}catch(i){throw af(i,c),i}}async executeBatch(e,t,o,r){let c=df("executeBatch",e,o.map(i=>({address:i.address,name:"signer"})),{programId:this.config.programId,instructionCount:t.length});try{let i=await Promise.all(t.map(async(P,w)=>{let W=await Promise.resolve(P());try{return xu(W),W}catch(R){throw new Error(`Instruction ${w} in ${e}: ${R.message}`)}})),d=this.estimateTransactionSize(i);if(d>1232)throw new Error(`Transaction too large: ${d} bytes (max: 1232)`);if(r?.simulate)return await this.simulateBatch(i,o);let s=await this.rpcClient.getLatestBlockhash(),p={blockhash:s.blockhash,lastValidBlockHeight:s.lastValidBlockHeight},E=pipe(createTransactionMessage({version:0}),P=>setTransactionMessageFeePayerSigner(o[0],P),P=>setTransactionMessageLifetimeUsingBlockhash(p,P),P=>appendTransactionMessageInstructions(i,P)),b=await signTransactionMessageWithSigners(E),x=await this.sendAndConfirm(b,r?.skipPreflight??!1);if(typeof x!="string")throw new Error("Transaction signature is not a string");let k=x;if(r?.returnDetails){let P=this.config.cluster??"devnet",w=sf(k,P,this.config.commitment??"confirmed");return this.devTools.isDevMode()&&this.devTools.endTiming(e),w}return this.devTools.isDevMode()&&this.devTools.endTiming(e),k}catch(i){throw af(i,c),i}}async getAccount(e,t){try{let o=await this.rpcClient.getAccountInfo(e,{commitment:this.config.commitment});if(!o)return null;let c=(await Promise.resolve().then(()=>(te(),pu)))[t],i=c(),d=this.extractRawData(o.data);return i.decode(d)}catch(o){return console.warn(`Failed to fetch account ${e}:`,o),null}}async getAccounts(e,t){try{let o=await this.rpcClient.getMultipleAccounts(e,{commitment:this.config.commitment}),c=(await Promise.resolve().then(()=>(te(),pu)))[t],i=c();return o.map(d=>{if(!d)return null;try{let s=this.extractRawData(d.data);return i.decode(s)}catch{return null}})}catch(o){return console.warn("Failed to fetch multiple accounts:",o),e.map(()=>null)}}async getProgramAccounts(e,t){try{let o=t?.map(p=>"dataSize"in p?{dataSize:p.dataSize}:(p.memcmp.encoding??"base58")==="base64"?{memcmp:{offset:p.memcmp.offset,bytes:p.memcmp.bytes,encoding:"base64"}}:{memcmp:{offset:p.memcmp.offset,bytes:p.memcmp.bytes,encoding:"base58"}}),r=await this.rpcClient.getProgramAccounts(this.config.programId,{commitment:this.config.commitment,filters:o??[]}),i=(await Promise.resolve().then(()=>(te(),pu)))[e],d=i(),s=[];for(let{pubkey:p,account:E}of r)try{let b=this.extractRawData(E.data),x=d.decode(b);s.push({address:p,data:x});}catch{}return s}catch(o){return console.error("Failed to get program accounts:",o),[]}}enableDebug(){return this.debugMode=true,this}async debug(e,t){this.devTools.log(`Debugging ${e}`);let o=await Promise.all(t.map(async c=>{let i=await Promise.resolve(c());return xu(i),i})),r=this.devTools.analyzeTransaction(o);return console.log(this.devTools.formatTransaction(r)),r}async explain(e,t){let o=await this.debug(e,t),r=[`\u{1F50D} Transaction: ${e}`,"","This transaction will:",...o.instructions.map((c,i)=>` ${i+1}. ${c.humanReadable}`),"",`Cost: ~${(Number(o.estimatedFee)/1e9).toFixed(6)} SOL`,`Size: ${o.estimatedSize} bytes`,`Compute: ${o.estimatedComputeUnits.toLocaleString()} units`];return o.warnings.length>0&&(r.push("","\u26A0\uFE0F Warnings:"),r.push(...o.warnings.map(c=>` - ${c}`))),r.join(`
|
|
4
|
+
`)}async estimateCost(e){try{let t=await Promise.all(e.map(async p=>{let E=await Promise.resolve(p());return xu(E),E})),o=await this.rpcClient.getLatestBlockhash(),r={blockhash:o.blockhash,lastValidBlockHeight:o.lastValidBlockHeight},c=pipe(createTransactionMessage({version:0}),p=>setTransactionMessageFeePayer(this.config.defaultFeePayer,p),p=>setTransactionMessageLifetimeUsingBlockhash(r,p),p=>appendTransactionMessageInstructions(t,p)),i=compileTransactionMessage(c),d=Buffer.from(i).toString("base64"),s=await this.rpcClient.getFeeForMessage(d);return BigInt(s??0)}catch{return 5000n+BigInt(e.length)*1000n}}async sendAndConfirm(e,t,o=30){let r=getBase64EncodedWireTransaction(e),c=await this.rpcClient.sendTransaction(r,{skipPreflight:t,preflightCommitment:this.config.commitment});console.log("\u{1F50D} Transaction sent, signature:",c),console.log("\u{1F50D} Signature length:",c.length),console.log("\u{1F50D} Signature type:",typeof c);let i=false,d=0,s=1e3,p=3e4,E=Date.now();for(;!i&&d<o&&Date.now()-E<p;)try{console.log(`\u{1F50D} Confirmation attempt ${d+1}/${o}`);let b=await this.rpcClient.getSignatureStatuses([c]);if(b[0]){if(console.log("\u{1F50D} Status found:",b[0]),b[0].err)throw new Error(`Transaction failed: ${JSON.stringify(b[0].err,(k,P)=>typeof P=="bigint"?P.toString():P)}`);let x=b[0].confirmationStatus;if(x===this.config.commitment||this.config.commitment==="confirmed"&&x==="finalized"){i=!0,console.log("\u2705 Transaction confirmed via status check");break}}else {console.log("\u{1F50D} No status found, trying transaction details...");try{let{createSolanaRpc:x}=await import('@solana/kit'),P=await x(this.config.rpcEndpoint??"https://api.devnet.solana.com").getTransaction(c,{commitment:this.config.commitment??"confirmed",encoding:"json",maxSupportedTransactionVersion:0}).send();if(P&&P.meta){if(P.meta.err)throw new Error(`Transaction failed: ${JSON.stringify(P.meta.err,(w,W)=>typeof W=="bigint"?W.toString():W)}`);i=!0,console.log("\u2705 Transaction confirmed via direct lookup");break}}catch{console.log("\u{1F50D} Transaction details not yet available");}}d++,await new Promise(x=>setTimeout(x,s)),s=Math.min(s*1.5,5e3);}catch(b){if(b instanceof Error&&b.message.includes("Transaction failed"))throw b;console.log("\u{1F50D} Confirmation attempt failed:",b.message),d++,await new Promise(x=>setTimeout(x,s*2));}if(!i){console.log("\u{1F50D} Final confirmation attempt via transaction lookup...");try{let{createSolanaRpc:b}=await import('@solana/kit'),k=await b(this.config.rpcEndpoint??"https://api.devnet.solana.com").getTransaction(c,{commitment:this.config.commitment??"confirmed",encoding:"json",maxSupportedTransactionVersion:0}).send();if(k&&k.meta){if(k.meta.err)throw new Error(`Transaction failed: ${JSON.stringify(k.meta.err,(P,w)=>typeof w=="bigint"?w.toString():w)}`);return console.log("\u2705 Transaction confirmed on final check - returning success"),c}}catch(b){console.log("\u{1F50D} Final check failed:",b.message);}return console.log("\u26A0\uFE0F Transaction confirmation timed out, but transaction was sent"),console.log(` Check status at: https://explorer.solana.com/tx/${c}?cluster=${this.config.cluster||"devnet"}`),c}return c}async simulateInstruction(e,t){let o=await this.rpcClient.getLatestBlockhash(),r={blockhash:o.blockhash,lastValidBlockHeight:o.lastValidBlockHeight},c=pipe(createTransactionMessage({version:0}),s=>setTransactionMessageFeePayerSigner(t[0],s),s=>setTransactionMessageLifetimeUsingBlockhash(r,s),s=>appendTransactionMessageInstructions([e],s)),i=await signTransactionMessageWithSigners(c),d=getBase64EncodedWireTransaction(i);return this.rpcClient.simulateTransaction(d,{commitment:this.config.commitment,replaceRecentBlockhash:true})}async simulateBatch(e,t){let o=await this.rpcClient.getLatestBlockhash(),r={blockhash:o.blockhash,lastValidBlockHeight:o.lastValidBlockHeight},c=pipe(createTransactionMessage({version:0}),s=>setTransactionMessageFeePayerSigner(t[0],s),s=>setTransactionMessageLifetimeUsingBlockhash(r,s),s=>appendTransactionMessageInstructions(e,s)),i=await signTransactionMessageWithSigners(c),d=getBase64EncodedWireTransaction(i);return this.rpcClient.simulateTransaction(d,{commitment:this.config.commitment,replaceRecentBlockhash:true})}estimateTransactionSize(e){let t=64;for(let o of e)t+=32,t+=(o.accounts?.length??0)*32,t+=o.data.length;return t}extractRawData(e){if(Buffer.isBuffer(e)||e instanceof Uint8Array)return new Uint8Array(e);if(typeof e=="object"&&e!==null&&"data"in e)return Buffer.from(e.data,"base64");if(typeof e=="string")return Buffer.from(e,"base64");throw new Error("Invalid account data format")}async createCommunicationSession(e){return {programAddress:this.config.programId,accounts:[],data:new Uint8Array(0)}}async sendCommunicationMessage(e,t){return {programAddress:this.config.programId,accounts:[],data:new Uint8Array(0)}}async updateParticipantStatus(e){return {programAddress:this.config.programId,accounts:[],data:new Uint8Array(0)}}};var hu={processed:500,confirmed:2e3,finalized:3e4},Eu=class{accountCache;pdaCache;config;ttls;constructor(e={}){this.config={enabled:e.enabled??false,maxSize:e.maxSize??1e3,ttlOverrides:e.ttlOverrides??{}},this.ttls={processed:e.ttlOverrides?.processed??hu.processed,confirmed:e.ttlOverrides?.confirmed??hu.confirmed,finalized:e.ttlOverrides?.finalized??hu.finalized},this.accountCache=new LRUCache({max:this.config.maxSize,ttl:hu.finalized}),this.pdaCache=new LRUCache({max:this.config.maxSize});}isEnabled(){return this.config.enabled}getAccount(e,t,o){if(!this.config.enabled)return;let r=`${e}:${t}`,c=this.accountCache.get(r);if(c){if(o!==void 0&&c.slot<o){this.accountCache.delete(r);return}return c.data}}setAccount(e,t,o,r){if(!this.config.enabled)return;let c=`${e}:${o}`,i={data:t,slot:r,commitment:o,timestamp:Date.now()};this.accountCache.set(c,i,{ttl:this.ttls[o]});}getPDA(e){if(this.config.enabled)return this.pdaCache.get(e)}setPDA(e,t){this.config.enabled&&this.pdaCache.set(e,t);}invalidateAccount(e,t){this.config.enabled&&(t?this.accountCache.delete(`${e}:${t}`):["processed","confirmed","finalized"].forEach(o=>{this.accountCache.delete(`${e}:${o}`);}));}clear(){this.accountCache.clear(),this.pdaCache.clear();}getStats(){return {accountCache:{size:this.accountCache.size,max:this.config.maxSize},pdaCache:{size:this.pdaCache.size,max:this.config.maxSize}}}};var U=class{builder;config;logger;cacheManager;_debugMode=false;constructor(e){this.config=e,this.builder=new Du(e),this.cacheManager=new Eu(e.cache),this.logger=e.logger;}debug(){return this._debugMode=true,this.builder.enableDebug(),this}async execute(e,t,o){return this.builder.execute(e,t,o)}async executeWithDetails(e,t,o){return this.builder.execute(e,t,o,{returnDetails:true})}async executeBatch(e,t,o){return this.builder.executeBatch(e,t.map(r=>()=>Promise.resolve(r())),o)}async simulate(e,t,o){return this.builder.execute(e,()=>Promise.resolve(t()),o,{simulate:true})}async simulateInstruction(e,t,o){return this.simulate(e,t,o)}async estimateCost(e){return this.builder.estimateCost(e)}async getCost(e,t){return this.builder.estimateCost([t])}async explain(e,t){return this.builder.explain(e,[t])}async analyze(e,t){return this.builder.debug(e,[t])}async getAccount(e,t){if(this.cacheManager.isEnabled()){let r=this.cacheManager.getAccount(e,this.commitment);if(r!==void 0)return this.logger?.info(`[Cache HIT] ${e}`),r}let o=await this.builder.getAccount(e,t);return this.cacheManager.isEnabled()&&o!==null&&(this.cacheManager.setAccount(e,o,this.commitment,0),this.logger?.info(`[Cache SET] ${e}`)),o}async getAccounts(e,t){if(!this.cacheManager.isEnabled())return this.builder.getAccounts(e,t);let o=new Array(e.length),r=[],c=[];for(let i=0;i<e.length;i++){let d=this.cacheManager.getAccount(e[i],this.commitment);d!==void 0?(o[i]=d,this.logger?.info(`[Cache HIT] ${e[i]}`)):(r.push(i),c.push(e[i]));}if(c.length>0){this.logger?.info(`[Cache MISS] Fetching ${c.length}/${e.length} accounts`);let i=await this.builder.getAccounts(c,t),d=0;for(let s=0;s<i.length;s++){let p=r[s],E=i[s];o[p]=E,E!==null&&this.cacheManager.setAccount(c[s],E,this.commitment,d);}}return o}async getProgramAccounts(e,t){return this.builder.getProgramAccounts(e,t)}get programId(){return this.config.programId}getProgramId(){return this.config.programId}get commitment(){return this.config.commitment??"confirmed"}getCommitment(){return this.config.commitment??"confirmed"}invalidateCache(e){this.cacheManager.invalidateAccount(e),this.logger?.info(`[Cache INVALIDATE] ${e}`);}clearCache(){this.cacheManager.clear(),this.logger?.info("[Cache CLEAR] All caches cleared");}getCacheStats(){return this.cacheManager.getStats()}};var qU=new Map,gf=0,Pu=class{constructor(e){this.config=e;console.log("\u{1F9EA} Initialized TestIPFSProvider for local testing (shared storage)");}storage=qU;uploadCount=0;async upload(e,t){gf++;let o=typeof e=="string"?e:new TextDecoder().decode(e),r=`Qm${this.generateHash(o)}_test_${gf}`;this.storage.set(r,{content:e,pinned:t?.pin!==false});let c=typeof e=="string"?new TextEncoder().encode(e).length:e.length;return console.log(`\u{1F4E6} Test IPFS upload: ${r} (${c} bytes)`),{hash:r,uri:`ipfs://${r}`,size:c,timestamp:Date.now(),pinned:t?.pin!==false,gateways:[`http://localhost:8080/ipfs/${r}`,`https://test.ipfs.io/ipfs/${r}`]}}async retrieve(e){let t=this.storage.get(e);if(!t)throw new Error(`Test IPFS: Content not found for hash ${e}`);return console.log(`\u{1F4E5} Test IPFS retrieve: ${e}`),await new Promise(o=>setTimeout(o,100)),t.content}async pin(e){let t=this.storage.get(e);return t?(t.pinned=true,console.log(`\u{1F4CC} Test IPFS pin: ${e}`),{hash:e,success:true,status:"pinned"}):{hash:e,success:false,status:"failed",error:`Content not found: ${e}`}}async unpin(e){let t=this.storage.get(e);return t?(t.pinned=false,console.log(`\u{1F4CC} Test IPFS unpin: ${e}`),{hash:e,success:true,status:"pinned"}):{hash:e,success:false,status:"failed",error:`Content not found: ${e}`}}generateHash(e){let t=0;for(let i=0;i<e.length;i++){let d=e.charCodeAt(i);t=(t<<5)-t+d,t=t&t;}let o="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",r="",c=Math.abs(t);for(;c>0&&r.length<40;)r=o[c%o.length]+r,c=Math.floor(c/o.length);for(;r.length<40;)r=o[Math.floor(Math.random()*o.length)]+r;return r}getStats(){let e=0,t=0;for(let o of this.storage.values()){let r=typeof o.content=="string"?new TextEncoder().encode(o.content).length:o.content.length;e+=r,o.pinned&&t++;}return {count:this.storage.size,totalSize:e,pinned:t}}clear(){this.storage.clear(),gf=0,console.log("\u{1F9F9} Test IPFS storage cleared");}static getSharedStorage(){return qU}};var Af=class{constructor(e){this.config=e;}async upload(e,t){let o=this.config.endpoint??"https://api.pinata.cloud",r=new FormData,c=new Blob([e],{type:t?.contentType??"application/octet-stream"});r.append("file",c,t?.filename??"content"),t?.metadata&&r.append("pinataMetadata",JSON.stringify({name:t.filename??"ghostspeak-content",keyvalues:t.metadata}));let i=await fetch(`${o}/pinning/pinFileToIPFS`,{method:"POST",headers:{Authorization:`Bearer ${this.config.jwt??this.config.apiKey}`,...this.config.headers},body:r});if(!i.ok){let p=await i.text();throw new Error(`Pinata upload failed: ${i.status} ${p}`)}let d=await i.json(),s=typeof e=="string"?new TextEncoder().encode(e).length:e.length;if(!jU(d))throw new Error("Invalid IPFS upload response format");return {hash:d.IpfsHash,uri:`ipfs://${d.IpfsHash}`,size:s,timestamp:Date.now(),pinned:true,gateways:[`https://gateway.pinata.cloud/ipfs/${d.IpfsHash}`,`https://ipfs.io/ipfs/${d.IpfsHash}`]}}async retrieve(e,t){let r=`${t?.gateway??"https://gateway.pinata.cloud"}/ipfs/${e}`,c=await fetch(r,{signal:t?.timeout?AbortSignal.timeout(t.timeout):void 0});if(!c.ok)throw new Error(`Failed to retrieve from IPFS: ${c.status} ${c.statusText}`);let i=c.headers.get("content-type");return i?.startsWith("text/")||i?.includes("json")?c.text():new Uint8Array(await c.arrayBuffer())}async pin(e){let t=this.config.endpoint??"https://api.pinata.cloud",o=await fetch(`${t}/pinning/pinByHash`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.config.jwt??this.config.apiKey}`,...this.config.headers},body:JSON.stringify({hashToPin:e})}),r=o.ok;return {hash:e,success:r,status:r?"pinned":"failed",error:r?void 0:`Pin failed: ${o.status}`}}async unpin(e){let t=this.config.endpoint??"https://api.pinata.cloud",o=await fetch(`${t}/pinning/unpin/${e}`,{method:"DELETE",headers:{Authorization:`Bearer ${this.config.jwt??this.config.apiKey}`,...this.config.headers}}),r=o.ok;return {hash:e,success:r,status:r?"pinned":"failed",error:r?void 0:`Unpin failed: ${o.status}`}}},pf=class{constructor(e){this.config=e;}async upload(e,t){let o=this.config.endpoint??"http://localhost:5001",r=new FormData,c=new Blob([e],{type:t?.contentType??"application/octet-stream"});r.append("file",c,t?.filename??"content");let i=await fetch(`${o}/api/v0/add`,{method:"POST",body:r});if(!i.ok)throw new Error(`IPFS HTTP upload failed: ${i.status}`);let d=await i.json(),s=typeof e=="string"?new TextEncoder().encode(e).length:e.length;if(typeof d!="object"||d===null)throw new Error("Invalid IPFS HTTP API response");let p=d;if(typeof p.Hash!="string")throw new Error("IPFS HTTP API response missing Hash field");let E=p.Hash;return {hash:E,uri:`ipfs://${E}`,size:s,timestamp:Date.now(),pinned:t?.pin!==false,gateways:[`${o}/ipfs/${E}`,`https://ipfs.io/ipfs/${E}`]}}async retrieve(e,t){let r=`${t?.gateway??this.config.endpoint?.replace("/api/v0","")??"https://ipfs.io"}/ipfs/${e}`,c=await fetch(r,{signal:t?.timeout?AbortSignal.timeout(t.timeout):void 0});if(!c.ok)throw new Error(`Failed to retrieve from IPFS: ${c.status}`);let i=c.headers.get("content-type");return i?.startsWith("text/")||i?.includes("json")?c.text():new Uint8Array(await c.arrayBuffer())}async pin(e){let t=this.config.endpoint??"http://localhost:5001",o=await fetch(`${t}/api/v0/pin/add?arg=${e}`,{method:"POST"}),r=o.ok;return {hash:e,success:r,status:r?"pinned":"failed",error:r?void 0:`Pin failed: ${o.status}`}}async unpin(e){let t=this.config.endpoint??"http://localhost:5001",o=await fetch(`${t}/api/v0/pin/rm?arg=${e}`,{method:"POST"}),r=o.ok;return {hash:e,success:r,status:r?"pinned":"failed",error:r?void 0:`Unpin failed: ${o.status}`}}},Cu=class{constructor(e){this.config=e;this.initializeProviders();}providers=[];cache=new Map;initializeProviders(){if(this.providers.push(this.createProvider(this.config.provider)),this.config.fallbackProviders)for(let e of this.config.fallbackProviders)this.providers.push(this.createProvider(e));}createProvider(e){switch(e.name){case "pinata":return new Af(e);case "ipfs-http-client":case "custom":return new pf(e);case "test":return new Pu(e);default:throw new Error(`Unsupported IPFS provider: ${e.name}`)}}async upload(e,t){let o=Date.now(),r;for(let c=0;c<this.providers.length;c++){let i=this.providers[c];try{console.log(`\u{1F4E4} Attempting IPFS upload with provider ${c+1}/${this.providers.length}`);let d=await this.withRetry(()=>i.upload(e,t),this.config.maxRetries??3,this.config.retryDelay??1e3);return console.log(`\u2705 IPFS upload successful: ${d.hash}`),{success:!0,data:d,duration:Date.now()-o,provider:this.config.provider.name}}catch(d){console.warn(`\u274C Provider ${c+1} upload failed:`,d instanceof Error?d.message:String(d)),r=d instanceof Error?d:new Error(String(d));}}return {success:false,error:"UPLOAD_FAILED",message:`All providers failed. Last error: ${r?.message}`,duration:Date.now()-o}}async retrieve(e,t){let o=Date.now();if(this.config.enableCache&&t?.cache!==false){let i=this.cache.get(e);if(i&&Date.now()-i.timestamp<(this.config.cacheTTL??3e5))return {success:true,data:{content:i.content,size:(typeof i.content=="string",i.content.length),hash:e,gateway:"cache",fromCache:true},duration:Date.now()-o}}let r,c=t?.gateway?[t.gateway]:this.config.gateways??["https://ipfs.io"];for(let i of c)for(let d of this.providers)try{let s=await this.withRetry(()=>d.retrieve(e,{...t,gateway:i}),this.config.maxRetries??3,this.config.retryDelay??1e3);return this.config.enableCache&&this.cache.set(e,{content:s,timestamp:Date.now()}),{success:!0,data:{content:s,size:s.length,hash:e,gateway:i,fromCache:!1},duration:Date.now()-o}}catch(s){r=s instanceof Error?s:new Error(String(s));}return {success:false,error:"RETRIEVAL_FAILED",message:`Failed to retrieve from all gateways. Last error: ${r?.message}`,duration:Date.now()-o}}async pin(e){let t=Date.now();for(let o of this.providers)try{let r=await o.pin(e);return {success:r.success,data:r,duration:Date.now()-t}}catch(r){console.warn("Pin attempt failed:",r);}return {success:false,error:"PIN_FAILED",message:"All pin attempts failed",duration:Date.now()-t}}async storeContent(e,t,o){let r=new TextEncoder().encode(e).length,c=this.config.sizeThreshold??800;if(!(o?.forceIpfs??r>c))return {uri:`data:application/json;base64,${btoa(e)}`,useIpfs:false,size:r};let d=await this.upload(e,o);if(!d.success||!d.data)throw new Error(`IPFS upload failed: ${d.message}`);let s={type:t,originalSize:r,ipfsHash:d.data.hash,encoding:"utf8",compression:"none",mimeType:"application/json",uploadedAt:d.data.timestamp,pinned:d.data.pinned,checksum:await this.calculateChecksum(e)};return {uri:d.data.uri,useIpfs:true,ipfsMetadata:s,size:r}}async retrieveContent(e){if(e.startsWith("data:")){let t=e.split(",")[1];if(!t)throw new Error("Invalid data URI format");return atob(t)}if(e.startsWith("ipfs://")){let t=e.replace("ipfs://",""),o=await this.retrieve(t);if(!o.success||!o.data)throw new Error(`Failed to retrieve IPFS content: ${o.message}`);return typeof o.data.content=="string"?o.data.content:new TextDecoder().decode(o.data.content)}throw new Error(`Unsupported URI format: ${e}`)}async withRetry(e,t,o){let r;for(let c=0;c<=t;c++)try{return await e()}catch(i){r=i instanceof Error?i:new Error(String(i)),c<t&&(console.log(`\u23F3 Retrying in ${o}ms... (attempt ${c+1}/${t})`),await new Promise(d=>setTimeout(d,o)));}throw r}async calculateChecksum(e){let o=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",o);return Array.from(new Uint8Array(r)).map(i=>i.toString(16).padStart(2,"0")).join("")}clearCache(){this.cache.clear();}getCacheStats(){return {size:this.cache.size,keys:Array.from(this.cache.keys())}}};var nn={provider:{name:"pinata",endpoint:"https://api.pinata.cloud"},gateways:["https://gateway.pinata.cloud","https://ipfs.io","https://cloudflare-ipfs.com","https://gateway.ipfs.io"],autoPinning:true,sizeThreshold:800,maxRetries:3,retryDelay:1e3,enableCache:true,cacheTTL:3e5},lf=class{client;constructor(e){this.client=new Cu(e);}async storeAgentMetadata(e,t){let o=JSON.stringify({...e,createdAt:new Date().toISOString(),version:"1.0.0"});return this.client.storeContent(o,"agent-metadata",{filename:`agent-${e.agentId??"metadata"}.json`,metadata:{type:"agent-metadata",agentId:e.agentId,name:e.name},contentType:"application/json",...t})}async storeChannelMessage(e,t){let o=JSON.stringify({...e,timestamp:new Date().toISOString(),version:"1.0.0"});return this.client.storeContent(o,"channel-message",{filename:`message-${Date.now()}.json`,metadata:{type:"channel-message",channelId:e.channelId,messageType:e.messageType??0},contentType:"application/json",...t})}async storeFileAttachment(e,t,o,r){let c=typeof e=="string"?e:new TextDecoder().decode(e);return this.client.storeContent(c,"file-attachment",{filename:t,contentType:o,metadata:{type:"file-attachment",originalFilename:t,mimeType:o},...r})}async retrieveAgentMetadata(e){let t=await this.client.retrieveContent(e),o=JSON.parse(t);if(typeof o!="object"||o===null)throw new Error("Retrieved agent metadata is not a valid object");return o}async retrieveChannelMessage(e){let t=await this.client.retrieveContent(e),o=JSON.parse(t);if(typeof o!="object"||o===null)throw new Error("Retrieved channel message is not a valid object");return o}async batchUpload(e){return (await Promise.allSettled(e.map(o=>this.client.storeContent(o.content,o.type,{filename:o.filename,...o.options})))).map(o=>o.status==="fulfilled"?{success:true,data:o.value}:{success:false,error:"UPLOAD_FAILED",message:o.reason instanceof Error?o.reason.message:String(o.reason)})}async pinContent(e){let t=await this.client.pin(e);return {...t,data:t.success}}isIPFSUri(e){return e.startsWith("ipfs://")}extractIPFSHash(e){return this.isIPFSUri(e)?e.replace("ipfs://",""):null}getGatewayUrls(e,t){return (t??nn.gateways??[]).map(r=>`${r}/ipfs/${e}`)}isValidIPFSHash(e){return e.length<44?false:e.startsWith("Qm")&&e.length===46?/^Qm[A-Za-z0-9]{44}$/.test(e):e.length>46?/^[A-Za-z0-9]+$/.test(e):false}shouldUseIPFS(e,t){let o=new TextEncoder().encode(e).length,r=t??nn.sizeThreshold??800;return o>r}async compressContent(e){try{if(typeof CompressionStream<"u"){let t=new CompressionStream("gzip"),o=t.writable.getWriter(),r=t.readable.getReader(),i=new TextEncoder().encode(e),d=o.write(i).then(()=>o.close()),s=[],p=async()=>{let P=await r.read(),{done:w,value:W}=P;!w&&W&&(s.push(W),await p());};await Promise.all([d,p()]);let E=s.reduce((P,w)=>P+w.length,0),b=new Uint8Array(E),x=0;for(let P of s)b.set(P,x),x+=P.length;return {compressed:Buffer.from(b).toString("base64"),algorithm:"gzip"}}else return console.warn("Compression not available in this environment, storing uncompressed"),{compressed:e,algorithm:"none"}}catch(t){return console.warn("Compression failed, falling back to uncompressed:",t),{compressed:e,algorithm:"none"}}}async decompressContent(e,t){if(t==="none")return e;try{if(t==="gzip")if(typeof DecompressionStream<"u"){let o=new DecompressionStream("gzip"),r=o.writable.getWriter(),c=o.readable.getReader(),i=Buffer.from(e,"base64"),d=r.write(i).then(()=>r.close()),s=[],p=async()=>{let P=await c.read(),{done:w,value:W}=P;!w&&W&&(s.push(W),await p());};await Promise.all([d,p()]);let E=s.reduce((P,w)=>P+w.length,0),b=new Uint8Array(E),x=0;for(let P of s)b.set(P,x),x+=P.length;return new TextDecoder().decode(b)}else return console.warn("Decompression not available in this environment, returning compressed data"),e;else return console.warn(`Unknown compression algorithm: ${t}`),e}catch(o){return console.error("Decompression failed, returning compressed data:",o),e}}getStats(){return {cacheStats:this.client.getCacheStats(),config:nn}}clearCache(){this.client.clearCache();}};function JU(n){let e={...nn,...n,provider:{...nn.provider,...n?.provider}};return new lf(e)}var bu=address("11111111111111111111111111111111");address("11111111111111111111111111111111");address("SysvarRecentB1ockHashes11111111111111111111");address("SysvarStakeHistory1111111111111111111111111");address("Sysvar1nstructions1111111111111111111111111");address("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");address("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");address("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");address("So11111111111111111111111111111111111111112");address("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");address("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s");te();var rn=class extends U{ipfsUtils=null;constructor(e){super(e),e.ipfsConfig&&(this.ipfsUtils=JU(e.ipfsConfig));}async register(e,t){let o=t.pricingModel??0,r=async()=>{let i=await this.deriveAgentPda(t.agentId,e.address);return await Ty({agentAccount:i,signer:e,systemProgram:this.systemProgramId,agentType:t.agentType,name:t.name,description:t.description,metadataUri:t.metadataUri,agentId:t.agentId,pricingModel:o})},c=()=>{let i=new Uint8Array(5);return i[0]=1,new DataView(i.buffer).setUint32(1,256*1024,true),{programAddress:"ComputeBudget111111111111111111111111111111",accounts:[],data:i}};return this.debug(),t.skipSimulation?(console.log("\u{1F680} SKIPPING SIMULATION - Sending transaction directly"),this.builder.executeBatch("registerAgent",[c,r],[e],{simulate:false,skipPreflight:true})):this.builder.executeBatch("registerAgent",[c,r],[e])}async registerCompressed(e,t){let o=async()=>{let r=t.treeConfig||await this.deriveTreeConfigPda(e.address);return await xy({merkleTree:t.merkleTree,treeAuthority:r,signer:e,systemProgram:this.systemProgramId,compressionProgram:this.compressionProgramId,agentType:t.agentType,name:t.name,description:t.description,metadataUri:t.metadataUri,agentId:t.agentId,pricingModel:t.pricingModel??0,logWrapper:"noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV"})};return this.execute("registerAgentCompressed",o,[e])}async update(e,t){let o=()=>nT({agentAccount:t.agentAddress,signer:e,metadataUri:t.metadataUri,agentType:t.agentType,agentId:t.agentId,name:t.name??null,description:t.description??null,pricingModel:t.pricingModel??0});return this.execute("updateAgent",o,[e])}async verify(e,t){let o=async()=>await YT({agent:t.agentAddress,verifier:e,agentPubkey:t.agentPubkey,serviceEndpoint:t.serviceEndpoint,supportedCapabilities:t.supportedCapabilities,verifiedAt:t.verifiedAt});return this.execute("verifyAgent",o,[e])}async deactivate(e,t){let o=()=>l1({agentAccount:t.agentAddress,signer:e,agentId:t.agentId});return this.execute("deactivateAgent",o,[e])}async activate(e,t){let o=()=>hm({agentAccount:t.agentAddress,signer:e,agentId:t.agentId});return this.execute("activateAgent",o,[e])}async getAgentAccount(e){return super.getAccount(e,"getAgentDecoder")}async getAllAgents(){return this.getProgramAccounts("getAgentDecoder")}async getAgentsByType(e){let t=Buffer.alloc(1);t.writeUInt8(e,0);let o=[{memcmp:{offset:BigInt(8),bytes:t.toString("base64"),encoding:"base64"}}];return this.getProgramAccounts("getAgentDecoder",o)}async getUserAgents(e){let t=[{memcmp:{offset:BigInt(9),bytes:e,encoding:"base58"}}];return this.getProgramAccounts("getAgentDecoder",t)}async batchGetAgents(e,t){return super.getAccounts(e,"getAgentDecoder")}async batchGetExistingAgents(e,t){let{batchGetExistingAccounts:o}=await Promise.resolve().then(()=>(yf(),mf));return o(this.config.rpc,e,{onProgress:t})}async batchGetAndMapAgents(e,t){let{batchGetAndMap:o}=await Promise.resolve().then(()=>(yf(),mf));return o(this.config.rpc,e,t)}async deriveAgentPda(e,t){let{deriveAgentPda:o}=await Promise.resolve().then(()=>(Mu(),vu)),[r]=await o({programAddress:this.programId,owner:t,agentId:e});return r}async deriveUserRegistryPda(e){let{deriveUserRegistryPda:t}=await Promise.resolve().then(()=>(Mu(),vu));return t(this.programId,e)}async deriveTreeConfigPda(e){let{getProgramDerivedAddress:t,getAddressEncoder:o}=await import('@solana/addresses'),c=o().encode(e),[i]=await t({programAddress:this.programId,seeds:[new TextEncoder().encode("agent_tree_config"),c]});return i}get systemProgramId(){return bu}get compressionProgramId(){return "cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK"}};te();var wu=address("22zoJMtdu4tQc2PzL74ZUT7FrwgB1Udec8DdW4yw4BdG"),e0="attestation",t0="credential",n0="schema",cn=class{static async deriveAttestationPda(e,t,o){let[r,c]=await getProgramDerivedAddress({programAddress:wu,seeds:[getUtf8Encoder().encode(e0),getAddressEncoder().encode(e),getAddressEncoder().encode(t),getAddressEncoder().encode(o)]});return {attestationPda:r,bump:c}}static async deriveCredentialPda(e){let[t,o]=await getProgramDerivedAddress({programAddress:wu,seeds:[getUtf8Encoder().encode(t0),getAddressEncoder().encode(e)]});return {attestationPda:t,bump:o}}static async deriveSchemaPda(e,t){let[o,r]=await getProgramDerivedAddress({programAddress:wu,seeds:[getUtf8Encoder().encode(n0),getAddressEncoder().encode(e),getUtf8Encoder().encode(t)]});return {attestationPda:o,bump:r}}static serializeAttestationData(e){let t=new TextEncoder,o=t.encode(e.network),r=e.githubUsername?t.encode(e.githubUsername):new Uint8Array,c=e.twitterHandle?t.encode(e.twitterHandle):new Uint8Array,i=36+o.length+1+(e.githubUsername?4+r.length:0)+1+(e.twitterHandle?4+c.length:0)+8,d=new Uint8Array(i),s=0,p=Buffer.from(e.x402PaymentAddress);return d.set(p.slice(0,32),s),s+=32,new DataView(d.buffer,s,4).setUint32(0,o.length,true),s+=4,d.set(o,s),s+=o.length,e.githubUsername?(d[s]=1,s+=1,new DataView(d.buffer,s,4).setUint32(0,r.length,true),s+=4,d.set(r,s),s+=r.length):(d[s]=0,s+=1),e.twitterHandle?(d[s]=1,s+=1,new DataView(d.buffer,s,4).setUint32(0,c.length,true),s+=4,d.set(c,s),s+=c.length):(d[s]=0,s+=1),new DataView(d.buffer,s,8).setBigInt64(0,e.timestamp,true),d}static getDefaultCredentialConfig(e){return {issuer:e,name:"GhostSpeak AI Agent Ownership",description:"Attestation proving ownership of an AI agent registered on the GhostSpeak protocol",schemaUri:"https://ghostspeak.ai/schemas/agent-ownership-v1.json"}}static isAttestationExpired(e,t){let o=t??BigInt(Math.floor(Date.now()/1e3));return e<o}static calculateDefaultExpiry(e){let t=e??BigInt(Math.floor(Date.now()/1e3)),o=BigInt(365*24*60*60);return t+o}static async prepareAttestation(e){let{attestationPda:t,bump:o}=await this.deriveAttestationPda(e.credentialAddress,e.schemaAddress,e.x402PaymentAddress),r=e.expiryTimestamp??this.calculateDefaultExpiry();return {attestationData:this.serializeAttestationData({x402PaymentAddress:e.x402PaymentAddress,network:e.network,githubUsername:e.githubUsername,twitterHandle:e.twitterHandle,timestamp:BigInt(Math.floor(Date.now()/1e3))}),attestationPda:t,bump:o,expiryTimestamp:r}}};var nye="did_document",Uu=class extends U{constructor(e){super(e);}async claim(e,t){let o=await this.prepareClaim(t),r=()=>zm({agentAccount:t.agentAddress,didDocument:o.didDocumentPda,sasAttestation:o.attestationPda,claimer:e,systemProgram:this.systemProgramId,sasCredential:t.sasCredential,sasSchema:t.sasSchema,ipfsMetadataUri:t.ipfsMetadataUri??null,network:t.network});return this.execute("claimGhost",r,[e])}async prepareClaim(e){let{attestationPda:t,bump:o}=await cn.deriveAttestationPda(e.sasCredential,e.sasSchema,e.x402PaymentAddress),[r,c]=await this.deriveDidDocumentPda(e.x402PaymentAddress);return {attestationPda:t,didDocumentPda:r,attestationBump:o,didDocumentBump:c}}async getGhostAgent(e){return super.getAccount(e,"getAgentDecoder")}async getAllGhosts(){return this.getGhostsByType(10)}async getGhostsByType(e=10){let t=Buffer.alloc(1);t.writeUInt8(e,0);let o=[{memcmp:{offset:BigInt(8),bytes:t.toString("base64"),encoding:"base64"}}];return this.getProgramAccounts("getAgentDecoder",o)}async getClaimedGhosts(e){let t=[{memcmp:{offset:BigInt(9),bytes:e,encoding:"base58"}}];return this.getProgramAccounts("getAgentDecoder",t)}async validateClaim(e){let t=[],o=[],r=["devnet","testnet","mainnet-beta","localnet"];r.includes(e.network)||t.push(`Invalid network: ${e.network}. Must be one of: ${r.join(", ")}`),e.ipfsMetadataUri&&!e.ipfsMetadataUri.startsWith("ipfs://")&&o.push('IPFS metadata URI should start with "ipfs://"');let c=await this.getGhostAgent(e.agentAddress);return c?(c.owner!==null&&t.push(`Agent is already claimed by: ${c.owner}`),c.agentType!==10&&o.push(`Agent type is ${c.agentType}, expected 10 (external x402 agent)`)):t.push(`Agent not found at address: ${e.agentAddress}`),{valid:t.length===0,errors:t,warnings:o}}async deriveDidDocumentPda(e){let[t,o]=await getProgramDerivedAddress({programAddress:this.programId,seeds:[getUtf8Encoder().encode(nye),getAddressEncoder().encode(e)]});return [t,o]}get systemProgramId(){return bu}};te();var sn=class extends U{getInitializeGovernanceProposalInstruction(e){return jt(e)}async createProposal(e){let t=this.deriveProposalPda(e.signer.address,e.title),o=await this.getInitializeGovernanceProposalInstruction({proposal:t,proposer:e.signer,title:e.title,description:e.description,proposalType:{kind:e.proposalType,data:{}},executionParams:{instructions:[],accounts:[],targetProgram:t,executeAfter:BigInt(e.executionDelay??0)},proposalId:BigInt(Date.now())});return this.execute("createProposal",()=>o,[e.signer])}async getProposal(e){return super.getAccount(e,"getGovernanceProposalDecoder")}async getActiveProposals(){return this.getProgramAccounts("getGovernanceProposalDecoder")}async getProposalsByProposer(e){let t=[{memcmp:{offset:BigInt(8),bytes:e,encoding:"base58"}}];return this.getProgramAccounts("getGovernanceProposalDecoder",t)}async getProposalsByStatus(e){let t=await this.getProgramAccounts("getGovernanceProposalDecoder");return t.filter(o=>t.length>0)}deriveProposalPda(e,t){return `proposal_${e}_${t}`}};te();var an=class extends U{async createMultisig(e){throw new Error("createMultisig: Instruction not available - requires IDL regeneration")}async createProposal(e){let t=await jt({proposer:e.proposer,proposalId:e.proposalId,title:e.title,description:e.description,proposalType:e.proposalType,executionParams:e.executionParams},{programAddress:this.programId});return this.execute("createProposal",()=>t,[e.proposer])}async executeProposal(e){throw new Error("executeProposal: Use protocol_config instructions for execution")}};var rye="https://staging.crossmint.com",oye="https://www.crossmint.com",ff={AGENT_IDENTITY:"GhostSpeakAgentIdentity",REPUTATION_SCORE:"GhostSpeakReputation",JOB_COMPLETION:"GhostSpeakJobCompletion"},_u=class{apiKey;baseUrl;chain;constructor(e){this.apiKey=e.apiKey,this.baseUrl=e.environment==="production"?oye:rye,this.chain=e.chain||"base-sepolia";}async createAgentIdentityType(){let e=ff.AGENT_IDENTITY,t={$schema:"https://json-schema.org/draft/2020-12/schema",title:"GhostSpeak Agent Identity",description:"Verified AI agent identity on the GhostSpeak Protocol",type:"object",properties:{credentialSubject:{type:"object",properties:{agentId:{type:"string"},owner:{type:"string"},capabilities:{type:"array",items:{type:"string"}},registeredAt:{type:"string"},reputationScore:{type:"number"},totalJobsCompleted:{type:"integer"},verified:{type:"boolean"},id:{type:"string"}},required:["agentId","owner","capabilities","registeredAt","verified"],additionalProperties:false}}};return this.createCredentialType(e,t)}async createReputationType(){let e=ff.REPUTATION_SCORE,t={$schema:"https://json-schema.org/draft/2020-12/schema",title:"GhostSpeak Reputation",description:"Verified reputation score for GhostSpeak users",type:"object",properties:{credentialSubject:{type:"object",properties:{userId:{type:"string"},walletAddress:{type:"string"},reputationScore:{type:"number"},totalTransactions:{type:"integer"},disputeRate:{type:"number"},memberSince:{type:"string"},id:{type:"string"}},required:["userId","walletAddress","reputationScore","memberSince"],additionalProperties:false}}};return this.createCredentialType(e,t)}async createJobCompletionType(){let e=ff.JOB_COMPLETION,t={$schema:"https://json-schema.org/draft/2020-12/schema",title:"GhostSpeak Job Completion",description:"Certificate of successful job completion on GhostSpeak",type:"object",properties:{credentialSubject:{type:"object",properties:{jobId:{type:"string"},agentId:{type:"string"},clientAddress:{type:"string"},completedAt:{type:"string"},amountPaid:{type:"string"},rating:{type:"integer"},review:{type:"string"},id:{type:"string"}},required:["jobId","agentId","clientAddress","completedAt","amountPaid","rating"],additionalProperties:false}}};return this.createCredentialType(e,t)}async initializeAllTypes(){let[e,t,o]=await Promise.all([this.createAgentIdentityType(),this.createReputationType(),this.createJobCompletionType()]);return {agentIdentity:e,reputation:t,jobCompletion:o}}async createAllTemplates(e){let[t,o,r]=await Promise.all([this.createTemplate(e.agentIdentity.id,{name:"GhostSpeak Agent Identity",description:"Verified AI agent identity on the GhostSpeak Protocol",imageUrl:"https://www.ghostspeak.io/assets/credential-agent.png"}),this.createTemplate(e.reputation.id,{name:"GhostSpeak Reputation",description:"Verified reputation score for GhostSpeak users",imageUrl:"https://www.ghostspeak.io/assets/credential-reputation.png"}),this.createTemplate(e.jobCompletion.id,{name:"GhostSpeak Job Completion Certificate",description:"Certificate of successful job completion on GhostSpeak",imageUrl:"https://www.ghostspeak.io/assets/credential-job.png"})]);return {agentIdentityTemplate:t,reputationTemplate:o,jobCompletionTemplate:r}}async issueAgentCredential(e,t,o,r){return this.issueCredential(e,t,o,r)}async issueReputationCredential(e,t,o,r){return this.issueCredential(e,t,o,r)}async issueJobCompletionCredential(e,t,o,r){return this.issueCredential(e,t,o,r)}async createCredentialType(e,t){let o=await fetch(`${this.baseUrl}/api/v1-alpha1/credentials/types/${e}`,{method:"PUT",headers:{"Content-Type":"application/json","X-API-KEY":this.apiKey},body:JSON.stringify(t)});if(!o.ok){let r=await o.json().catch(()=>({message:o.statusText}));throw new Error(`Failed to create credential type: ${JSON.stringify(r)}`)}return o.json()}async createTemplate(e,t){let o=await fetch(`${this.baseUrl}/api/v1-alpha1/credentials/templates/`,{method:"POST",headers:{"Content-Type":"application/json","X-API-KEY":this.apiKey},body:JSON.stringify({credentials:{type:e,encryption:"none",storage:"crossmint"},metadata:t,chain:this.chain})});if(!o.ok){let i=await o.text();try{let d=JSON.parse(i);throw new Error(`Failed to create template: ${JSON.stringify(d)}`)}catch{throw new Error(`Failed to create template (${o.status}): ${i}`)}}let r=await o.json(),c=await this.waitForAction(r.id);return c.data&&c.data.collection?c.data.collection:c.data||c}async waitForAction(e){let t=0;for(;t<60;){await new Promise(c=>setTimeout(c,2e3));let o=await fetch(`${this.baseUrl}/api/2022-06-09/actions/${e}`,{headers:{"X-API-KEY":this.apiKey}});if(!o.ok)throw new Error(`Failed to poll action: ${o.statusText}`);let r=await o.json();if(r.status==="succeeded")return r;if(r.status==="failed")throw new Error(`Action failed: ${JSON.stringify(r)}`);t++;}throw new Error("Action polling timed out")}async issueCredential(e,t,o,r){let c=await fetch(`${this.baseUrl}/api/v1-alpha1/credentials/templates/${e}/vcs`,{method:"POST",headers:{"Content-Type":"application/json","X-API-KEY":this.apiKey},body:JSON.stringify({recipient:`email:${t}:${this.chain}`,credential:{subject:o,expiresAt:r||this.getDefaultExpiry()}})});if(!c.ok){let i=await c.json().catch(()=>({message:c.statusText}));throw new Error(`Failed to issue credential: ${JSON.stringify(i)}`)}return c.json()}async getCredential(e){let t=await fetch(`${this.baseUrl}/api/v1-alpha1/credentials/${e}`,{headers:{"X-API-KEY":this.apiKey}});if(!t.ok){let o=await t.json().catch(()=>({message:t.statusText}));throw new Error(`Failed to get credential: ${JSON.stringify(o)}`)}return t.json()}async verifyCredential(e){let t=await fetch(`${this.baseUrl}/api/v1-alpha1/credentials/verification/verify`,{method:"POST",headers:{"Content-Type":"application/json","X-API-KEY":this.apiKey},body:JSON.stringify({credential:e})});if(!t.ok){let o=await t.json().catch(()=>({message:t.statusText}));throw new Error(`Failed to verify credential: ${JSON.stringify(o)}`)}return t.json()}async revokeCredential(e){let t=await fetch(`${this.baseUrl}/api/v1-alpha1/credentials/${e}`,{method:"DELETE",headers:{"X-API-KEY":this.apiKey}});if(!t.ok){let o=await t.json().catch(()=>({message:t.statusText}));throw new Error(`Failed to revoke credential: ${JSON.stringify(o)}`)}return t.json()}getDefaultExpiry(){let e=new Date;return e.setFullYear(e.getFullYear()+1),e.toISOString().split("T")[0]}};var r0="did_document";var ke=class extends Error{code;constructor(e,t){super(t||e),this.name="DidError",this.code=e;}};async function zu(n,e){let[t,o]=await getProgramDerivedAddress({programAddress:n,seeds:[new TextEncoder().encode(r0),getAddressEncoder().encode(e)]});return [t,o]}function he(n,e){return `did:sol:${n==="mainnet"?"mainnet-beta":n}:${e.toString()}`}function Ou(n){if(!n.startsWith("did:sol:"))throw new ke("InvalidDidFormat",'DID must start with "did:sol:"');let e=n.split(":");if(e.length!==4)throw new ke("InvalidDidFormat",'DID must have format "did:sol:network:identifier"');let t=["mainnet-beta","devnet","testnet","localnet"];if(!t.includes(e[2]))throw new ke("InvalidDidFormat",`Invalid network "${e[2]}". Must be one of: ${t.join(", ")}`);try{Tt.decode(e[3]);}catch{throw new ke("InvalidDidFormat","DID identifier must be a valid base58-encoded Solana public key")}}function o0(n){Ou(n);let e=n.split(":");return {method:e[1],network:e[2],identifier:e[3]}}function Sf(n){let e=n.verificationMethods.filter(s=>!s.revoked).map(s=>({id:`${n.did}#${s.id}`,type:s.methodType,controller:s.controller,publicKeyMultibase:s.publicKeyMultibase})),t=n.verificationMethods.filter(s=>!s.revoked&&s.relationships.includes("authentication")).map(s=>`${n.did}#${s.id}`),o=n.verificationMethods.filter(s=>!s.revoked&&s.relationships.includes("assertionMethod")).map(s=>`${n.did}#${s.id}`),r=n.verificationMethods.filter(s=>!s.revoked&&s.relationships.includes("keyAgreement")).map(s=>`${n.did}#${s.id}`),c=n.verificationMethods.filter(s=>!s.revoked&&s.relationships.includes("capabilityInvocation")).map(s=>`${n.did}#${s.id}`),i=n.verificationMethods.filter(s=>!s.revoked&&s.relationships.includes("capabilityDelegation")).map(s=>`${n.did}#${s.id}`),d=n.serviceEndpoints.map(s=>({id:`${n.did}#${s.id}`,type:s.serviceType,serviceEndpoint:s.serviceEndpoint,description:s.description||void 0}));return {"@context":n.context,id:n.did,controller:n.controller.toString(),verificationMethod:e,authentication:t.length>0?t:void 0,assertionMethod:o.length>0?o:void 0,keyAgreement:r.length>0?r:void 0,capabilityInvocation:c.length>0?c:void 0,capabilityDelegation:i.length>0?i:void 0,service:d.length>0?d:void 0,alsoKnownAs:n.alsoKnownAs.length>0?n.alsoKnownAs:void 0}}function i0(n,e,t,o=["authentication"]){let r=`z${t}`;return {id:n,methodType:"Ed25519VerificationKey2020",controller:e,publicKeyMultibase:r,relationships:o,createdAt:Math.floor(Date.now()/1e3),revoked:false}}function c0(n,e,t,o=""){return {id:n,serviceType:e,serviceEndpoint:t,description:o}}function s0(n){return !n.deactivated}function a0(n,e=true){let t=Sf(n);return e?JSON.stringify(t,null,2):JSON.stringify(t)}var dn=n=>Tt.encode(n),dye="GHosT3wqDfNq9bKz8dNEQ1F5mLuN7bKdNYx3Z1111111";var un=class{programId;didModule;constructor(e=dye,t){this.programId=e,this.didModule=t;}setDidModule(e){this.didModule=e;}hashSubjectData(e){let t=JSON.stringify(e,Object.keys(e).sort());return sha256(new TextEncoder().encode(t))}generateCredentialId(e,t){let o=Date.now(),r=`${e}-${t}-${o}`,c=sha256(new TextEncoder().encode(r)),i=dn(c.slice(0,8));return `${e.toLowerCase()}-${i}`}exportAsW3CCredential(e,t,o,r,c){let i=c?.network||"mainnet",d=he(i,this.programId),s=he(i,e.subject),p=`solana:${this.programId}:credential:${e.credentialId}`;return {"@context":["https://www.w3.org/ns/credentials/v2","https://w3id.org/security/data-integrity/v2","https://ghostspeak.io/ns/credentials/v1"],type:["VerifiableCredential",`GhostSpeak${o.kind}Credential`],id:`urn:ghostspeak:${e.credentialId}`,issuer:{id:d,name:"GhostSpeak Protocol"},validFrom:new Date(e.issuedAt*1e3).toISOString(),validUntil:e.expiresAt?new Date(e.expiresAt*1e3).toISOString():void 0,credentialSubject:{id:s,...r},credentialSchema:{id:o.schemaUri,type:"JsonSchema"},credentialStatus:{id:p,type:"SolanaAccountStatus2025",statusPurpose:"revocation"},relatedResource:c?.includeRelatedResource?[{id:e.subjectDataUri,digestMultibase:`mEi${dn(e.subjectDataHash)}`}]:void 0,proof:{type:"DataIntegrityProof",created:new Date(e.issuedAt*1e3).toISOString(),verificationMethod:`${d}#key-1`,cryptosuite:"eddsa-rdfc-2022",proofPurpose:"assertionMethod",proofValue:dn(e.signature)}}}async exportWithDidResolution(e,t,o,r,c){if(!this.didModule)return this.exportAsW3CCredential(e,t,o,r,c);let i=c?.network||"mainnet",d=he(i,this.programId),s=he(i,e.subject),p=await this.didModule.resolve(this.programId).catch(()=>null);await this.didModule.resolve(e.subject).catch(()=>null);let b=`solana:${this.programId}:credential:${e.credentialId}`,x=p?.verificationMethods?.[0]?`${d}#${p.verificationMethods[0].id}`:`${d}#key-1`;return {"@context":["https://www.w3.org/ns/credentials/v2","https://w3id.org/security/data-integrity/v2","https://ghostspeak.io/ns/credentials/v1"],type:["VerifiableCredential",`GhostSpeak${o.kind}Credential`],id:`urn:ghostspeak:${e.credentialId}`,issuer:{id:d,name:"GhostSpeak Protocol"},validFrom:new Date(e.issuedAt*1e3).toISOString(),validUntil:e.expiresAt?new Date(e.expiresAt*1e3).toISOString():void 0,credentialSubject:{id:s,...r},credentialSchema:{id:o.schemaUri,type:"JsonSchema"},credentialStatus:{id:b,type:"SolanaAccountStatus2025",statusPurpose:"revocation"},relatedResource:c?.includeRelatedResource?[{id:e.subjectDataUri,digestMultibase:`mEi${dn(e.subjectDataHash)}`}]:void 0,proof:{type:"DataIntegrityProof",created:new Date(e.issuedAt*1e3).toISOString(),verificationMethod:x,cryptosuite:"eddsa-rdfc-2022",proofPurpose:"assertionMethod",proofValue:dn(e.signature)}}}static buildAgentIdentitySubject(e){return e}issueX402AgentCredential(e){let t=Math.floor(Date.now()/1e3),o={agentId:e.agentId,owner:e.owner,name:e.name,capabilities:e.capabilities||[],serviceEndpoint:e.serviceEndpoint,frameworkOrigin:e.frameworkOrigin,x402Enabled:true,x402PaymentAddress:e.x402PaymentAddress,x402AcceptedTokens:e.x402AcceptedTokens,x402PricePerCall:e.x402PricePerCall,registeredAt:t,verifiedAt:t,type:"external-x402-agent",verificationResponseTimeMs:e.verificationResponseTimeMs},r=this.generateCredentialId("AgentIdentity",e.agentAddress),c=this.hashSubjectData(o),i={template:"x402-agent-identity-template",subject:e.agentAddress,issuer:this.programId,credentialId:r,subjectDataHash:c,subjectDataUri:`data:application/json;base64,${Buffer.from(JSON.stringify(o)).toString("base64")}`,status:"Active",signature:c,issuedAt:t},d={authority:this.programId,name:"x402 Agent Identity",kind:"AgentIdentity",schemaUri:"https://ghostspeak.io/schemas/x402-agent-identity-v1.json",description:"Verifiable credential for x402-compatible AI agents registered with GhostSpeak",isActive:true,totalIssued:1,createdAt:t},s={credentialType:d.authority,name:"x402 Agent Identity",imageUri:"https://ghostspeak.io/assets/credential-badge-x402.png",issuer:this.programId,isActive:true,totalIssued:1,createdAt:t},p=this.exportAsW3CCredential(i,s,d,o,{network:e.network||"devnet",includeRelatedResource:true});return {credentialId:r,credential:i,w3cCredential:p,subjectData:o}}exportCredentialToJSON(e,t,o){let r={credentialType:"x402-agent",name:e.credentialId.includes("agentidentity")?"Agent Identity":"Custom",imageUri:"https://ghostspeak.io/assets/credential-badge.png",issuer:e.issuer,isActive:true,totalIssued:1,createdAt:e.issuedAt},c={authority:e.issuer,name:"GhostSpeak Credential",kind:"AgentIdentity",schemaUri:"https://ghostspeak.io/schemas/credential-v1.json",description:"GhostSpeak verifiable credential",isActive:true,totalIssued:1,createdAt:e.issuedAt},i=this.exportAsW3CCredential(e,r,c,t,{network:o?.network||"devnet",includeRelatedResource:true});return o?.pretty?JSON.stringify(i,null,2):JSON.stringify(i)}};var Fu=class{constructor(e){this.config=e;this.credentialModule=new un(e.programId),e.crossmint&&(this.crossmintClient=new _u(e.crossmint));}credentialModule;crossmintClient;async issueAgentIdentityCredential(e){let t=un.buildAgentIdentitySubject({agentId:e.agentId,owner:e.owner,name:e.name,capabilities:e.capabilities,serviceEndpoint:e.serviceEndpoint,frameworkOrigin:e.frameworkOrigin,x402Enabled:e.x402Enabled,registeredAt:e.registeredAt,verifiedAt:e.verifiedAt}),o=this.credentialModule.generateCredentialId("AgentIdentity",e.owner),r=this.credentialModule.hashSubjectData(t),c={template:"11111111111111111111111111111111",subject:e.owner,issuer:e.owner,credentialId:o,subjectDataHash:r,subjectDataUri:`ipfs://placeholder/${o}`,status:"Active",signature:e.signature,issuedAt:Math.floor(Date.now()/1e3),expiresAt:void 0,revokedAt:void 0,crossmintCredentialId:void 0},i={authority:"11111111111111111111111111111111",name:"AgentIdentity",kind:"AgentIdentity",schemaUri:"https://ghostspeak.io/schemas/agent-identity.json",description:"Verified AI agent identity on GhostSpeak Protocol",isActive:true,totalIssued:1,createdAt:Math.floor(Date.now()/1e3)},d={credentialType:"11111111111111111111111111111111",name:"GhostSpeak Agent Identity",imageUri:"https://www.ghostspeak.io/assets/credential-agent.png",issuer:e.owner,isActive:true,totalIssued:1,createdAt:Math.floor(Date.now()/1e3),crossmintTemplateId:this.config.crossmintTemplates?.agentIdentity},s=this.credentialModule.exportAsW3CCredential(c,d,i,t),p={solanaCredential:{credentialId:o},w3cCredential:s};if(e.syncToCrossmint&&this.crossmintClient&&e.recipientEmail)if(!d.crossmintTemplateId)p.crossmintSync={status:"failed",error:"No template ID configured"};else try{let E=await this.crossmintClient.issueCredential(d.crossmintTemplateId,e.recipientEmail,t);p.crossmintSync={status:"synced",credentialId:E.credentialId,chain:this.config.crossmint?.chain};}catch(E){p.crossmintSync={status:"failed",error:E instanceof Error?E.message:"Unknown error"};}return p}};var v={MAX_REPUTATION_SCORE:1e4,MIN_REPUTATION_FOR_SLASH:1e3,REPUTATION_DECAY_RATE_BPS:10,BRONZE_TIER_THRESHOLD:2e3,SILVER_TIER_THRESHOLD:5e3,GOLD_TIER_THRESHOLD:7500,PLATINUM_TIER_THRESHOLD:9e3,MAX_REPUTATION_CATEGORIES:10};var Gu=class{fraudPatterns=[];constructor(){this.initializeFraudPatterns();}initializeFraudPatterns(){this.fraudPatterns=[{patternId:"sudden_spike",description:"Sudden spike in reputation without corresponding activity",riskScore:80,detect:e=>{if(e.performanceHistory.length<2)return false;let t=e.performanceHistory[e.performanceHistory.length-1],o=e.performanceHistory[e.performanceHistory.length-2];return t.score-o.score>2e3&&t.jobsCompleted===o.jobsCompleted}},{patternId:"perfect_scores_only",description:"All jobs have perfect scores (potential manipulation)",riskScore:60,detect:e=>{let t=e.performanceHistory.slice(-10);return t.length>=5&&t.every(o=>o.avgQuality===100)}},{patternId:"rapid_category_switching",description:"Rapid switching between unrelated categories",riskScore:40,detect:e=>{if(e.categoryReputations.length<5)return false;let t=e.categoryReputations.sort((r,c)=>c.lastActivity-r.lastActivity).slice(0,5);return (Date.now()-t[4].lastActivity)/(1e3*60*60*24)<7}},{patternId:"dispute_pattern",description:"High dispute rate with suspicious resolution pattern",riskScore:70,detect:e=>{if(e.totalJobsCompleted<10)return false;let t=e.disputesAgainst/e.totalJobsCompleted,o=e.disputesResolved/Math.max(1,e.disputesAgainst);return t>.3&&o>.9}},{patternId:"time_manipulation",description:"Completion times significantly below expected",riskScore:50,detect:(e,t)=>t.actualDuration<t.expectedDuration*.1}];}calculateReputation(e,t){let o=this.applyTimeDecay(e),r=this.calculateWeightedScore(o.factors,t),c=this.updateCategoryReputation(o.categoryReputations,t,r),i=this.calculateOverallScore(c.categories),d=this.getTierFromScore(i),s=this.checkBadgeAchievements(o,t,i),p=this.detectFraud(o,t);return {overallScore:i,jobScore:r,categoryScore:c.categoryScore,tier:d,newBadges:s,fraudDetected:p.detected,fraudRiskScore:p.riskScore}}applyTimeDecay(e){let t=Date.now()/1e3,o=(t-e.lastUpdated)/86400;if(o<=0)return e;let r=v.REPUTATION_DECAY_RATE_BPS*o,c=Math.max(0,1e4-r)/1e4,i=Math.floor(e.overallScore*c),d=e.categoryReputations.map(s=>{let p=(t-s.lastActivity)/86400,E=v.REPUTATION_DECAY_RATE_BPS*p,b=Math.max(0,1e4-E)/1e4;return {...s,score:Math.floor(s.score*b)}});return {...e,overallScore:i,categoryReputations:d}}calculateWeightedScore(e,t){if(e.completionWeight+e.qualityWeight+e.timelinessWeight+e.satisfactionWeight+e.disputeWeight!==100)throw new Error("Reputation factors must sum to 100");let r=t.completed?v.MAX_REPUTATION_SCORE:0,c=t.qualityRating*v.MAX_REPUTATION_SCORE/100,i=this.calculateTimelinessScore(t.expectedDuration,t.actualDuration),d=t.clientSatisfaction*v.MAX_REPUTATION_SCORE/100,s=this.calculateDisputeScore(t),p=(r*e.completionWeight+c*e.qualityWeight+i*e.timelinessWeight+d*e.satisfactionWeight+s*e.disputeWeight)/100;return Math.min(p,v.MAX_REPUTATION_SCORE)}calculateTimelinessScore(e,t){if(t<=e)return v.MAX_REPUTATION_SCORE;let o=(t-e)*1e4/e;return o>5e3?0:v.MAX_REPUTATION_SCORE-v.MAX_REPUTATION_SCORE*o/1e4}calculateDisputeScore(e){return e.hadDispute?e.disputeResolvedFavorably?v.MAX_REPUTATION_SCORE/2:0:v.MAX_REPUTATION_SCORE}updateCategoryReputation(e,t,o){let r=e.findIndex(c=>c.category===t.category);if(r!==-1){let c=e[r],i={...c,completedJobs:c.completedJobs+1,qualitySum:c.qualitySum+t.qualityRating,qualityCount:c.qualityCount+1,totalEarnings:c.totalEarnings+t.paymentAmount,lastActivity:Date.now()/1e3,score:Math.floor((c.score*7+o*3)/10),avgCompletionTime:Math.floor((c.avgCompletionTime*c.completedJobs+t.actualDuration)/(c.completedJobs+1))},d=[...e];return d[r]=i,{categories:d,categoryScore:i.score}}else {if(e.length>=v.MAX_REPUTATION_CATEGORIES)throw new Error("Maximum reputation categories reached");let c={category:t.category,score:o,completedJobs:1,avgCompletionTime:t.actualDuration,qualitySum:t.qualityRating,qualityCount:1,lastActivity:Date.now()/1e3,totalEarnings:t.paymentAmount};return {categories:[...e,c],categoryScore:o}}}calculateOverallScore(e){if(e.length===0)return 5e3;let t=0,o=0;for(let r of e){let c=r.completedJobs;t+=r.score*c,o+=c;}return o>0?Math.floor(t/o):5e3}getTierFromScore(e){return e>=v.PLATINUM_TIER_THRESHOLD?"Platinum":e>=v.GOLD_TIER_THRESHOLD?"Gold":e>=v.SILVER_TIER_THRESHOLD?"Silver":e>=v.BRONZE_TIER_THRESHOLD?"Bronze":"None"}checkBadgeAchievements(e,t,o){let r=[],c=new Set(e.badges.map(d=>d.badgeType)),i=e.totalJobsCompleted+(t.completed?1:0);return !c.has("FirstJob")&&i>=1&&r.push("FirstJob"),!c.has("TenJobs")&&i>=10&&r.push("TenJobs"),!c.has("HundredJobs")&&i>=100&&r.push("HundredJobs"),!c.has("ThousandJobs")&&i>=1e3&&r.push("ThousandJobs"),!c.has("PerfectRating")&&o>=9500&&r.push("PerfectRating"),!c.has("QuickResponder")&&e.avgResponseTime>0&&e.avgResponseTime<3600&&r.push("QuickResponder"),!c.has("DisputeResolver")&&e.disputesResolved>=5&&r.push("DisputeResolver"),c.has("CategoryExpert")||e.categoryReputations.some(s=>s.score>=9e3)&&r.push("CategoryExpert"),!c.has("CrossCategoryMaster")&&e.categoryReputations.length>=5&&r.push("CrossCategoryMaster"),r}detectFraud(e,t){let o=0,r=[];for(let i of this.fraudPatterns)i.detect(e,t)&&(o+=i.riskScore,r.push(i.patternId));let c=Math.min(100,o);return {detected:c>=50,riskScore:c,patterns:r}}createPerformanceSnapshot(e,t){let o=e.categoryReputations.length>0?e.categoryReputations.reduce((r,c)=>r+(c.qualityCount>0?c.qualitySum/c.qualityCount:0),0)/e.categoryReputations.length:0;return {timestamp:Date.now()/1e3,score:t,jobsCompleted:e.totalJobsCompleted,avgQuality:Math.floor(o)}}calculateSlashAmount(e,t){if(t>5e3)throw new Error("Slash percentage cannot exceed 50%");if(e<v.MIN_REPUTATION_FOR_SLASH)throw new Error("Reputation too low to slash");let o=Math.floor(e*t/1e4);return {newScore:Math.max(0,e-o),slashAmount:o}}calculateStakingBonus(e){return Math.min(500,Math.floor(e/1e3))}};xf();var Wu=class extends U{calculator;tagEngine;constructor(e){super(e),this.calculator=new Gu,this.tagEngine=new gn;}calculateReputationChange(e,t){return this.calculator.calculateReputation(e,t)}getTierName(e){switch(e){case "None":return "Unranked";case "Bronze":return "Bronze";case "Silver":return "Silver";case "Gold":return "Gold";case "Platinum":return "Platinum";default:return "Unknown"}}getTierFromScore(e){return e>=v.PLATINUM_TIER_THRESHOLD?"Platinum":e>=v.GOLD_TIER_THRESHOLD?"Gold":e>=v.SILVER_TIER_THRESHOLD?"Silver":e>=v.BRONZE_TIER_THRESHOLD?"Bronze":"None"}getBadgeName(e){switch(e){case "FirstJob":return "First Job";case "TenJobs":return "10 Jobs";case "HundredJobs":return "100 Jobs";case "ThousandJobs":return "1000 Jobs";case "PerfectRating":return "Perfect Rating";case "QuickResponder":return "Quick Responder";case "DisputeResolver":return "Dispute Resolver";case "CategoryExpert":return "Category Expert";case "CrossCategoryMaster":return "Cross-Category Master";default:return "Unknown Badge"}}calculateApyBoost(e){return Math.floor(e/1e3)*50}getTierColor(e){switch(e){case "Platinum":return "#E5E4E2";case "Gold":return "#FFD700";case "Silver":return "#C0C0C0";case "Bronze":return "#CD7F32";default:return "#808080"}}createDefaultReputationData(e){return {agent:e,overallScore:5e3,totalJobsCompleted:0,totalJobsFailed:0,avgResponseTime:0,disputesAgainst:0,disputesResolved:0,lastUpdated:Math.floor(Date.now()/1e3),categoryReputations:[],badges:[],performanceHistory:[],factors:{completionWeight:25,qualityWeight:25,timelinessWeight:20,satisfactionWeight:20,disputeWeight:10}}}qualifiesForTier(e,t){switch(t){case "Platinum":return e>=v.PLATINUM_TIER_THRESHOLD;case "Gold":return e>=v.GOLD_TIER_THRESHOLD;case "Silver":return e>=v.SILVER_TIER_THRESHOLD;case "Bronze":return e>=v.BRONZE_TIER_THRESHOLD;default:return true}}pointsToNextTier(e){switch(this.getTierFromScore(e)){case "None":return {nextTier:"Bronze",pointsNeeded:v.BRONZE_TIER_THRESHOLD-e};case "Bronze":return {nextTier:"Silver",pointsNeeded:v.SILVER_TIER_THRESHOLD-e};case "Silver":return {nextTier:"Gold",pointsNeeded:v.GOLD_TIER_THRESHOLD-e};case "Gold":return {nextTier:"Platinum",pointsNeeded:v.PLATINUM_TIER_THRESHOLD-e};case "Platinum":return null;default:return null}}recordPayAIPayment(e,t){let o=this.payAIRecordToJobPerformance(e);return this.calculateReputationChange(t,o)}payAIRecordToJobPerformance(e){let t=this.estimateQualityFromResponseTime(e.responseTimeMs),o=this.estimateExpectedDuration(e.amount);return {completed:e.success,qualityRating:t,expectedDuration:o,actualDuration:Math.ceil(e.responseTimeMs/1e3),clientSatisfaction:e.success?t:20,hadDispute:false,disputeResolvedFavorably:false,category:this.categorizeFromNetwork(e.network),paymentAmount:Number(e.amount)/1e6}}estimateQualityFromResponseTime(e){return e<=500?100:e<=2e3?Math.round(90-(e-500)/1500*20):e<=1e4?Math.round(70-(e-2e3)/8e3*30):Math.max(20,Math.round(40-(e-1e4)/5e4*20))}estimateExpectedDuration(e){let t=Number(e)/1e6;return Math.max(2,Math.ceil(2+t*10))}categorizeFromNetwork(e){switch(e){case "solana":return "ai-services-solana";case "base":return "ai-services-base";case "ethereum":return "ai-services-ethereum";default:return "ai-services"}}createPayAIPerformanceSnapshot(e,t){return {timestamp:e.timestamp.getTime(),paymentId:e.paymentSignature,network:e.network,amount:e.amount.toString(),success:e.success,responseTimeMs:e.responseTimeMs,reputationChange:t.jobScore,newScore:t.overallScore,tier:t.tier}}async calculateTagsForAgent(e){return this.tagEngine.calculateTags(e)}getTagsByCategory(e,t){return this.tagEngine.filterTags(e,{category:t})}hasTag(e,t){return e.some(o=>o.tagName===t)}getTagConfidence(e,t){return e.find(r=>r.tagName===t)?.confidence}filterTags(e,t){return this.tagEngine.filterTags(e,t)}applyTagDecay(e,t){return this.tagEngine.applyTagDecay(e,t)}mergeTags(e,t){return this.tagEngine.mergeTags(e,t)}categorizeTags(e){return this.tagEngine.categorizeTags(e)}getTopTags(e,t){return this.tagEngine.getTopTags(e,t)}sortTagsByConfidence(e){return this.tagEngine.sortByConfidence(e)}sortTagsByEvidence(e){return this.tagEngine.sortByEvidence(e)}sortTagsByRecent(e){return this.tagEngine.sortByRecent(e)}getConfidenceLevel(e){return this.tagEngine.getConfidenceLevel(e)}validateTagName(e){return this.tagEngine.validateTagName(e)}validateConfidence(e){return this.tagEngine.validateConfidence(e)}convertMetricsForTagging(e){let t=e.responseTimeCount>0n?Number(e.totalResponseTime/e.responseTimeCount):0,o=e.successfulPayments+e.failedPayments,r=o>0n?Number(e.successfulPayments*10000n/o):0,c=e.totalRatingsCount>0?Math.floor(e.totalRating*100/(e.totalRatingsCount*5)):0,i=e.totalDisputes>0?Math.floor(e.disputesResolved*1e4/e.totalDisputes):1e4;return {successfulPayments:e.successfulPayments,failedPayments:e.failedPayments,totalResponseTime:e.totalResponseTime,responseTimeCount:e.responseTimeCount,totalDisputes:e.totalDisputes,disputesResolved:e.disputesResolved,totalRating:e.totalRating,totalRatingsCount:e.totalRatingsCount,createdAt:e.createdAt,updatedAt:e.updatedAt,avgResponseTime:t,successRate:r,avgRating:c,disputeResolutionRate:i}}};var Nu=class extends U{constructor(e){super(e);}async create(e,t){let o=t.network||"devnet",r=he(o,t.controller);Ou(r);let[c]=await zu(this.programId,t.controller),i=async()=>this.buildCreateDidInstruction(c,t.controller,r,t.verificationMethods||[],t.serviceEndpoints||[]);return this.execute("createDidDocument",i,[e])}async update(e,t){let o=async()=>this.buildUpdateDidInstruction(t.didDocument,e.address,t.addVerificationMethod||null,t.removeVerificationMethodId||null,t.addServiceEndpoint||null,t.removeServiceEndpointId||null);return this.execute("updateDidDocument",o,[e])}async deactivate(e,t){let o=async()=>this.buildDeactivateDidInstruction(t.didDocument,e.address);return this.execute("deactivateDidDocument",o,[e])}async resolve(e){let t;if(typeof e=="string"&&e.startsWith("did:sol:")){let{identifier:r}=o0(e);t=address(r);}else t=typeof e=="string"?address(e):e;let[o]=await zu(this.programId,t);return this.getAccount(o,"getDidDocumentDecoder")}async exportW3C(e,t=true){let o=await this.resolve(e);return o?a0(o,t):null}async getW3CDocument(e){let t=await this.resolve(e);return t?Sf(t):null}async deriveDidPda(e){return zu(this.programId,e)}generateDid(e,t="devnet"){return he(t,e)}validateDid(e){return Ou(e),true}async isActive(e){let t=await this.resolve(e);return t?s0(t):false}buildCreateDidInstruction(e,t,o,r,c){throw new Error("DID instructions are not yet generated. Please run: bun run generate:client after adding DID instructions to the program.")}buildUpdateDidInstruction(e,t,o,r,c,i){throw new Error("DID instructions are not yet generated. Please run: bun run generate:client after adding DID instructions to the program.")}buildDeactivateDidInstruction(e,t){throw new Error("DID instructions are not yet generated. Please run: bun run generate:client after adding DID instructions to the program.")}static createVerificationMethod=i0;static createServiceEndpoint=c0};function A0(n,e,t){if(t||e==="Public")return {exactScore:n,tier:An(n),scoreRange:pn(n)};switch(e){case "TierOnly":return {tier:An(n)};case "RangeOnly":return {scoreRange:pn(n)};case "Confidential":return {};case "Custom":return {tier:An(n),scoreRange:pn(n)};default:return {}}}function An(n){return n>=De.TIER_THRESHOLDS.PLATINUM?"Platinum":n>=De.TIER_THRESHOLDS.GOLD?"Gold":n>=De.TIER_THRESHOLDS.SILVER?"Silver":n>=De.TIER_THRESHOLDS.BRONZE?"Bronze":"None"}function pn(n){let e=De.SCORE_RANGES;return n>=e.VERY_HIGH.min?"VeryHigh":n>=e.HIGH.min?"High":n>=e.MEDIUM.min?"Medium":n>=e.LOW.min?"Low":"VeryLow"}function p0(n,e,t){return n===t?true:e.authorizedViewers.includes(n)}function l0(n,e,t){let o={agent:n.agent},r=c=>t||c==="Public";if(r(e.showScore)&&(o.exactScore=n.overallScore),r(e.showJobsCompleted)&&(o.totalJobsCompleted=n.totalJobsCompleted),r(e.showSuccessRate)){let c=n.totalJobsCompleted+n.totalJobsFailed;o.successRate=c>0?n.totalJobsCompleted/c*100:0;}return r(e.showResponseTime)&&(o.avgResponseTime=n.avgResponseTime),r(e.showDisputes)&&(o.disputes={total:n.disputesAgainst,resolved:n.disputesResolved}),r(e.showEarnings)&&n.totalEarnings!==void 0&&(o.totalEarnings=n.totalEarnings),r(e.showRatings)&&n.avgRating!==void 0&&(o.avgRating=n.avgRating),r(e.showBadges)&&n.badges!==void 0&&(o.badges=n.badges),o.hasFullAccess=t,o}function ln(n){switch(n){case "Public":return {showScore:"Public",showJobsCompleted:"Public",showSuccessRate:"Public",showResponseTime:"Public",showDisputes:"Public",showEarnings:"Public",showRatings:"Public",showBadges:"Public"};case "TierOnly":case "RangeOnly":return {showScore:"Private",showJobsCompleted:"Private",showSuccessRate:"Private",showResponseTime:"Private",showDisputes:"Private",showEarnings:"Private",showRatings:"Private",showBadges:"Public"};case "Confidential":return {showScore:"ZKProof",showJobsCompleted:"ZKProof",showSuccessRate:"ZKProof",showResponseTime:"ZKProof",showDisputes:"ZKProof",showEarnings:"ZKProof",showRatings:"ZKProof",showBadges:"ZKProof"};case "Custom":default:return {showScore:"Private",showJobsCompleted:"Public",showSuccessRate:"Public",showResponseTime:"Public",showDisputes:"Private",showEarnings:"Private",showRatings:"Public",showBadges:"Public"}}}function m0(n){let e=[];return n.authorizedViewers.length>De.MAX_AUTHORIZED_VIEWERS&&e.push(`Too many authorized viewers (max: ${De.MAX_AUTHORIZED_VIEWERS})`),n.mode==="Public"&&Object.values(n.metricVisibility).some(o=>o!=="Public")&&e.push("Public mode cannot have private metrics"),{valid:e.length===0,errors:e}}var Bu=class extends U{constructor(e){super(e);}async initializePrivacy(e,t){let o=t.mode??"Public";t.metricVisibility??ln(o);let c=async()=>({programAddress:this.programId,accounts:[],data:new Uint8Array([0])});return this.execute("initializePrivacy",c,[e])}async updatePrivacyMode(e,t){let o=async()=>({programAddress:this.programId,accounts:[],data:new Uint8Array([1])});return this.execute("updatePrivacyMode",o,[e])}async setMetricVisibility(e,t){let o=async()=>({programAddress:this.programId,accounts:[],data:new Uint8Array([2])});return this.execute("setMetricVisibility",o,[e])}async grantAccess(e,t){let o=async()=>({programAddress:this.programId,accounts:[],data:new Uint8Array([3])});return this.execute("grantAccess",o,[e])}async revokeAccess(e,t){let o=async()=>({programAddress:this.programId,accounts:[],data:new Uint8Array([4])});return this.execute("revokeAccess",o,[e])}async applyPreset(e,t){let{preset:o}=t;return await this.updatePrivacyMode(e,{agentAddress:t.agentAddress,mode:o.mode}),this.setMetricVisibility(e,{agentAddress:t.agentAddress,metricVisibility:o.metricVisibility})}async getPrivacySettings(e){return {agent:e,mode:"Public",metricVisibility:ln("Public"),authorizedViewers:[],autoGrantClients:false,updatedAt:Math.floor(Date.now()/1e3)}}async getVisibleReputation(e,t){let o=await this.getPrivacySettings(e);o||(o={agent:e,mode:"Public",metricVisibility:ln("Public"),authorizedViewers:[],autoGrantClients:false,updatedAt:Math.floor(Date.now()/1e3)});let r=p0(t,o,e),c={agent:e,overallScore:7500,totalJobsCompleted:100,totalJobsFailed:5,avgResponseTime:250,disputesAgainst:2,disputesResolved:2,totalEarnings:5e4,avgRating:4.5,badges:["FirstJob","TenJobs","QuickResponder"]},i=A0(c.overallScore,o.mode,r);return {...l0(c,o.metricVisibility,r),privacyMode:o.mode,...i,hasFullAccess:r}}validateSettings(e){return m0(e)}getAvailablePresets(){return cf}getDefaultVisibility(e){return ln(e)}getTier(e){return An(e)}getRange(e){return pn(e)}async derivePrivacyPda(e){let{getProgramDerivedAddress:t,getAddressEncoder:o}=await import('@solana/addresses'),c=o().encode(e),[i]=await t({programAddress:this.programId,seeds:[new TextEncoder().encode("privacy_settings"),c]});return i}};var lye="GhostSpeak Reputation Authorization";function y0(n){let e=[];e.push(Buffer.from(lye,"utf8"));let t=Tt.decode(n.agentAddress);e.push(Buffer.from(t));let o=Tt.decode(n.authorizedSource);e.push(Buffer.from(o));let r=Buffer.allocUnsafe(8);r.writeBigUInt64BE(BigInt(n.indexLimit)),e.push(r);let c=Buffer.allocUnsafe(8);return c.writeBigUInt64BE(BigInt(n.expiresAt)),e.push(c),e.push(Buffer.from(n.network,"utf8")),n.nonce&&e.push(Buffer.from(n.nonce,"utf8")),Buffer.concat(e)}async function mye(n,e){let t=e.publicKey.toBase58();if(t!==n.agentAddress)throw new Error(`Keypair public key ${t} does not match agent address ${n.agentAddress}`);let o=y0(n);return (await import('tweetnacl')).sign.detached(o,e.secretKey)}async function T0(n){try{let e={agentAddress:n.agentAddress,authorizedSource:n.authorizedSource,indexLimit:n.indexLimit,expiresAt:n.expiresAt,network:n.network,nonce:n.nonce},t=y0(e),o=await import('tweetnacl'),r=Tt.decode(n.agentAddress);return o.sign.detached.verify(t,n.signature,r)}catch(e){return console.error("[Auth Signature] Verification failed:",e),false}}async function f0(n,e){let t=address(e.publicKey.toBase58()),o=Math.floor(Date.now()/1e3),r=n.expiresAt||o+(n.expiresIn||720*60*60),c=n.indexLimit||1e3,i=n.network||"devnet",d=n.nonce!==void 0?n.nonce:"default",s={agentAddress:t,authorizedSource:n.authorizedSource,indexLimit:c,expiresAt:r,network:i,nonce:d},p=await mye(s,e);return {agentAddress:t,authorizedSource:n.authorizedSource,indexLimit:c,expiresAt:r,network:i,signature:p,nonce:d,metadata:n.metadata}}function Df(n){return {agentAddress:n.agentAddress,authorizedSource:n.authorizedSource,indexLimit:n.indexLimit,expiresAt:n.expiresAt,network:n.network,signature:Tt.encode(n.signature),nonce:n.nonce,metadata:n.metadata}}function S0(n){return {agentAddress:n.agentAddress,authorizedSource:n.authorizedSource,indexLimit:n.indexLimit,expiresAt:n.expiresAt,network:n.network,signature:Tt.decode(n.signature),nonce:n.nonce,metadata:n.metadata}}async function x0(authorization){let serialized=Df(authorization),json=JSON.stringify(serialized),encoder=new TextEncoder,data=encoder.encode(json),crypto;if(globalThis.crypto)crypto=globalThis.crypto;else {let nodeCrypto=eval("require")("crypto");crypto=nodeCrypto.webcrypto;}let hashBuffer=await crypto.subtle.digest("SHA-256",data),hashArray=new Uint8Array(hashBuffer);return Tt.encode(hashArray)}function D0(n,e){return (e||Math.floor(Date.now()/1e3))>=n.expiresAt}function h0(n,e){return e>=n.indexLimit}var yye=2000000n,Lu=class extends U{constructor(e){super(e);}async createAuthorization(e,t){return await f0(e,t)}async storeAuthorizationOnChain(e,t,o){let r=this.calculateStorageFee(e,o),c=o?.feePayedByAgent??true;console.log(`\u{1F4B0} On-chain storage cost: ${Number(r)/1e9} SOL`),console.log(` Fee payer: ${c?"Agent":"Facilitator"}`);let{getCreateAgentAuthorizationInstructionAsync:i}=await Promise.resolve().then(()=>(Gm(),WM)),{getProgramDerivedAddress:d,getBytesEncoder:s,getAddressEncoder:p,getUtf8Encoder:E}=await import('@solana/kit'),b=e.nonce??"default",[x]=await d({programAddress:this.getProgramId(),seeds:[s().encode(new Uint8Array([97,103,101,110,116,95,97,117,116,104])),p().encode(e.agentAddress),p().encode(e.authorizedSource),E().encode(b)]});return await this.execute("createAgentAuthorization",async()=>await i({agent:e.agentAddress,authorization:x,authority:t,authorizedSource:e.authorizedSource,indexLimit:BigInt(e.indexLimit),expiresAt:BigInt(e.expiresAt),network:e.network==="mainnet-beta"?0:e.network==="devnet"?1:2,signature:e.signature,nonce:b}),[t])}async verifySignature(e){return T0(e)}getAuthorizationStatus(e,t){let o=Math.floor(Date.now()/1e3),r=t??0;return D0(e,o)?{status:"expired",isValid:false,remainingUses:0,reason:"Authorization has expired"}:h0(e,r)?{status:"exhausted",isValid:false,remainingUses:0,reason:"Index limit reached"}:{status:"active",isValid:true,remainingUses:e.indexLimit-r}}async fetchAuthorization(e,t,o){throw new Error("On-chain fetch not yet implemented - pending Codama generation")}async updateReputationWithAuth(e,t,o,r,c,i){if(!await this.verifySignature(e))throw new Error("Invalid authorization signature");let s=this.getAuthorizationStatus(e);if(!s.isValid)throw new Error(`Authorization is ${s.status}: ${s.reason}`);let{getUpdateReputationWithAuthInstructionAsync:p}=await Promise.resolve().then(()=>(VT(),zU));return await this.execute("updateReputationWithAuth",async()=>await p({agent:e.agentAddress,authorizedSource:i,usageRecord:r,reputationChange:BigInt(t),transactionSignature:o,metadata:c?JSON.stringify(c):null,nonce:e.nonce??null}),[i])}async revokeAuthorization(e,t,o,r){let{getRevokeAuthorizationInstruction:c}=await Promise.resolve().then(()=>(My(),Uw));return await this.execute("revokeAuthorization",()=>c({agent:e,authorization:t,authority:r,nonce:o??null}),[r])}async listAuthorizations(e){throw new Error("Authorization listing not yet implemented - pending Codama generation")}serializeAuthorization(e){return Df(e)}deserializeAuthorization(e){return S0(e)}async getAuthorizationId(e){return x0(e)}async createPayAIAuthorization(e,t,o){let r={authorizedSource:e,indexLimit:1e3,expiresIn:2592e3,network:"devnet",...o};return this.createAuthorization(r,t)}calculateStorageFee(e,t){if(t?.storageFee!==void 0)return t.storageFee;if(t?.customFees){let o=Math.floor(Date.now()/1e3),r=e.expiresAt-o,c=Object.keys(t.customFees).map(Number).sort((d,s)=>d-s);for(let d of c)if(r<=d)return t.customFees[d];let i=c[c.length-1];if(i&&t.customFees[i])return t.customFees[i]}return yye}async estimateStorageCost(e,t){let o=Math.floor(Date.now()/1e3),r={agentAddress:"11111111111111111111111111111111",authorizedSource:e.authorizedSource,indexLimit:e.indexLimit??1e3,expiresAt:e.expiresAt??o+(e.expiresIn??720*60*60),network:e.network??"devnet",signature:new Uint8Array(64),nonce:e.nonce},c=this.calculateStorageFee(r,t);return Number(c)/1e9}};te();var Vu=class extends U{async initializeStakingConfig(e){let t=await X1({authority:e.authority,minStake:e.minStake,treasury:e.treasury},{programAddress:this.programId});return this.execute("initializeStakingConfig",()=>t,[e.authority])}async stake(e){let t=await Ny({ownerTokenAccount:e.agentTokenAccount,stakingVault:e.stakingVault,stakingConfig:e.stakingConfig,ghostMint:e.ghostMint,owner:e.agentOwner,amount:e.amount,lockDuration:e.lockDuration},{programAddress:this.programId});return this.execute("stakeGhost",()=>t,[e.agentOwner])}async unstake(e){let t=await Qy({stakingAccount:e.stakingAccount,stakingVault:e.stakingVault,ownerTokenAccount:e.agentTokenAccount,owner:e.agentOwner},{programAddress:this.programId});return this.execute("unstakeGhost",()=>t,[e.agentOwner])}async getStakingAccount(e){try{return await this.getAccount(e,"getStakingAccountDecoder")}catch(t){return console.error("Error fetching staking account:",t),null}}async getStakingConfig(e){try{return await this.getAccount(e,"getStakingConfigDecoder")}catch(t){return console.error("Error fetching staking config:",t),null}}};Jg();var Ef=class{config;constructor(e){this.config={programId:u,commitment:"confirmed",cluster:"devnet",rpcEndpoint:e?.rpcEndpoint??this.getDefaultRpcEndpoint(e?.cluster??"devnet"),...e,rpc:e?.rpc??{}};}get agents(){return new rn(this.config)}get ghosts(){return new Uu(this.config)}get governanceModule(){return new sn(this.config)}get multisigModule(){return new an(this.config)}agent(){return new Pf(this.config)}reputation(){return new Wu(this.config)}tagEngine(){let{ReputationTagEngine:e}=(xf(),Of(u0));return new e}reputationAggregator(){let{MultiSourceAggregator:e}=(P0(),Of(E0));return new e}privacy(){return new Bu(this.config)}governance(){return new Cf(this.config)}multisig(){return new If(this.config)}credentials(){return new Fu({programId:this.config.programId,crossmint:this.config.credentials?.crossmintApiKey?{apiKey:this.config.credentials.crossmintApiKey,environment:this.config.credentials.crossmintEnvironment,chain:this.config.credentials.crossmintChain}:void 0,crossmintTemplates:this.config.credentials?.templates})}did(){return new Nu(this.config)}get authorization(){return new Lu(this.config)}get staking(){return new Vu(this.config)}enableDevMode(){return console.log("\u{1F6E0}\uFE0F Development mode enabled"),console.log(" - Transaction simulation before sending"),console.log(" - Cost estimates for all operations"),console.log(" - Enhanced error messages"),this.config={...this.config},this}useNetwork(e){return this.config.cluster=e,this.config.rpcEndpoint=this.getDefaultRpcEndpoint(e),this}useRpc(e,t){return this.config.rpcEndpoint=e,this.config.wsEndpoint=t,this}getDefaultRpcEndpoint(e){switch(e){case "mainnet-beta":return "https://api.mainnet-beta.solana.com";case "devnet":return "https://api.devnet.solana.com";case "testnet":return "https://api.testnet.solana.com";case "localnet":return "http://localhost:8899";default:return "https://api.devnet.solana.com"}}},Pf=class{module;params={};constructor(e){this.module=new rn(e);}create(e){return this.params={...this.params,agentType:0,metadataUri:JSON.stringify(e),agentId:e.name.toLowerCase().replace(/\s+/g,"-"),name:e.name,description:e.description||""},this}withDescription(e){return this.params.description=e,this}withType(e){return this.params.agentType=e,this}withIPFS(){return this.params.forceIPFS=true,this}compressed(){return this.params.compressed=true,this}debug(){return this.module.debug(),this}withSigner(e){return this.params.signer=e,this}validateParams(){if(!this.params.signer)throw new Error("Agent builder requires a signer. Call with signer first.");if(!this.params.metadataUri)throw new Error("Agent builder requires metadata. Call create() first.");if(!this.params.agentId)throw new Error("Agent builder requires agent ID. Call create() first.");this.params.agentType??=0;}async getCost(){return this.validateParams(),this.module.getCost("registerAgent",()=>({programAddress:this.module.getProgramId(),accounts:[],data:new Uint8Array}))}async simulate(){let e=()=>({programAddress:this.module.getProgramId(),accounts:[],data:new Uint8Array});return this.validateParams(),this.module.simulateInstruction("registerAgent",e,[this.params.signer])}async explain(){return this.validateParams(),this.module.explain("registerAgent",()=>({programAddress:this.module.getProgramId(),accounts:[],data:new Uint8Array}))}async execute(){this.validateParams(),this.params.compressed&&console.log("Creating compressed agent (5000x cheaper)...");let e=await this.module.register(this.params.signer,{agentType:this.params.agentType,name:this.params.name,description:this.params.description,metadataUri:this.params.metadataUri,agentId:this.params.agentId});return {address:await this.deriveAgentAddress(this.params.agentId,this.params.signer),signature:e}}async deriveAgentAddress(e,t){let{deriveAgentPda:o}=await Promise.resolve().then(()=>(Mu(),vu)),[r]=await o({programAddress:this.module.getProgramId(),owner:t.address,agentId:e});return r}},Cf=class{module;params={};constructor(e){this.module=new sn(e);}proposal(){return new bf(this.module,this.params)}query(){return new Rf(this.module)}debug(){return this.module.debug(),this}withSigner(e){return this.params.signer=e,this}},bf=class{constructor(e,t){this.module=e;this.builderParams=t;this.params.signer=t.signer;}params={};create(e){return this.params.title=e.title,this.params.description=e.description,this}type(e){return this.params.proposalType=e,this}votingDuration(e){return this.params.votingDuration=e,this}executionDelay(e){return this.params.executionDelay=e,this}validateParams(){if(!this.params.signer)throw new Error("Signer required");if(!this.params.title)throw new Error("Title required");if(!this.params.description)throw new Error("Description required");if(!this.params.proposalType)throw new Error("Proposal type required");if(!this.params.votingDuration)throw new Error("Voting duration required")}async execute(){this.validateParams();let e=await this.module.createProposal({signer:this.params.signer,title:this.params.title,description:this.params.description,proposalType:this.params.proposalType,votingDuration:this.params.votingDuration,executionDelay:this.params.executionDelay});return {address:`proposal_${this.params.signer.address}_${this.params.title}`,signature:e}}withSigner(e){return this.params.signer=e,this}},Rf=class{constructor(e){this.module=e;}async activeProposals(){return this.module.getActiveProposals()}async proposalsByProposer(e){return this.module.getProposalsByProposer(e)}async proposalsByStatus(e){return this.module.getProposalsByStatus(e)}},If=class{module;params={};constructor(e){this.module=new an(e);}create(){return new vf(this.module,this.params)}proposal(){return new Mf(this.module,this.params)}approve(){return new kf(this.module,this.params)}executeProposal(){return new wf(this.module,this.params)}withSigner(e){return this.params.signer=e,this}debug(){return this.module.debug(),this}},vf=class{constructor(e,t){this.module=e;this.builderParams=t;this.params.signer=t.signer;}params={};withId(e){return this.params.multisigId=e,this}threshold(e){return this.params.threshold=e,this}signers(e){return this.params.signers=e,this}async execute(){if(!this.params.signer)throw new Error("Signer required");if(!this.params.multisigId)throw new Error("Multisig ID required");if(!this.params.threshold)throw new Error("Threshold required");if(!this.params.signers)throw new Error("Signers required");return {signature:await this.module.createMultisig({owner:this.params.signer,multisigId:this.params.multisigId,threshold:this.params.threshold,signers:this.params.signers})}}withSigner(e){return this.params.signer=e,this}},Mf=class{constructor(e,t){this.module=e;this.builderParams=t;this.params.signer=t.signer;}params={};forMultisig(e){return this.params.multisigAddress=e,this}title(e){return this.params.title=e,this}description(e){return this.params.description=e,this}async execute(){if(!this.params.signer)throw new Error("Signer required");if(!this.params.title)throw new Error("Title required");if(!this.params.description)throw new Error("Description required");return {signature:await this.module.createProposal({multisigAddress:this.params.multisigAddress,title:this.params.title,description:this.params.description,proposalType:7,executionParams:{instructions:[],executionDelay:0n,executionConditions:[],cancellable:true,autoExecute:true,executionAuthority:this.params.signer.address},proposalId:BigInt(Date.now()),proposer:this.params.signer})}}withSigner(e){return this.params.signer=e,this}},kf=class{constructor(e,t){this.module=e;this.builderParams=t;this.params.signer=t.signer;}params={};proposal(e){return this.params.proposalAddress=e,this}vote(e){return this.params.voteChoice=e,this}reason(e){return this.params.reasoning=e,this}tokenAccount(e){return this.params.tokenAccount=e,this}async execute(){throw this.params.signer?this.params.proposalAddress?new Error("Multisig approval: Use protocol_config instructions for voting (approveProposal removed)"):new Error("Proposal address required"):new Error("Signer required")}withSigner(e){return this.params.signer=e,this}},wf=class{constructor(e,t){this.module=e;this.builderParams=t;this.params.signer=t.signer;}params={};proposal(e){return this.params.proposalAddress=e,this}target(e){return this.params.targetProgram=e,this}async execute(){if(!this.params.signer)throw new Error("Signer required");if(!this.params.proposalAddress)throw new Error("Proposal address required");if(!this.params.targetProgram)throw new Error("Target program required");return {signature:await this.module.executeProposal({proposalAddress:this.params.proposalAddress,executor:this.params.signer,targetProgram:this.params.targetProgram})}}withSigner(e){return this.params.signer=e,this}};function Tye(n){return BigInt(Math.round(n*1e9))}var ft=class extends Error{code;context;solution;instruction;constructor(e,t,o={},r,c){super(t),this.name="GhostSpeakError",this.code=e,this.context=o,this.solution=r,this.instruction=c;}toString(){let e=`${this.name} [${this.code}]: ${this.message}`;return Object.keys(this.context).length>0&&(e+=`
|
|
5
5
|
Context: ${JSON.stringify(this.context,null,2)}`),this.solution&&(e+=`
|
|
6
6
|
|
|
7
7
|
\u{1F4A1} Solution: ${this.solution}`),this.instruction&&(e+=`
|
|
8
8
|
|
|
9
|
-
\u{1F4D6} Learn more: ${this.instruction}`),e}toSDKError(){return {code:this.code,message:this.message,context:this.context,solution:this.solution,instruction:this.instruction}}},
|
|
9
|
+
\u{1F4D6} Learn more: ${this.instruction}`),e}toSDKError(){return {code:this.code,message:this.message,context:this.context,solution:this.solution,instruction:this.instruction}}},Uf=class extends ft{constructor(e,t){super("NETWORK_ERROR",`Failed to connect to RPC endpoint: ${e}`,{endpoint:e,originalError:t?.message},"Check your internet connection and verify the RPC endpoint is correct. Try using a different RPC provider.");}},_f=class extends ft{constructor(e,t,o){let r=Number(e)/1e9,c=Number(t)/1e9,i=r-c;super("INSUFFICIENT_BALANCE",`Insufficient balance: need ${r} SOL but only have ${c} SOL`,{required:e.toString(),available:t.toString(),address:o,requiredSOL:r,availableSOL:c,neededSOL:i},`You need ${i.toFixed(4)} more SOL. Try:
|
|
10
10
|
1. Request devnet SOL: solana airdrop ${Math.ceil(i)} ${o}
|
|
11
|
-
2. Or use: await ghostspeak.fund("${o}", ${Math.ceil(i)})`);}};var
|
|
11
|
+
2. Or use: await ghostspeak.fund("${o}", ${Math.ceil(i)})`);}};var zf=class extends ft{constructor(e,t={}){super("INVALID_INPUT",e,t,"Check input parameters and ensure they meet the required format and constraints"),this.name="ValidationError";}};export{ft as GhostSpeakError,_f as InsufficientBalanceError,Uf as NetworkError,zf as ValidationError,Ef as default,Tye as sol};//# sourceMappingURL=core-minimal.js.map
|
|
12
12
|
//# sourceMappingURL=core-minimal.js.map
|