From cd25ffa6a0398eac5161bb540aec3fd22d94274e Mon Sep 17 00:00:00 2001 From: Olga Klimenko Date: Thu, 24 Aug 2023 18:15:41 +0700 Subject: [PATCH] Create proposal and vote (#52) * add governance policy * create governance tokens * use mustPayToPubKeyAddress for governance tokens * start governance with protocol * format * fix proposal modules names * mint gov tokens from Nami * add duration field to governance * add CreateProposal * add governanceScriptinfo * fix CreateProposal * fix reference ver token * update scripts * add vote validator * fix create proposal redeemer * dist * rm unused function * refactor script info * make fmt * fix according to onchain * add check gov tokens in wallet --- conf/governance.conf | 1 + dist/535.index.js | 2 +- exe/Main.purs | 12 ++ scripts/governance.plutus | 5 + scripts/governancePolicy.plutus | 5 + scripts/proposal.plutus | 5 + scripts/proposalPolicy.plutus | 5 + scripts/verTokenPolicy.plutus | 2 +- src/Ext/Data/BigInt.purs | 8 + src/Ext/Data/Maybe.purs | 10 +- .../{Seriaization => Serialization}/Key.purs | 0 src/Ext/Serialization/Token.purs | 17 ++ src/Governance/Config.purs | 32 ++++ src/Governance/Datum.purs | 53 ++++++ src/Governance/GovernanceScript.js | 13 ++ src/Governance/GovernanceScript.purs | 43 +++++ src/Governance/MintGovernanceTokens.purs | 55 +++++++ src/Governance/Redeemer.purs | 30 ++++ src/Governance/UserData.purs | 14 ++ src/MintingPolicy/GovernancePolicyScript.js | 13 ++ src/MintingPolicy/GovernancePolicyScript.purs | 55 +++++++ src/MintingPolicy/ProposalMinting.js | 13 ++ src/MintingPolicy/ProposalMinting.purs | 71 ++++++++ src/MintingPolicy/VerTokenRedeemers.purs | 8 +- src/Proposal/Create.purs | 154 ++++++++++++++++++ src/Proposal/Datum.purs | 59 +++++++ src/Proposal/Model.purs | 90 ++++++++++ src/Proposal/ProposalScript.js | 13 ++ src/Proposal/ProposalScript.purs | 46 ++++++ src/Proposal/Redeemer.purs | 30 ++++ src/Proposal/UserData.purs | 24 +++ src/Proposal/Vote.purs | 136 ++++++++++++++++ src/Proposal/VoteTokenName.purs | 10 ++ src/Protocol/StartProtocol.purs | 103 ++++++++++-- src/Shared/OwnCredentials.purs | 45 +++-- src/Shared/ScriptInfo.purs | 97 +++++++++++ src/Shared/ScriptRef.purs | 45 ++++- src/Shared/Tokens.purs | 59 +++++++ ui/index.tsx | 38 ++++- 39 files changed, 1379 insertions(+), 42 deletions(-) create mode 100644 conf/governance.conf create mode 100644 scripts/governance.plutus create mode 100644 scripts/governancePolicy.plutus create mode 100644 scripts/proposal.plutus create mode 100644 scripts/proposalPolicy.plutus create mode 100644 src/Ext/Data/BigInt.purs rename src/Ext/{Seriaization => Serialization}/Key.purs (100%) create mode 100644 src/Ext/Serialization/Token.purs create mode 100644 src/Governance/Config.purs create mode 100644 src/Governance/Datum.purs create mode 100644 src/Governance/GovernanceScript.js create mode 100644 src/Governance/GovernanceScript.purs create mode 100644 src/Governance/MintGovernanceTokens.purs create mode 100644 src/Governance/Redeemer.purs create mode 100644 src/Governance/UserData.purs create mode 100644 src/MintingPolicy/GovernancePolicyScript.js create mode 100644 src/MintingPolicy/GovernancePolicyScript.purs create mode 100644 src/MintingPolicy/ProposalMinting.js create mode 100644 src/MintingPolicy/ProposalMinting.purs create mode 100644 src/Proposal/Create.purs create mode 100644 src/Proposal/Datum.purs create mode 100644 src/Proposal/Model.purs create mode 100644 src/Proposal/ProposalScript.js create mode 100644 src/Proposal/ProposalScript.purs create mode 100644 src/Proposal/Redeemer.purs create mode 100644 src/Proposal/UserData.purs create mode 100644 src/Proposal/Vote.purs create mode 100644 src/Proposal/VoteTokenName.purs create mode 100644 src/Shared/ScriptInfo.purs create mode 100644 src/Shared/Tokens.purs diff --git a/conf/governance.conf b/conf/governance.conf new file mode 100644 index 0000000..6103db8 --- /dev/null +++ b/conf/governance.conf @@ -0,0 +1 @@ +{"governanceTokenName":"DonatPool_governance_testnet","governanceCurrency":"77e817f46569ad3026fc419fe01623eff862dbb4d4e7c60c4740a19e"} \ No newline at end of file diff --git a/dist/535.index.js b/dist/535.index.js index 30f0725..f742896 100644 --- a/dist/535.index.js +++ b/dist/535.index.js @@ -1 +1 @@ -(self.webpackChunkctl_scaffold=self.webpackChunkctl_scaffold||[]).push([[535],{2711:(e,n,t)=>{e=t.nmd(e);var r,o,a=t(4155),u=t(5108),i=t(2833).Buffer,c={};!function(e){const{BigNumber:n}=t(6628),r=t(4721)({}),o=e=>e;e.fromString=o,e.fromFiniteBigNumber=o,e.fromArray=o,e.fromObject=o,e.aesonNull=null;const a=e=>t=>r=>o=>a=>u=>i=>{if(null===i)return e(i);if("boolean"==typeof i)return t(i);if("string"==typeof i)return o(i);if(n.isBigNumber(i))return r(i);if(Array.isArray(i))return a(i);if("object"==typeof i)return u(i);throw"Imposible happened: JSON object is incorrect: "+i.toString()+" "+typeof i};e._caseAeson=a;const u=n(2).pow(512);class i extends n{constructor(e){super(e)}toJSON(){return this.isInteger()&&this.abs().lte(u)?this.toFixed():super.toJSON()}}e.stringifyAeson=e=>r.stringify((e=>{const n=[],t=a(o)(o)((e=>new i(e)))(o)((e=>{const r=[];return e.forEach(((e,o)=>{n.push((()=>r[o]=t(e)))})),r}))((e=>{const r={};return Object.keys(e).reverse().forEach((o=>{n.push((()=>r[o]=t(e[o])))})),r})),r=t(e);for(;0!==n.length;)n.pop()();return r})(e)),e.parseAeson=e=>n=>t=>{try{return n(r.parse(t))}catch(n){return e}};const c=e=>n=>e;a(c("null"))(c("bool"))(c("bnum"))(c("str"))(c("arr"))(c("obj"))}(c.Aeson=c.Aeson||{}),function(e){"use strict";e["Control.Alt"]=e["Control.Alt"]||{},e["Control.Alt"].alt=function(e){return e.alt}}(c),function(e){"use strict";e.arrayApply=function(e){return function(n){for(var t=e.length,r=n.length,o=new Array(t*r),a=0,u=0;us.length)return r;for(var f=l.concat(s).sort(),d=0;da?-1:1}}}}(c["Data.Ord"]=c["Data.Ord"]||{}),function(e){"use strict";e["Data.Ordering"]=e["Data.Ordering"]||{};var n=e["Data.Ordering"],t=function(){function e(){}return e.value=new e,e}(),r=function(){function e(){}return e.value=new e,e}(),o=function(){function e(){}return e.value=new e,e}(),a={eq:function(e){return function(n){return e instanceof t&&n instanceof t||e instanceof r&&n instanceof r||e instanceof o&&n instanceof o}}};n.LT=t,n.GT=r,n.EQ=o,n.invert=function(e){if(e instanceof r)return t.value;if(e instanceof o)return o.value;if(e instanceof t)return r.value;throw new Error("Failed pattern match at Data.Ordering (line 33, column 1 - line 33, column 31): "+[e.constructor.name])},n.eqOrdering=a}(c),function(e){"use strict";e.intSub=function(e){return function(n){return e-n|0}}}(c["Data.Ring"]=c["Data.Ring"]||{}),function(e){"use strict";e.intAdd=function(e){return function(n){return e+n|0}},e.intMul=function(e){return function(n){return e*n|0}},e.numAdd=function(e){return function(n){return e+n}},e.numMul=function(e){return function(n){return e*n}}}(c["Data.Semiring"]=c["Data.Semiring"]||{}),function(e){"use strict";e["Data.Semiring"]=e["Data.Semiring"]||{};var n=e["Data.Semiring"],t=e["Data.Semiring"],r=e["Data.Symbol"],o=e["Record.Unsafe"],a=e["Type.Proxy"],u=function(e){return e.zeroRecord},i=function(e){return e.zero},c={add:t.numAdd,zero:0,mul:t.numMul,one:1},l={add:t.intAdd,zero:0,mul:t.intMul,one:1},s=function(e){return e.oneRecord},f=function(e){return e.one},d=function(e){return e.mulRecord},v=function(e){return e.mul},m=function(e){return e.addRecord},p=function(e){return e.add};n.add=p,n.zero=i,n.mul=v,n.one=f,n.semiringInt=l,n.semiringNumber=c,n.semiringRecord=function(){return function(e){return{add:m(e)(a.Proxy.value),mul:d(e)(a.Proxy.value),one:s(e)(a.Proxy.value)(a.Proxy.value),zero:u(e)(a.Proxy.value)(a.Proxy.value)}}},n.semiringRecordNil={addRecord:function(e){return function(e){return function(e){return{}}}},mulRecord:function(e){return function(e){return function(e){return{}}}},oneRecord:function(e){return function(e){return{}}},zeroRecord:function(e){return function(e){return{}}}},n.semiringRecordCons=function(e){return function(){return function(n){return function(t){return{addRecord:function(u){return function(u){return function(i){var c=m(n)(a.Proxy.value)(u)(i),l=r.reflectSymbol(e)(a.Proxy.value),s=o.unsafeSet(l),f=o.unsafeGet(l);return s(p(t)(f(u))(f(i)))(c)}}},mulRecord:function(u){return function(u){return function(i){var c=d(n)(a.Proxy.value)(u)(i),l=r.reflectSymbol(e)(a.Proxy.value),s=o.unsafeSet(l),f=o.unsafeGet(l);return s(v(t)(f(u))(f(i)))(c)}}},oneRecord:function(u){return function(u){var i=s(n)(a.Proxy.value)(a.Proxy.value),c=r.reflectSymbol(e)(a.Proxy.value);return o.unsafeSet(c)(f(t))(i)}},zeroRecord:function(c){return function(c){var l=u(n)(a.Proxy.value)(a.Proxy.value),s=r.reflectSymbol(e)(a.Proxy.value);return o.unsafeSet(s)(i(t))(l)}}}}}}}}(c),function(e){"use strict";e["Data.Ring"]=e["Data.Ring"]||{};var n=e["Data.Ring"],t=e["Data.Ring"],r=e["Data.Semiring"],o=function(e){return e.sub},a={sub:t.intSub,Semiring0:function(){return r.semiringInt}};n.sub=o,n.negate=function(e){return function(n){return o(e)(r.zero(e.Semiring0()))(n)}},n.ringInt=a}(c),function(e){"use strict";e["Data.Ord"]=e["Data.Ord"]||{};var n=e["Data.Ord"],t=e["Data.Ord"],r=e["Data.Eq"],o=e["Data.Ordering"],a=e["Data.Ring"],u=e["Data.Semiring"],i=e["Data.Symbol"],c=e["Record.Unsafe"],l=e["Type.Proxy"],s={compare:t.ordStringImpl(o.LT.value)(o.EQ.value)(o.GT.value),Eq0:function(){return r.eqString}},f={compareRecord:function(e){return function(e){return function(e){return o.EQ.value}}},EqRecord0:function(){return r.eqRowNil}},d={compare:t.ordNumberImpl(o.LT.value)(o.EQ.value)(o.GT.value),Eq0:function(){return r.eqNumber}},v={compare:t.ordIntImpl(o.LT.value)(o.EQ.value)(o.GT.value),Eq0:function(){return r.eqInt}},m={compare:t.ordCharImpl(o.LT.value)(o.EQ.value)(o.GT.value),Eq0:function(){return r.eqChar}},p=function(e){return e.compareRecord},g=function(e){return e.compare},y=function(e){return function(n){return function(t){return!(g(e)(n)(t)instanceof o.LT)}}};n.compare=g,n.compare1=function(e){return e.compare1},n.lessThan=function(e){return function(n){return function(t){return g(e)(n)(t)instanceof o.LT}}},n.lessThanOrEq=function(e){return function(n){return function(t){return!(g(e)(n)(t)instanceof o.GT)}}},n.greaterThan=function(e){return function(n){return function(t){return g(e)(n)(t)instanceof o.GT}}},n.greaterThanOrEq=y,n.comparing=function(e){return function(n){return function(t){return function(r){return g(e)(n(t))(n(r))}}}},n.min=function(e){return function(n){return function(t){var r=g(e)(n)(t);if(r instanceof o.LT)return n;if(r instanceof o.EQ)return n;if(r instanceof o.GT)return t;throw new Error("Failed pattern match at Data.Ord (line 167, column 3 - line 170, column 12): "+[r.constructor.name])}}},n.max=function(e){return function(n){return function(t){var r=g(e)(n)(t);if(r instanceof o.LT)return t;if(r instanceof o.EQ)return n;if(r instanceof o.GT)return n;throw new Error("Failed pattern match at Data.Ord (line 176, column 3 - line 179, column 12): "+[r.constructor.name])}}},n.abs=function(e){return function(n){return function(t){return y(e)(t)(u.zero(n.Semiring0()))?t:a.negate(n)(t)}}},n.signum=function(e){return function(n){return function(t){return y(e)(t)(u.zero(n.Semiring0()))?u.one(n.Semiring0()):a.negate(n)(u.one(n.Semiring0()))}}},n.ordInt=v,n.ordNumber=d,n.ordString=s,n.ordChar=m,n.ordArray=function(e){return{compare:(n=function(n){return function(t){var r=g(e)(n)(t);if(r instanceof o.EQ)return 0;if(r instanceof o.LT)return 1;if(r instanceof o.GT)return-1;throw new Error("Failed pattern match at Data.Ord (line 74, column 7 - line 77, column 17): "+[r.constructor.name])}},function(e){return function(r){return g(v)(0)(t.ordArrayImpl(n)(e)(r))}}),Eq0:function(){return r.eqArray(e.Eq0())}};var n},n.ordRecordNil=f,n.ordRecordCons=function(e){return function(){return function(n){return function(t){return{compareRecord:function(a){return function(a){return function(u){var s=i.reflectSymbol(n)(l.Proxy.value),f=g(t)(c.unsafeGet(s)(a))(c.unsafeGet(s)(u));return r.notEq(o.eqOrdering)(f)(o.EQ.value)?f:p(e)(l.Proxy.value)(a)(u)}}},EqRecord0:function(){return r.eqRowCons(e.EqRecord0())()(n)(t.Eq0())}}}}}},n.ordRecord=function(){return function(e){return{compare:p(e)(l.Proxy.value),Eq0:function(){return r.eqRec()(e.EqRecord0())}}}}}(c),function(e){"use strict";e._copyST=function(e){return function(){var n={};for(var t in e)hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n}},e.empty={},e.runST=function(e){return e()},e._fmapObject=function(e,n){var t={};for(var r in e)hasOwnProperty.call(e,r)&&(t[r]=n(e[r]));return t},e._mapWithKey=function(e,n){var t={};for(var r in e)hasOwnProperty.call(e,r)&&(t[r]=n(r)(e[r]));return t},e._foldM=function(e){return function(n){return function(t){return function(r){var o=t;function a(e){return function(t){return n(t)(e)(r[e])}}for(var u in r)hasOwnProperty.call(r,u)&&(o=e(o)(a(u)));return o}}}},e._lookup=function(e,n,t,r){return t in r?n(r[t]):e},e.toArrayWithKey=function(e){return function(n){var t=[];for(var r in n)hasOwnProperty.call(n,r)&&t.push(e(r)(n[r]));return t}}}(c["Foreign.Object"]=c["Foreign.Object"]||{}),function(e){"use strict";e.map_=function(e){return function(n){return function(){return e(n())}}},e.pure_=function(e){return function(){return e}},e.bind_=function(e){return function(n){return function(){return n(e())()}}},e.while=function(e){return function(n){return function(){for(;e();)n()}}},e.foreach=function(e){return function(n){return function(){for(var t=0,r=e.length;tn?-1:1,r=new Array(t*(n-e)+1),o=e,a=0;o!==n;)r[a++]=o,o+=t;return r[a]=o,r}},e.replicate="function"==typeof Array.prototype.fill?function(e){return function(n){return e<1?[]:new Array(e).fill(n)}}:function(e){return function(n){for(var t=[],r=0,o=0;o=t.length?n:e(t[r])}}}},e.findIndexImpl=function(e){return function(n){return function(t){return function(r){for(var o=0,a=r.length;o=r.length)return n;var o=r.slice();return o.splice(t,1),e(o)}}}},e.reverse=function(e){return e.slice().reverse()},e.concat=function(e){if(e.length<=1e4)return Array.prototype.concat.apply([],e);for(var n=[],t=0,r=e.length;t>1))-a>1&&e(n,t,o,r,a,i),u-i>1&&e(n,t,o,r,i,u),c=a,l=i,s=a;c0?(r[s++]=d,++l):(r[s++]=f,++c);for(;c=0;o--)r=e(t[o])(r);return r}}},e.foldlArray=function(e){return function(n){return function(t){for(var r=n,o=t.length,a=0;a="0"&&e[o]<="9"?"\\&":"";return"\\"+t.charCodeAt(0).toString(10)+a}))+'"'},e.showArrayImpl=function(e){return function(n){for(var t=[],r=0,o=n.length;r0?Math.floor(e):Math.ceil(e)}(t));return e(r)}catch(e){return n}}}},r.fromInt=function(e){return o(e)},r.toBase=function(e){return function(n){return n.toString(e)}},r.toNumber=function(e){return e.toJSNumber()},r.biAdd=function(e){return function(n){return e.add(n)}},r.biMul=function(e){return function(n){return e.multiply(n)}},r.biSub=function(e){return function(n){return e.minus(n)}},r.biMod=function(e){return function(n){return e.mod(n)}},r.biDiv=function(e){return function(n){return e.divide(n)}},r.biEquals=function(e){return function(n){return e.equals(n)}},r.biCompare=function(e){return function(n){return e.compare(n)}},r.abs=function(e){return e.abs()},function(e){"use strict";e.intDegree=function(e){return Math.min(Math.abs(e),2147483647)},e.intDiv=function(e){return function(n){return 0===n?0:n>0?Math.floor(e/n):-Math.floor(e/-n)}},e.intMod=function(e){return function(n){if(0===n)return 0;var t=Math.abs(n);return(e%t+t)%t}}}(c["Data.EuclideanRing"]=c["Data.EuclideanRing"]||{}),function(e){"use strict";e["Data.CommutativeRing"]=e["Data.CommutativeRing"]||{};var n=e["Data.CommutativeRing"],t=e["Data.Ring"],r={Ring0:function(){return t.ringInt}};n.commutativeRingInt=r}(c),function(e){"use strict";e["Data.EuclideanRing"]=e["Data.EuclideanRing"]||{};var n=e["Data.EuclideanRing"],t=e["Data.EuclideanRing"],r=e["Data.CommutativeRing"],o=e["Data.Eq"],a=e["Data.Semiring"],u=function(e){return e.mod},i={degree:t.intDegree,div:t.intDiv,mod:t.intMod,CommutativeRing0:function(){return r.commutativeRingInt}};n.div=function(e){return e.div},n.mod=u,n.gcd=function(e){return function(n){return function(t){return function(r){var i,c=e,l=n,s=t,f=!1;function d(e,n,t,i){if(o.eq(e)(i)(a.zero(n.CommutativeRing0().Ring0().Semiring0())))return f=!0,t;c=e,l=n,s=i,r=u(n)(t)(i)}for(;!f;)i=d(c,l,s,r);return i}}}},n.euclideanRingInt=i}(c),function(e){"use strict";e.fromNumberImpl=function(e){return function(n){return function(t){return(0|t)===t?e(t):n}}},e.toNumber=function(e){return e},e.fromStringAsImpl=function(e){return function(n){return function(t){var r;r=t<11?"[0-"+(t-1).toString()+"]":11===t?"[0-9a]":"[0-9a-"+String.fromCharCode(86+t)+"]";var o=new RegExp("^[\\+\\-]?"+r+"+$","i");return function(r){if(o.test(r)){var a=parseInt(r,t);return(0|a)===a?e(a):n}return n}}}},e.toStringAs=function(e){return function(n){return n.toString(e)}}}(c["Data.Int"]=c["Data.Int"]||{}),function(e){"use strict";e.topInt=2147483647,e.bottomInt=-2147483648,e.topChar=String.fromCharCode(65535),e.bottomChar=String.fromCharCode(0)}(c["Data.Bounded"]=c["Data.Bounded"]||{}),function(e){"use strict";e["Data.Bounded"]=e["Data.Bounded"]||{};var n=e["Data.Bounded"],t=e["Data.Bounded"],r=e["Data.Ord"],o={top:t.topInt,bottom:t.bottomInt,Ord0:function(){return r.ordInt}},a={top:t.topChar,bottom:t.bottomChar,Ord0:function(){return r.ordChar}};n.bottom=function(e){return e.bottom},n.top=function(e){return e.top},n.boundedInt=o,n.boundedChar=a}(c),function(e){"use strict";e.isNaN=isNaN,e.infinity=1/0,e.isFinite=isFinite}(c["Data.Number"]=c["Data.Number"]||{}),function(e){"use strict";e["Data.Number"]=e["Data.Number"]||{};var n=e["Data.Number"],t=e["Data.Number"];n.isNaN=t.isNaN,n.infinity=t.infinity,n.isFinite=t.isFinite}(c),function(e){"use strict";e.ceil=Math.ceil,e.floor=Math.floor,e.trunc=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)},e.remainder=function(e){return function(n){return e%n}},e.round=Math.round}(c.Math=c.Math||{}),function(e){"use strict";e.Math=e.Math||{};var n=e.Math,t=e.Math;n.ceil=t.ceil,n.floor=t.floor,n.round=t.round,n.trunc=t.trunc,n.remainder=t.remainder}(c),function(e){"use strict";e["Data.Int"]=e["Data.Int"]||{};var n=e["Data.Int"],t=e["Data.Int"],r=e["Data.Boolean"],o=e["Data.Bounded"],a=e["Data.Maybe"],u=e["Data.Number"],i=e.Math,c=t.fromStringAsImpl(a.Just.create)(a.Nothing.value)(10),l=t.fromNumberImpl(a.Just.create)(a.Nothing.value),s=function(e){if(!u.isFinite(e))return 0;if(e>=t.toNumber(o.top(o.boundedInt)))return o.top(o.boundedInt);if(e<=t.toNumber(o.bottom(o.boundedInt)))return o.bottom(o.boundedInt);if(r.otherwise)return a.fromMaybe(0)(l(e));throw new Error("Failed pattern match at Data.Int (line 66, column 1 - line 66, column 29): "+[e.constructor.name])};n.fromNumber=l,n.ceil=function(e){return s(i.ceil(e))},n.floor=function(e){return s(i.floor(e))},n.fromString=c,n.decimal=10,n.toNumber=t.toNumber,n.toStringAs=t.toStringAs}(c),function(e){"use strict";e["Data.BigInt"]=e["Data.BigInt"]||{};var n=e["Data.BigInt"],t=e["Data.BigInt"],r=e["Data.EuclideanRing"],o=e["Data.Int"],a=e["Data.Maybe"],u=e["Data.Ordering"],i=e["Data.Ring"],c=e["Data.Semiring"],l=t.toBase(10),s={show:function(e){return'fromString "'+l(e)+'"'}},f={add:t.biAdd,zero:t.fromInt(0),mul:t.biMul,one:t.fromInt(1)},d={sub:t.biSub,Semiring0:function(){return f}},v=t.fromNumberImpl(a.Just.create)(a.Nothing.value),m=t.fromBaseImpl(a.Just.create)(a.Nothing.value)(10),p={eq:t.biEquals},g={compare:function(e){return function(n){var r=t.biCompare(e)(n);return 1===r?u.GT.value:0===r?u.EQ.value:u.LT.value}},Eq0:function(){return p}},y={Ring0:function(){return d}},w={div:function(e){return function(n){return t.biDiv(i.sub(d)(e)(r.mod(w)(e)(n)))(n)}},mod:function(e){return function(n){var r=t.abs(n);return t.biMod(c.add(f)(t.biMod(e)(r))(r))(r)}},degree:function(e){return o.floor(t.toNumber(t.abs(e)))},CommutativeRing0:function(){return y}};n.fromString=m,n.fromNumber=v,n.toString=l,n.toInt=function(e){return o.fromNumber(t.toNumber(e))},n.eqBigInt=p,n.ordBigInt=g,n.showBigInt=s,n.semiringBigInt=f,n.ringBigInt=d,n.euclideanRingBigInt=w,n.fromInt=t.fromInt,n.abs=t.abs,n.toNumber=t.toNumber}(c),function(e){"use strict";var n=t(6628);e.parseBigNumberImpl=function(e,t,r){var o;try{o=new n(r)}catch(n){return e(n)}return t(o)},e.isInteger=function(e){return e.isInteger()},e.toNumber=function(e){return e.toNumber()},e.toString=function(e){return e.toString()},e.toFixed=function(e){return e.toFixed()},e.toFractionImpl=function(e){return function(n,t){var r=n.toFraction(t);return e(r[0])(r[1])}},e.fromNumber=function(e){return new n(e)}}(c["Data.BigNumber"]=c["Data.BigNumber"]||{}),function(e){"use strict";e.from=function(e){return e>>>0},e.exact=function(e){return function(n){return function(t){return function(r){var o=t(r);return o==r?e(o):n}}}},e.toInt=function(e){return 0|e},e.toNumber=function(e){return e},e.uintAdd=function(e){return function(n){return e+n>>>0}},e.uintMul=function(e){return function(n){return Math.imul(e,n)>>>0}},e.uintEq=function(e){return function(n){return e==n}},e.uintCmp=function(e){return function(n){return function(t){return function(r){return function(o){return r>>0}},e.or=function(e){return function(n){return(e|n)>>>0}},e.shl=function(e){return function(n){return e<>>0}},e.zshr=function(e){return function(n){return e>>>n>>>0}}}(c["Data.UInt"]=c["Data.UInt"]||{}),function(e){"use strict";e["Data.UInt"]=e["Data.UInt"]||{};var n=e["Data.UInt"],t=e["Data.UInt"],r=e["Data.Maybe"],o=e["Data.Ordering"],a={show:function(e){return t.toString(e)+"u"}},u={eq:t.uintEq},i={compare:t.uintCmp(o.LT.value)(o.EQ.value)(o.GT.value),Eq0:function(){return u}},c=t.from,l=t.exact(r.Just.create)(r.Nothing.value)(c),s=t.from,f={zero:s(0),add:t.uintAdd,one:s(1),mul:t.uintMul};n.fromInt=s,n["fromNumber'"]=l,n.fromString=function(e){return l(t.fromStringImpl(e))},n.uintSemiring=f,n.uintEqInstance=u,n.uintOrd=i,n.uintShowInstance=a,n.toInt=t.toInt,n.toNumber=t.toNumber,n.and=t.and,n.or=t.or,n.shl=t.shl,n.zshr=t.zshr,n.toString=t.toString}(c),function(e){"use strict";e["Data.BigNumber"]=e["Data.BigNumber"]||{};var n=e["Data.BigNumber"],t=e["Data.BigNumber"],r=e["Data.Either"],o=e["Data.Function.Uncurried"],a=e["Data.Tuple"],u=e["Data.UInt"],i=o.runFn3(t.parseBigNumberImpl)(r.Left.create)(r.Right.create);n.parseBigNumber=i,n.toFraction=function(e){return function(n){return t.toFractionImpl(a.Tuple.create)(e,n)}},n.fromUInt=function(e){return t.fromNumber(u.toNumber(e))},n.isInteger=t.isInteger,n.toNumber=t.toNumber,n.toString=t.toString,n.toFixed=t.toFixed,n.fromNumber=t.fromNumber}(c),function(e){"use strict";e["Data.Typelevel.Undefined"]=e["Data.Typelevel.Undefined"]||{};var n=e["Data.Typelevel.Undefined"],t=e["Data.Unit"].unit;n[void 0]=t}(c),function(e){"use strict";e.unsafeUnionFn=function(e,n){var t={};for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r]);for(var o in e)({}).hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}}(c["Record.Unsafe.Union"]=c["Record.Unsafe.Union"]||{}),function(e){"use strict";e["Record.Unsafe.Union"]=e["Record.Unsafe.Union"]||{};var n=e["Record.Unsafe.Union"],t=e["Record.Unsafe.Union"];n.unsafeUnionFn=t.unsafeUnionFn}(c),function(e){"use strict";e.Record=e.Record||{};var n=e.Record,t=e["Data.Symbol"],r=e["Record.Unsafe"],o=e["Record.Unsafe.Union"];n.get=function(e){return function(){return function(n){return function(o){return r.unsafeGet(t.reflectSymbol(e)(n))(o)}}}},n.set=function(e){return function(){return function(){return function(n){return function(o){return function(a){return r.unsafeSet(t.reflectSymbol(e)(n))(o)(a)}}}}}},n.insert=function(e){return function(){return function(){return function(n){return function(o){return function(a){return r.unsafeSet(t.reflectSymbol(e)(n))(o)(a)}}}}}},n.delete=function(e){return function(){return function(){return function(n){return function(o){return r.unsafeDelete(t.reflectSymbol(e)(n))(o)}}}}},n.merge=function(){return function(){return function(e){return function(n){return o.unsafeUnionFn(e,n)}}}}}(c),function(e){"use strict";e.typeOf=function(e){return typeof e},e.tagOf=function(e){return Object.prototype.toString.call(e).slice(8,-1)}}(c.Foreign=c.Foreign||{}),function(e){"use strict";e.pureE=function(e){return function(){return e}},e.bindE=function(e){return function(n){return function(){return n(e())()}}}}(c.Effect=c.Effect||{}),function(e){"use strict";e.Effect=e.Effect||{};var n=e.Effect,t=e.Effect,r=e["Control.Applicative"],o=e["Control.Monad"],a={Applicative0:function(){return c},Bind1:function(){return u}},u={bind:t.bindE,Apply0:function(){return i}},i={apply:o.ap(a),Functor0:function(){return l}},c={pure:t.pureE,Apply0:function(){return i}},l={map:r.liftA1(c)};n.functorEffect=l,n.applyEffect=i,n.applicativeEffect=c,n.bindEffect=u,n.monadEffect=a}(c),function(e){"use strict";e.showErrorImpl=function(e){return e.stack||e.toString()},e.error=function(e){return new Error(e)},e.message=function(e){return e.message},e.throwException=function(e){return function(){throw e}},e.catchException=function(e){return function(n){return function(){try{return n()}catch(n){return n instanceof Error||"[object Error]"===Object.prototype.toString.call(n)?e(n)():e(new Error(n.toString()))()}}}}}(c["Effect.Exception"]=c["Effect.Exception"]||{}),function(e){"use strict";e["Effect.Exception"]=e["Effect.Exception"]||{};var n=e["Effect.Exception"],t=e["Effect.Exception"],r=e["Control.Applicative"],o=e["Data.Either"],a=e["Data.Functor"],u=e.Effect,i={show:t.showErrorImpl};n.throw=function(e){return t.throwException(t.error(e))},n.try=function(e){return t.catchException((n=r.pure(u.applicativeEffect),function(e){return n(o.Left.create(e))}))(a.map(u.functorEffect)(o.Right.create)(e));var n},n.showError=i,n.error=t.error,n.message=t.message,n.throwException=t.throwException,n.catchException=t.catchException}(c),function(e){"use strict";e["Control.Monad.Error.Class"]=e["Control.Monad.Error.Class"]||{};var n=e["Control.Monad.Error.Class"],t=e["Control.Applicative"],r=e["Data.Either"],o=e["Data.Function"],a=e["Data.Functor"],u=e["Data.Maybe"],i=e.Effect,c=e["Effect.Exception"],l=function(e){return e.throwError},s={throwError:r.Left.create,Monad0:function(){return r.monadEither}},f={throwError:c.throwException,Monad0:function(){return i.monadEffect}},d={catchError:function(e){return function(n){if(e instanceof r.Left)return n(e.value0);if(e instanceof r.Right)return new r.Right(e.value0);throw new Error("Failed pattern match at Control.Monad.Error.Class (line 72, column 1 - line 74, column 35): "+[e.constructor.name,n.constructor.name])}},MonadThrow0:function(){return s}},v={catchError:o.flip(c.catchException),MonadThrow0:function(){return f}},m=function(e){return e.catchError};n.catchError=m,n.throwError=l,n.try=function(e){return function(n){return m(e)(a.map(e.MonadThrow0().Monad0().Bind1().Apply0().Functor0())(r.Right.create)(n))((o=t.pure(e.MonadThrow0().Monad0().Applicative0()),function(e){return o(r.Left.create(e))}));var o}},n.liftMaybe=function(e){return function(n){return u.maybe(l(e)(n))(t.pure(e.Monad0().Applicative0()))}},n.liftEither=function(e){return r.either(l(e))(t.pure(e.Monad0().Applicative0()))},n.monadThrowEither=s,n.monadErrorEither=d,n.monadThrowEffect=f,n.monadErrorEffect=v}(c),function(e){"use strict";e["Control.Monad.Reader.Class"]=e["Control.Monad.Reader.Class"]||{};var n=e["Control.Monad.Reader.Class"],t=e["Data.Functor"],r=function(e){return e.ask};n.ask=r,n.asks=function(e){return function(n){return t.map(e.Monad0().Bind1().Apply0().Functor0())(n)(r(e))}}}(c),function(e){"use strict";e["Control.Monad.State.Class"]=e["Control.Monad.State.Class"]||{};var n=e["Control.Monad.State.Class"],t=e["Data.Tuple"],r=e["Data.Unit"],o=function(e){return e.state};n.state=o,n.get=function(e){return o(e)((function(e){return new t.Tuple(e,e)}))},n.gets=function(e){return function(n){return o(e)((function(e){return new t.Tuple(n(e),e)}))}},n.put=function(e){return function(n){return o(e)((function(e){return new t.Tuple(r.unit,n)}))}},n.modify=function(e){return function(n){return o(e)((function(e){var r=n(e);return new t.Tuple(r,r)}))}},n.modify_=function(e){return function(n){return o(e)((function(e){return new t.Tuple(r.unit,n(e))}))}}}(c),function(e){"use strict";e["Control.Monad.Trans.Class"]=e["Control.Monad.Trans.Class"]||{},e["Control.Monad.Trans.Class"].lift=function(e){return e.lift}}(c),function(e){"use strict";e["Effect.Class"]=e["Effect.Class"]||{};var n=e["Effect.Class"],t=e["Control.Category"],r=e.Effect,o={liftEffect:t.identity(t.categoryFn),Monad0:function(){return r.monadEffect}};n.liftEffect=function(e){return e.liftEffect},n.monadEffectEffect=o}(c),function(e){"use strict";e["Control.Monad.Except.Trans"]=e["Control.Monad.Except.Trans"]||{};var n=e["Control.Monad.Except.Trans"],t=e["Control.Applicative"],r=e["Control.Apply"],o=e["Control.Bind"],a=e["Control.Monad"],u=e["Control.Monad.Reader.Class"],i=e["Control.Monad.State.Class"],c=e["Control.Monad.Trans.Class"],l=e["Data.Either"],s=e["Data.Functor"],f=e["Data.Monoid"],d=e["Data.Semigroup"],v=e["Effect.Class"],m={lift:function(e){return function(n){return o.bind(e.Bind1())(n)((function(n){return t.pure(e.Applicative0())(new l.Right(n))}))}}},p=function(e){return function(n){return e(n)}},g=function(e){return{map:function(n){return p(s.map(e)(s.map(l.functorEither)(n)))}}},y=function(e){return{Applicative0:function(){return b(e)},Bind1:function(){return w(e)}}},w=function(e){return{bind:function(n){return function(r){return o.bind(e.Bind1())(n)(l.either((a=t.pure(e.Applicative0()),function(e){return a(l.Left.create(e))}))((function(e){return r(e)})));var a}},Apply0:function(){return h(e)}}},h=function(e){return{apply:a.ap(y(e)),Functor0:function(){return g(e.Bind1().Apply0().Functor0())}}},b=function(e){return{pure:(n=t.pure(e.Applicative0()),function(e){return n(l.Right.create(e))}),Apply0:function(){return h(e)}};var n},C=function(e){return{throwError:(n=t.pure(e.Applicative0()),function(e){return n(l.Left.create(e))}),Monad0:function(){return y(e)}};var n};n.ExceptT=function(e){return e},n.runExceptT=function(e){return e},n.mapExceptT=p,n.except=function(e){var n=t.pure(e);return function(e){return n(e)}},n.functorExceptT=g,n.applyExceptT=h,n.applicativeExceptT=b,n.bindExceptT=w,n.monadExceptT=y,n.altExceptT=function(e){return function(n){return{alt:function(r){return function(a){return o.bind(n.Bind1())(r)((function(r){if(r instanceof l.Right)return t.pure(n.Applicative0())(new l.Right(r.value0));if(r instanceof l.Left)return o.bind(n.Bind1())(a)((function(o){if(o instanceof l.Right)return t.pure(n.Applicative0())(new l.Right(o.value0));if(o instanceof l.Left)return t.pure(n.Applicative0())(new l.Left(d.append(e)(r.value0)(o.value0)));throw new Error("Failed pattern match at Control.Monad.Except.Trans (line 87, column 9 - line 89, column 49): "+[o.constructor.name])}));throw new Error("Failed pattern match at Control.Monad.Except.Trans (line 83, column 5 - line 89, column 49): "+[r.constructor.name])}))}},Functor0:function(){return g(n.Bind1().Apply0().Functor0())}}}},n.monadTransExceptT=m,n.monadEffectExceptT=function(e){return{liftEffect:(n=c.lift(m)(e.Monad0()),t=v.liftEffect(e),function(e){return n(t(e))}),Monad0:function(){return y(e.Monad0())}};var n,t},n.monadThrowExceptT=C,n.monadErrorExceptT=function(e){return{catchError:function(n){return function(r){return o.bind(e.Bind1())(n)(l.either((function(e){return r(e)}))((a=t.pure(e.Applicative0()),function(e){return a(l.Right.create(e))})));var a}},MonadThrow0:function(){return C(e)}}},n.monadAskExceptT=function(e){return{ask:c.lift(m)(e.Monad0())(u.ask(e)),Monad0:function(){return y(e.Monad0())}}},n.monadStateExceptT=function(e){return{state:function(n){return c.lift(m)(e.Monad0())(i.state(e)(n))},Monad0:function(){return y(e.Monad0())}}},n.monoidExceptT=function(e){return function(n){return{mempty:t.pure(b(e))(f.mempty(n)),Semigroup0:function(){return function(e){return function(n){return{append:r.lift2(h(e))(d.append(n))}}}(e)(n.Semigroup0())}}}}}(c),function(e){"use strict";e["Data.NonEmpty"]=e["Data.NonEmpty"]||{};var n=e["Data.NonEmpty"],t=e["Control.Plus"],r=e["Data.Foldable"],o=e["Data.Functor"],a=e["Data.Semigroup"],u=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}();n.NonEmpty=u,n.singleton=function(e){return function(n){return new u(n,t.empty(e))}},n.functorNonEmpty=function(e){return{map:function(n){return function(t){return new u(n(t.value0),o.map(e)(n)(t.value1))}}}},n.foldableNonEmpty=function(e){return{foldMap:function(n){return function(t){return function(o){return a.append(n.Semigroup0())(t(o.value0))(r.foldMap(e)(n)(t)(o.value1))}}},foldl:function(n){return function(t){return function(o){return r.foldl(e)(n)(n(t)(o.value0))(o.value1)}}},foldr:function(n){return function(t){return function(o){return n(o.value0)(r.foldr(e)(n)(t)(o.value1))}}}}}}(c),function(e){"use strict";e["Data.List.Types"]=e["Data.List.Types"]||{};var n,t=e["Data.List.Types"],r=e["Control.Applicative"],o=e["Control.Apply"],a=e["Control.Bind"],u=e["Control.Category"],i=e["Data.Eq"],c=e["Data.Foldable"],l=e["Data.Function"],s=e["Data.Functor"],f=e["Data.Maybe"],d=e["Data.Monoid"],v=e["Data.NonEmpty"],m=e["Data.Ord"],p=e["Data.Ordering"],g=e["Data.Semigroup"],y=e["Data.Traversable"],w=function(){function e(){}return e.value=new e,e}(),h=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),b={map:function(e){var n;return n=w.value,function(t){var r,o=n,a=!1;function u(n,r){return r instanceof h&&r.value1 instanceof h&&r.value1.value1 instanceof h?(o=new h(r,n),void(t=r.value1.value1.value1)):(a=!0,(i=n,function(n){for(var t,r,o,a=i,u=!1;!u;)o=n,t=(r=a)instanceof h&&r.value0 instanceof h&&r.value0.value1 instanceof h&&r.value0.value1.value1 instanceof h?(a=r.value1,void(n=new h(e(r.value0.value0),new h(e(r.value0.value1.value0),new h(e(r.value0.value1.value1.value0),o))))):(u=!0,o);return t})((u=r)instanceof h&&u.value1 instanceof h&&u.value1.value1 instanceof w?new h(e(u.value0),new h(e(u.value1.value0),w.value)):u instanceof h&&u.value1 instanceof w?new h(e(u.value0),w.value):w.value));var u,i}for(;!a;)r=u(o,t);return r}}},C=v.functorNonEmpty(b),A={foldr:function(e){return function(n){var t,r=(t=w.value,function(e){var n,r=t,o=!1;function a(n,t){if(t instanceof w)return o=!0,n;if(t instanceof h)return r=new h(t.value0,n),void(e=t.value1);throw new Error("Failed pattern match at Data.List.Types (line 108, column 7 - line 108, column 23): "+[n.constructor.name,t.constructor.name])}for(;!o;)n=a(r,e);return n}),o=c.foldl(A)(l.flip(e))(n);return function(e){return o(r(e))}}},foldl:function(e){return function(n){return function(t){var r,o=n,a=!1;function u(n,r){if(r instanceof w)return a=!0,n;if(r instanceof h)return o=e(n)(r.value0),void(t=r.value1);throw new Error("Failed pattern match at Data.List.Types (line 112, column 12 - line 114, column 30): "+[r.constructor.name])}for(;!a;)r=u(o,t);return r}}},foldMap:function(e){return function(n){return c.foldl(A)((function(t){var r=g.append(e.Semigroup0())(t);return function(e){return r(n(e))}}))(d.mempty(e))}}},S=v.foldableNonEmpty(A),I={append:function(e){return function(n){return c.foldr(A)(h.create)(n)(e)}}},T={mempty:w.value,Semigroup0:function(){return I}},D={append:function(e){return function(n){return new v.NonEmpty(e.value0,g.append(I)(e.value1)(function(e){return new h(e.value0,e.value1)}(n)))}}},F={traverse:function(e){return function(n){var t=s.map(e.Apply0().Functor0())(c.foldl(A)(l.flip(h.create))(w.value)),a=c.foldl(A)((function(t){var r=o.lift2(e.Apply0())(l.flip(h.create))(t);return function(e){return r(n(e))}}))(r.pure(e)(w.value));return function(e){return t(a(e))}}},sequence:function(e){return y.traverse(F)(e)(u.identity(u.categoryFn))},Functor0:function(){return b},Foldable1:function(){return A}},E={unfoldr1:function(e){return function(n){var t;return(t=n,function(n){var r,o=t,a=!1;function u(t,r){var u=e(t);if(u.value1 instanceof f.Just)return o=u.value1.value0,void(n=new h(u.value0,r));if(u.value1 instanceof f.Nothing)return a=!0,c.foldl(A)(l.flip(h.create))(w.value)(new h(u.value0,r));throw new Error("Failed pattern match at Data.List.Types (line 136, column 22 - line 138, column 61): "+[u.constructor.name])}for(;!a;)r=u(o,n);return r})(w.value)}}},x={unfoldr:function(e){return function(n){var t;return(t=n,function(n){var r,o=t,a=!1;function u(t,r){var u=e(t);if(u instanceof f.Nothing)return a=!0,c.foldl(A)(l.flip(h.create))(w.value)(r);if(u instanceof f.Just)return o=u.value0.value1,void(n=new h(u.value0.value0,r));throw new Error("Failed pattern match at Data.List.Types (line 143, column 22 - line 145, column 52): "+[u.constructor.name])}for(;!a;)r=u(o,n);return r})(w.value)}},Unfoldable10:function(){return E}},M={eq1:function(e){return function(n){return function(t){var r;return(r=n,function(n){return function(t){for(var o,a,u,c,l=r,s=n,f=!1;!f;)a=l,u=s,o=(c=t)?a instanceof w&&u instanceof w?(f=!0,c):a instanceof h&&u instanceof h?(l=a.value1,s=u.value1,void(t=c&&i.eq(e)(u.value0)(a.value0))):(f=!0,!1):(f=!0,!1);return o}})(t)(!0)}}}},R={compare1:function(e){return function(n){return function(t){var r;return(r=n,function(n){var t,o=r,a=!1;function u(t,r){if(t instanceof w&&r instanceof w)return a=!0,p.EQ.value;if(t instanceof w)return a=!0,p.LT.value;if(r instanceof w)return a=!0,p.GT.value;if(t instanceof h&&r instanceof h){var u=m.compare(e)(t.value0)(r.value0);return u instanceof p.EQ?(o=t.value1,void(n=r.value1)):(a=!0,u)}throw new Error("Failed pattern match at Data.List.Types (line 61, column 5 - line 61, column 20): "+[t.constructor.name,r.constructor.name])}for(;!a;)t=u(o,n);return t})(t)}}},Eq10:function(){return M}},P={apply:function(e){return function(n){if(e instanceof w)return w.value;if(e instanceof h)return g.append(I)(s.map(b)(e.value0)(n))(o.apply(P)(e.value1)(n));throw new Error("Failed pattern match at Data.List.Types (line 158, column 1 - line 160, column 48): "+[e.constructor.name,n.constructor.name])}},Functor0:function(){return b}},B={apply:function(e){return function(n){return new v.NonEmpty(e.value0(n.value0),g.append(I)(o.apply(P)(e.value1)(new h(n.value0,w.value)))(o.apply(P)(new h(e.value0,e.value1))(n.value1)))}},Functor0:function(){return C}},k={bind:function(e){return function(n){if(e instanceof w)return w.value;if(e instanceof h)return g.append(I)(n(e.value0))(a.bind(k)(e.value1)(n));throw new Error("Failed pattern match at Data.List.Types (line 165, column 1 - line 167, column 37): "+[e.constructor.name,n.constructor.name])}},Apply0:function(){return P}},N={pure:function(e){return new h(e,w.value)},Apply0:function(){return P}},L={alt:g.append(I),Functor0:function(){return b}},_={empty:w.value,Alt0:function(){return L}},U={Applicative0:function(){return N},Plus1:function(){return _}},H={pure:(n=v.singleton(_),function(e){return n(e)}),Apply0:function(){return B}};t.Nil=w,t.Cons=h,t.NonEmptyList=function(e){return e},t.ordList=function(e){return{compare:m.compare1(R)(e),Eq0:function(){return n=e.Eq0(),{eq:i.eq1(M)(n)};var n}}},t.semigroupList=I,t.monoidList=T,t.functorList=b,t.foldableList=A,t.unfoldableList=x,t.traversableList=F,t.applicativeList=N,t.bindList=k,t.plusList=_,t.alternativeList=U,t.functorNonEmptyList=C,t.applicativeNonEmptyList=H,t.semigroupNonEmptyList=D,t.foldableNonEmptyList=S}(c),function(e){"use strict";e["Data.List.NonEmpty"]=e["Data.List.NonEmpty"]||{};var n,t=e["Data.List.NonEmpty"],r=e["Data.List.Types"],o=e["Data.NonEmpty"],a=(n=o.singleton(r.plusList),function(e){return r.NonEmptyList(n(e))});t.singleton=a,t.head=function(e){return e.value0}}(c),function(e){"use strict";e.Foreign=e.Foreign||{};var n=e.Foreign,t=e.Foreign,r=e["Control.Applicative"],o=e["Control.Monad.Error.Class"],a=e["Control.Monad.Except.Trans"],u=e["Data.Boolean"],i=e["Data.List.NonEmpty"],c=e["Data.Show"],l=e["Unsafe.Coerce"],s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),d=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),v=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),m=l.unsafeCoerce,p=l.unsafeCoerce,g=function(e){if(e instanceof s)return e.value0;if(e instanceof d)return"Error at array index "+c.show(c.showInt)(e.value0)+": "+g(e.value1);if(e instanceof v)return"Error at property "+c.show(c.showString)(e.value0)+": "+g(e.value1);if(e instanceof f)return"Type mismatch: expected "+e.value0+", found "+e.value1;throw new Error("Failed pattern match at Foreign (line 73, column 1 - line 73, column 45): "+[e.constructor.name])},y=function(e){var n=o.throwError(a.monadThrowExceptT(e));return function(e){return n(i.singleton(e))}},w=function(e){return function(n){return function(o){if(t.tagOf(o)===n)return r.pure(a.applicativeExceptT(e))(p(o));if(u.otherwise)return y(e)(new f(n,t.tagOf(o)));throw new Error("Failed pattern match at Foreign (line 110, column 1 - line 110, column 71): "+[n.constructor.name,o.constructor.name])}}};n.ForeignError=s,n.renderForeignError=g,n.unsafeToForeign=m,n.unsafeReadTagged=w,n.readString=function(e){return w(e)("String")},n.fail=y,n.typeOf=t.typeOf}(c),function(e){e.undefined=void 0}(c["Literals.Undefined"]=c["Literals.Undefined"]||{}),function(e){"use strict";e["Literals.Undefined"]=e["Literals.Undefined"]||{};var n=e["Literals.Undefined"],t=e["Literals.Undefined"];n[void 0]=t[void 0]}(c),function(e){"use strict";e["Untagged.Castable"]=e["Untagged.Castable"]||{};var n=e["Untagged.Castable"],t=e["Unsafe.Coerce"];n.cast=function(){return t.unsafeCoerce}}(c),function(e){"use strict";e["Untagged.TypeCheck"]=e["Untagged.TypeCheck"]||{};var n=e["Untagged.TypeCheck"],t=e.Foreign,r={hasRuntimeType:function(e){return"string",function(e){return"string"===t.typeOf(e)}}};n.hasRuntimeType=function(e){return e.hasRuntimeType},n.hasRuntimeTypeString=r}(c),function(e){"use strict";e["Untagged.Union"]=e["Untagged.Union"]||{};var n=e["Untagged.Union"],t=e["Data.Either"],r=e["Data.Maybe"],o=e.Foreign,a=e["Literals.Undefined"],u=e["Type.Proxy"],i=e["Untagged.Castable"],c=e["Untagged.TypeCheck"],l=i.cast;n.asOneOf=l,n.toEither1=function(e){return function(e){return function(n){return function(t){return function(r){return c.hasRuntimeType(e)(u.Proxy.value)(o.unsafeToForeign(r))?n(r):t(r)}}}}(e)(t.Left.create)(t.Right.create)},n.maybeToUor=function(e){if(e instanceof r.Just)return e.value0;if(e instanceof r.Nothing)return i.cast()(a[void 0]);throw new Error("Failed pattern match at Untagged.Union (line 121, column 1 - line 121, column 49): "+[e.constructor.name])}}(c),function(e){"use strict";e.Aeson=e.Aeson||{};var n,t,r,o,a,u=e.Aeson,i=e.Aeson,c=e["Control.Alt"],l=e["Control.Applicative"],s=e["Control.Bind"],f=e["Control.Category"],d=e["Control.Lazy"],v=e["Data.Argonaut.Core"],m=e["Data.Argonaut.Decode.Error"],p=e["Data.Argonaut.Encode.Encoders"],g=e["Data.Bifunctor"],y=e["Data.BigInt"],w=e["Data.BigNumber"],h=e["Data.Either"],b=e["Data.Function"],C=e["Data.Functor"],A=e["Data.Int"],S=e["Data.Maybe"],I=e["Data.Number"],T=e["Data.Symbol"],D=e["Data.Traversable"],F=e["Data.Typelevel.Undefined"],E=e["Data.UInt"],x=e["Foreign.Object"],M=e.Record,R=e["Type.Proxy"],P=e["Untagged.Union"],B={show:i.stringifyAeson},k={gDecodeAeson:function(e){return function(e){return new h.Right({})}}},N={encodeAeson:i.fromString},L={encodeAeson:i.fromFiniteBigNumber},_={encodeAeson:f.identity(f.categoryFn)},U={decodeAeson:l.pure(h.applicativeEither)},H=function(e){return e(S.Nothing.value)(S.Just.create)},q=function(e){return h.note(new m.TypeMismatch("JSON String"))(i.parseAeson(S.Nothing.value)(S.Just.create)(e))},O={gEncodeAeson:function(e){return function(e){return x.empty}}},W=function(e){return e.gEncodeAeson},V=function(e){return e.gDecodeAeson},K={encodeAeson:function(e){return i.fromFiniteBigNumber(w.fromUInt(e))}},z=function(e){return e.encodeAeson},J={encodeAeson:(t=h.fromRight(F[void 0]),r=C.map(h.functorEither)((n=z(L),function(e){return n(e)})),function(e){return t(r(w.parseBigNumber(y.toString(e))))})},j=function(e){return{encodeAeson:(n=C.map(C.functorArray)(z(e)),function(e){return i.fromArray(n(e))})};var n},Q=function(e){return{encodeAeson:function(n){return i.fromObject(C.map(x.functorObject)(z(e))(n))}}},G=function(e){return e.decodeAeson},Z=function(e){var n=b.const(e);return{caseObject:n,caseNull:n,caseBoolean:n,caseString:n,caseFiniteBigNumber:n,caseArray:n}},X=function(e){return function(n){return i._caseAeson(e.caseNull)(e.caseBoolean)(e.caseFiniteBigNumber)(e.caseString)(e.caseArray)(e.caseObject)(n)}},Y=function(e){return function(n){return X({caseArray:n,caseBoolean:(t=Z(e)).caseBoolean,caseFiniteBigNumber:t.caseFiniteBigNumber,caseNull:t.caseNull,caseObject:t.caseObject,caseString:t.caseString});var t}},$={decodeAeson:(o=new h.Left(new m.TypeMismatch("Boolean")),function(e){return X({caseBoolean:e,caseArray:(n=Z(o)).caseArray,caseFiniteBigNumber:n.caseFiniteBigNumber,caseNull:n.caseNull,caseObject:n.caseObject,caseString:n.caseString});var n})(h.Right.create)},ee=function(e){return function(n){return X({caseFiniteBigNumber:n,caseArray:(t=Z(e)).caseArray,caseBoolean:t.caseBoolean,caseNull:t.caseNull,caseObject:t.caseObject,caseString:t.caseString});var t}},ne=function(e){return function(n){return ee(e)((function(e){return n(e)}))}},te=function(e){return function(n){var t=S.maybe(e)(n),r=ne(S.Nothing.value)((function(e){return w.isInteger(e)?y.fromString(w.toFixed(e)):S.Nothing.value}));return function(e){return t(r(e))}}},re={decodeAeson:te(new h.Left(new m.TypeMismatch("BigInt")))(h.Right.create)},oe=function(e){return function(n){return function(e){return function(n){return ne(e)((t=S.maybe(e)(n),function(e){return t((n=w.toNumber(e),I.isFinite(n)&&!I.isNaN(n)?new S.Just(n):S.Nothing.value));var n}));var t}}(e)((function(e){return n(e)}))}},ae=(H(oe),{decodeAeson:oe(new h.Left(new m.TypeMismatch("Number")))(h.Right.create)}),ue={decodeAeson:function(e){return function(n){var t=S.maybe(e)(n),r=ne(S.Nothing.value)((function(e){return w.isInteger(e)?A.fromNumber(w.toNumber(e)):S.Nothing.value}));return function(e){return t(r(e))}}}(new h.Left(new m.TypeMismatch("Int")))(h.Right.create)},ie={decodeAeson:function(e){return function(n){var t=S.maybe(e)(n),r=ne(S.Nothing.value)((function(e){return w.isInteger(e)?E["fromNumber'"](w.toNumber(e)):S.Nothing.value}));return function(e){return t(r(e))}}}(new h.Left(new m.TypeMismatch("UInt")))(h.Right.create)},ce={decodeAeson:ee(new h.Left(new m.TypeMismatch("Finite BigNumber")))(h.Right.create)},le=(a=function(e){return function(n){return X({caseNull:n,caseArray:(t=Z(e)).caseArray,caseBoolean:t.caseBoolean,caseFiniteBigNumber:t.caseFiniteBigNumber,caseObject:t.caseObject,caseString:t.caseString});var t}},a(!1)(b.const(!0))),se=function(e){return function(n){return X({caseObject:n,caseArray:(t=Z(e)).caseArray,caseBoolean:t.caseBoolean,caseFiniteBigNumber:t.caseFiniteBigNumber,caseNull:t.caseNull,caseString:t.caseString});var t}},fe=function(e){return function(n){return X({caseString:n,caseArray:(t=Z(e)).caseArray,caseBoolean:t.caseBoolean,caseFiniteBigNumber:t.caseFiniteBigNumber,caseNull:t.caseNull,caseObject:t.caseObject});var t}},de=H(fe),ve={decodeAeson:fe(new h.Left(new m.TypeMismatch("String")))(h.Right.create)},me=d.defer(d.lazyFn)((function(e){return X({caseNull:b.const(v.jsonNull),caseBoolean:p.encodeBoolean,caseFiniteBigNumber:function(e){return p.encodeString(w.toString(e))},caseString:p.encodeString,caseArray:(t=C.map(C.functorArray)(me),function(e){return v.fromArray(t(e))}),caseObject:(n=C.map(x.functorObject)(me),function(e){return v.fromObject(n(e))})});var n,t})),pe=function(e){return{decodeAeson:function(n){var t=function(e){return function(t){return C.map(h.functorEither)(S.Just.create)(G(e)(n))}};return X({caseNull:b.const(new h.Right(S.Nothing.value)),caseBoolean:t(e),caseFiniteBigNumber:t(e),caseString:t(e),caseArray:t(e),caseObject:t(e)})(n)}}};u.unpackFinite=function(e){return e},u.caseAesonArray=Y,u.caseAesonBigInt=te,u.caseAesonObject=se,u.caseAesonString=fe,u.decodeAeson=G,u.decodeJsonString=function(e){return s.composeKleisli(h.bindEither)(q)(G(e))},u.encodeAeson=z,u.getField=function(e){return function(n){return function(t){var r;return(r=G(e),function(e){return function(n){return S.maybe(new h.Left(new m.AtKey(n,m.MissingValue.value)))((t=g.lmap(g.bifunctorEither)(m.AtKey.create(n)),function(e){return t(r(e))}))(x.lookup(n)(e));var t}})(n)(t)}}},u.getFieldOptional=function(e){var n;return n=G(e),function(e){return function(t){var r,o,a=(r=g.lmap(g.bifunctorEither)(m.AtKey.create(t)),function(e){return r(n(e))});return S.maybe(l.pure(h.applicativeEither)(S.Nothing.value))((o=C.map(h.functorEither)(S.Just.create),function(e){return o(a(e))}))(x.lookup(t)(e))}}},u["getFieldOptional'"]=function(e){var n;return n=G(e),function(e){return function(t){return S.maybe(l.pure(h.applicativeEither)(S.Nothing.value))((function(e){return le(e)?l.pure(h.applicativeEither)(S.Nothing.value):C.map(h.functorEither)(S.Just.create)(g.lmap(g.bifunctorEither)(m.AtKey.create(t))(n(e)))}))(x.lookup(t)(e))}}},u.parseJsonStringToAeson=q,u.isNull=le,u.toString=de,u.toStringifiedNumbersJson=me,u.showAeson=B,u.decodeAesonUInt=ie,u.decodeAesonInt=ue,u.decodeAesonBigInt=re,u.decodeAesonNumber=ae,u.decodeAesonFiniteBigNumbe=ce,u.decodeAesonBoolean=$,u.decodeAesonString=ve,u.decodeAesonAeson=U,u.decodeAesonObject=function(e){return{decodeAeson:se(new h.Left(new m.TypeMismatch("Object")))(D.traverse(x.traversableObject)(h.applicativeEither)(G(e)))}},u.decodeAesonRecord=function(e){return function(){return{decodeAeson:se(new h.Left(new m.TypeMismatch("Record")))((function(n){return V(e)(n)(R.Proxy.value)}))}}},u["decodeAeson|+|"]=function(){return function(e){return function(n){return{decodeAeson:function(t){return c.alt(h.altEither)(C.map(h.functorEither)(P.asOneOf())(G(e)(t)))(C.map(h.functorEither)(P.asOneOf())(G(n)(t)))}}}}},u.decodeAesonArray=function(e){return{decodeAeson:Y(new h.Left(new m.TypeMismatch("Array")))(D.traverse(D.traversableArray)(h.applicativeEither)(G(e)))}},u.decodeAesonMaybe=pe,u.gDecodeAesonRowNil=k,u.gDecodeAesonCons=function(e){return function(n){return function(t){return function(){return function(){return{gDecodeAeson:function(r){return function(o){var a=T.reflectSymbol(t)(R.Proxy.value),u=x.lookup(a)(r),i=e.decodeAesonField(u);if(i instanceof S.Just)return s.bind(h.bindEither)(g.lmap(g.bifunctorEither)(m.AtKey.create(a))(i.value0))((function(e){return s.bind(h.bindEither)(V(n)(r)(R.Proxy.value))((function(n){return new h.Right(M.insert(t)()()(R.Proxy.value)(e)(n))}))}));if(i instanceof S.Nothing)return new h.Left(new m.AtKey(a,m.MissingValue.value));throw new Error("Failed pattern match at Aeson (line 718, column 5 - line 725, column 44): "+[i.constructor.name])}}}}}}}},u.decodeAesonFieldMaybe=function(e){return{decodeAesonField:(n=S.maybe(new h.Right(S.Nothing.value))(G(pe(e))),function(e){return S.Just.create(n(e))})};var n},u.decodeAesonField1=function(e){return{decodeAesonField:function(n){return C.map(S.functorMaybe)(G(e))(n)}}},u.encodeAesonBigInt=J,u.encodeAesonUInt=K,u.encodeAesonString=N,u.encodeAesonAeson=_,u.encodeAesonObject=Q,u.encodeAesonRecord=function(e){return function(){return{encodeAeson:function(n){return z(Q(_))(W(e)(n)(R.Proxy.value))}}}},u.encodeAesonArray=j,u.encodeTupleAuxTuple=function(e){return function(n){return{tupleToArray:function(t){return[z(e)(t.value0),z(n)(t.value1)]}}}},u.encodeAesonTuple=function(e){return{encodeAeson:(n=z(j(_)),t=e.tupleToArray,function(e){return n(t(e))})};var n,t},u.encodeAesonMaybe=function(e){return{encodeAeson:function(n){if(n instanceof S.Nothing)return i.aesonNull;if(n instanceof S.Just)return z(e)(n.value0);throw new Error("Failed pattern match at Aeson (line 845, column 1 - line 847, column 39): "+[n.constructor.name])}}},u.gEncodeAesonNil=O,u.gEncodeAesonCons=function(e){return function(n){return function(t){return function(){return{gEncodeAeson:function(r){return function(o){return x.insert(T.reflectSymbol(t)(R.Proxy.value))(z(e)(M.get(t)()(R.Proxy.value)(r)))(W(n)(r)(R.Proxy.value))}}}}}}},u.stringifyAeson=i.stringifyAeson}(c),function(n){"use strict";var r;n._ajax=(r={},!e.require||void 0!==a&&a.versions.electron?(r.newXHR=function(){return new XMLHttpRequest},r.fixupUrl=function(e){return e||"/"},r.getResponse=function(e){return e.response}):(r.newXHR=function(){return new(t(6473))},r.fixupUrl=function(e,n){if(null===n.nodejsBaseUrl){var r=t(5214),o=r.parse(e);return o.protocol=o.protocol||"http:",o.hostname=o.hostname||"localhost",r.format(o)}return e||"/"},r.getResponse=function(e){return e.response}),function(e,n,t,o){return function(a,u){var i=r.newXHR(),c=r.fixupUrl(o.url,i);if(i.open(o.method||"GET",c,!0,o.username,o.password),o.headers)try{for(var l,s=0;null!=(l=o.headers[s]);s++)i.setRequestHeader(l.field,l.value)}catch(e){a(e)}var f=function(e){return function(){a(new Error(e))}};return i.onerror=f(n),i.ontimeout=f(e),i.onload=function(){u({status:i.status,statusText:i.statusText,headers:i.getAllResponseHeaders().split("\r\n").filter((function(e){return e.length>0})).map((function(e){var n=e.indexOf(":");return t(e.substring(0,n))(e.substring(n+2))})),body:r.getResponse(i)})},i.responseType=o.responseType,i.withCredentials=o.withCredentials,i.timeout=o.timeout,i.send(o.content),function(e,n,t){try{i.abort()}catch(e){return n(e)}return t()}}})}(c.Affjax=c.Affjax||{}),function(e){"use strict";e["Data.MediaType.Common"]=e["Data.MediaType.Common"]||{};var n=e["Data.MediaType.Common"];n.applicationFormURLEncoded="application/x-www-form-urlencoded",n.applicationJSON="application/json"}(c),function(e){"use strict";e["Affjax.RequestBody"]=e["Affjax.RequestBody"]||{};var n=e["Affjax.RequestBody"],t=e["Data.Maybe"],r=e["Data.MediaType.Common"],o=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),a=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),u=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),i=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f=i.create;n.ArrayView=o,n.Blob=a,n.Document=u,n.String=i,n.FormData=c,n.FormURLEncoded=l,n.Json=s,n.arrayView=function(e){return new o((function(n){return n(e)}))},n.string=f,n.toMediaType=function(e){return e instanceof l?new t.Just(r.applicationFormURLEncoded):e instanceof s?new t.Just(r.applicationJSON):t.Nothing.value}}(c),function(e){"use strict";e["Affjax.RequestHeader"]=e["Affjax.RequestHeader"]||{};var n=e["Affjax.RequestHeader"],t=e["Data.Newtype"],r=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),o=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),a=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}();n.Accept=r,n.ContentType=o,n.RequestHeader=a,n.name=function(e){if(e instanceof r)return"Accept";if(e instanceof o)return"Content-Type";if(e instanceof a)return e.value0;throw new Error("Failed pattern match at Affjax.RequestHeader (line 21, column 1 - line 21, column 32): "+[e.constructor.name])},n.value=function(e){if(e instanceof r)return t.unwrap()(e.value0);if(e instanceof o)return t.unwrap()(e.value0);if(e instanceof a)return e.value1;throw new Error("Failed pattern match at Affjax.RequestHeader (line 26, column 1 - line 26, column 33): "+[e.constructor.name])}}(c),function(e){"use strict";e["Affjax.ResponseFormat"]=e["Affjax.ResponseFormat"]||{};var n=e["Affjax.ResponseFormat"],t=e["Control.Category"],r=e["Data.Maybe"],o=e["Data.MediaType.Common"],a=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),u=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),i=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f=new l(t.identity(t.categoryFn)),d=new s(t.identity(t.categoryFn));n.ArrayBuffer=a,n.Blob=u,n.Document=i,n.Json=c,n.String=l,n.Ignore=s,n.string=f,n.ignore=d,n.toResponseType=function(e){if(e instanceof a)return"arraybuffer";if(e instanceof u)return"blob";if(e instanceof i)return"document";if(e instanceof c)return"text";if(e instanceof l)return"text";if(e instanceof s)return"";throw new Error("Failed pattern match at Affjax.ResponseFormat (line 44, column 3 - line 50, column 19): "+[e.constructor.name])},n.toMediaType=function(e){return e instanceof c?new r.Just(o.applicationJSON):r.Nothing.value}}(c),function(e){"use strict";e["Affjax.ResponseHeader"]=e["Affjax.ResponseHeader"]||{};var n=e["Affjax.ResponseHeader"],t=e["Data.Show"],r=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),o={show:function(e){return"(ResponseHeader "+t.show(t.showString)(e.value0)+" "+t.show(t.showString)(e.value1)+")"}};n.ResponseHeader=r,n.showResponseHeader=o}(c),function(e){"use strict";e["Control.Monad.Except"]=e["Control.Monad.Except"]||{};var n,t=e["Control.Monad.Except"],r=e["Control.Monad.Except.Trans"],o=e["Data.Newtype"],a=(n=o.unwrap(),function(e){return n(r.runExceptT(e))});t.runExcept=a}(c),function(e){"use strict";e._jsonParser=function(e,n,t){try{return n(JSON.parse(t))}catch(n){return e(n.message)}}}(c["Data.Argonaut.Parser"]=c["Data.Argonaut.Parser"]||{}),function(e){"use strict";e["Data.Argonaut.Parser"]=e["Data.Argonaut.Parser"]||{};var n=e["Data.Argonaut.Parser"],t=e["Data.Argonaut.Parser"],r=e["Data.Either"];n.jsonParser=function(e){return t._jsonParser(r.Left.create,r.Right.create,e)}}(c),function(e){"use strict";e.replaceAll=function(e){return function(n){return function(t){return t.replace(new RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}}},e.split=function(e){return function(n){return n.split(e)}},e.joinWith=function(e){return function(n){return n.join(e)}}}(c["Data.String.Common"]=c["Data.String.Common"]||{}),function(e){"use strict";e["Data.String.Common"]=e["Data.String.Common"]||{};var n=e["Data.String.Common"],t=e["Data.String.Common"];n.null=function(e){return""===e},n.replaceAll=t.replaceAll,n.split=t.split,n.joinWith=t.joinWith}(c),function(e){"use strict";e._encodeFormURLComponent=function(e,n,t){try{return n(function(e){return e.replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16)}))}(encodeURIComponent(t)).replace(/%20/g,"+"))}catch(n){return e(n)}}}(c.JSURI=c.JSURI||{}),function(e){"use strict";e.JSURI=e.JSURI||{};var n=e.JSURI,t=e.JSURI,r=e["Data.Function"],o=e["Data.Function.Uncurried"],a=e["Data.Maybe"],u=o.runFn3(t._encodeFormURLComponent)(r.const(a.Nothing.value))(a.Just.create);n.encodeFormURLComponent=u}(c),function(e){"use strict";e["Data.FormURLEncoded"]=e["Data.FormURLEncoded"]||{};var n,t,r=e["Data.FormURLEncoded"],o=e["Control.Apply"],a=e["Data.Functor"],u=e["Data.Maybe"],i=e["Data.String.Common"],c=e["Data.Traversable"],l=e.JSURI,s=(n=a.map(u.functorMaybe)(i.joinWith("&")),t=c.traverse(c.traversableArray)(u.applicativeMaybe)((function(e){if(e.value1 instanceof u.Nothing)return l.encodeFormURLComponent(e.value0);if(e.value1 instanceof u.Just)return o.apply(u.applyMaybe)(a.map(u.functorMaybe)((function(e){return function(n){return e+"="+n}}))(l.encodeFormURLComponent(e.value0)))(l.encodeFormURLComponent(e.value1.value0));throw new Error("Failed pattern match at Data.FormURLEncoded (line 37, column 18 - line 39, column 116): "+[e.constructor.name])})),function(e){return n(t(e))});r.encode=s}(c),function(e){"use strict";e["Data.HTTP.Method"]=e["Data.HTTP.Method"]||{};var n=e["Data.HTTP.Method"],t=e["Data.Either"],r=e["Data.Show"],o=function(){function e(){}return e.value=new e,e}(),a=function(){function e(){}return e.value=new e,e}(),u=function(){function e(){}return e.value=new e,e}(),i=function(){function e(){}return e.value=new e,e}(),c=function(){function e(){}return e.value=new e,e}(),l=function(){function e(){}return e.value=new e,e}(),s=function(){function e(){}return e.value=new e,e}(),f=function(){function e(){}return e.value=new e,e}(),d=function(){function e(){}return e.value=new e,e}(),v=function(){function e(){}return e.value=new e,e}(),m=function(){function e(){}return e.value=new e,e}(),p=function(){function e(){}return e.value=new e,e}(),g=function(){function e(){}return e.value=new e,e}(),y=function(){function e(){}return e.value=new e,e}(),w=function(){function e(){}return e.value=new e,e}(),h=function(){function e(){}return e.value=new e,e}(),b={show:function(e){if(e instanceof o)return"OPTIONS";if(e instanceof a)return"GET";if(e instanceof u)return"HEAD";if(e instanceof i)return"POST";if(e instanceof c)return"PUT";if(e instanceof l)return"DELETE";if(e instanceof s)return"TRACE";if(e instanceof f)return"CONNECT";if(e instanceof d)return"PROPFIND";if(e instanceof v)return"PROPPATCH";if(e instanceof m)return"MKCOL";if(e instanceof p)return"COPY";if(e instanceof g)return"MOVE";if(e instanceof y)return"LOCK";if(e instanceof w)return"UNLOCK";if(e instanceof h)return"PATCH";throw new Error("Failed pattern match at Data.HTTP.Method (line 43, column 1 - line 59, column 23): "+[e.constructor.name])}},C=t.either(r.show(b))((function(e){return e}));n.GET=a,n.POST=i,n.print=C}(c),function(e){"use strict";e["Data.Identity"]=e["Data.Identity"]||{};var n=e["Data.Identity"],t={map:function(e){return function(n){return e(n)}}},r={apply:function(e){return function(n){return e(n)}},Functor0:function(){return t}},o={bind:function(e){return function(n){return n(e)}},Apply0:function(){return r}},a={pure:function(e){return e},Apply0:function(){return r}},u={Applicative0:function(){return a},Bind1:function(){return o}};n.functorIdentity=t,n.monadIdentity=u}(c),function(e){"use strict";e.null=null,e.notNull=function(e){return e}}(c["Data.Nullable"]=c["Data.Nullable"]||{}),function(e){"use strict";e["Data.Nullable"]=e["Data.Nullable"]||{};var n=e["Data.Nullable"],t=e["Data.Nullable"],r=e["Data.Maybe"].maybe(t.null)(t.notNull);n.toNullable=r}(c),function(e){"use strict";var n=function(){var e={},n="Pure",t="Throw",r="Catch",o="Sync",a="Async",u="Bind",i="Bracket",c="Fork",l="Sequential",s="Map",f="Apply",d="Alt",v="Cons",m="Resume",p="Release",g="Finalizer",y="Finalized",w="Forked";function h(e,n,t,r){this.tag=e,this._1=n,this._2=t,this._3=r}function b(e){var n=function(n,t,r){return new h(e,n,t,r)};return n.tag=e,n}function C(e){return new h(n,void 0)}function A(e){try{e()}catch(e){setTimeout((function(){throw e}),0)}}function S(e,n,t){try{return n(t())}catch(n){return e(n)}}function I(e,n,t){try{return n(t)()}catch(n){return t(e(n))(),C}}var T=function(){var e=1024,n=0,t=0,r=new Array(e),o=!1;function a(){var a;for(o=!0;0!==n;)n--,a=r[t],r[t]=void 0,t=(t+1)%e,a();o=!1}return{isDraining:function(){return o},enqueue:function(u){var i;n===e&&(i=o,a(),o=i),r[(t+n)%e]=u,n++,o||a()}}}();function D(e,s,f){var d=0,w=0,b=f,C=null,F=null,x=null,M=null,R=null,P=0,B=0,k=null,N=!0;function L(f){for(var B,_,U;;)switch(B=null,_=null,U=null,w){case 2:w=1;try{b=x(b),null===M?x=null:(x=M._1,M=M._2)}catch(n){w=5,C=e.left(n),b=null}break;case 3:e.isLeft(b)?(w=5,C=b,b=null):null===x?w=5:(w=2,b=e.fromRight(b));break;case 1:switch(b.tag){case u:x&&(M=new h(v,x,M)),x=b._2,w=1,b=b._1;break;case n:null===x?(w=5,b=e.right(b._1)):(w=2,b=b._1);break;case o:w=3,b=S(e.left,e.right,b._1);break;case a:return w=4,void(b=I(e.left,b._1,(function(e){return function(){d===f&&(d++,T.enqueue((function(){d===f+1&&(w=3,b=e,L(d))})))}})));case t:w=5,C=e.left(b._1),b=null;break;case r:R=new h(v,b,null===x?R:new h(v,new h(m,x,M),R,F),F),x=null,M=null,w=1,b=b._1;break;case i:P++,R=new h(v,b,null===x?R:new h(v,new h(m,x,M),R,F),F),x=null,M=null,w=1,b=b._1;break;case c:w=3,B=D(e,s,b._2),s&&s.register(B),b._1&&B.run(),b=e.right(B);break;case l:w=1,b=E(e,s,b._1)}break;case 5:if(x=null,M=null,null===R)w=6,b=F||C||b;else switch(B=R._3,U=R._1,R=R._2,U.tag){case r:F&&F!==B&&0===P?w=5:C&&(w=1,b=U._2(e.fromLeft(C)),C=null);break;case m:F&&F!==B&&0===P||C?w=5:(x=U._1,M=U._2,w=2,b=e.fromRight(b));break;case i:P--,null===C&&(_=e.fromRight(b),R=new h(v,new h(p,U._2,_),R,B),(F===B||P>0)&&(w=1,b=U._3(_)));break;case p:R=new h(v,new h(y,b,C),R,F),w=1,b=F&&F!==B&&0===P?U._1.killed(e.fromLeft(F))(U._2):C?U._1.failed(e.fromLeft(C))(U._2):U._1.completed(e.fromRight(b))(U._2),C=null,P++;break;case g:P++,R=new h(v,new h(y,b,C),R,F),w=1,b=U._1;break;case y:P--,w=5,b=U._1,C=U._2}break;case 6:for(var H in k)k.hasOwnProperty(H)&&(N=N&&k[H].rethrow,A(k[H].handler(b)));return k=null,void(F&&C?setTimeout((function(){throw e.fromLeft(C)}),0):e.isLeft(b)&&N&&setTimeout((function(){if(N)throw e.fromLeft(b)}),0));case 0:w=1;break;case 4:return}}function _(e){return function(){if(6===w)return N=N&&e.rethrow,e.handler(b)(),function(){};var n=B++;return(k=k||{})[n]=e,function(){null!==k&&delete k[n]}}}return{kill:function(n,t){return function(){if(6===w)return t(e.right(void 0))(),function(){};var r=_({rethrow:!1,handler:function(){return t(e.right(void 0))}})();switch(w){case 0:F=e.left(n),w=6,b=F,L(d);break;case 4:null===F&&(F=e.left(n)),0===P&&(4===w&&(R=new h(v,new h(g,b(n)),R,F)),w=5,b=null,C=null,L(++d));break;default:null===F&&(F=e.left(n)),0===P&&(w=5,b=null,C=null)}return r}},join:function(e){return function(){var n=_({rethrow:!1,handler:e})();return 0===w&&L(d),n}},onComplete:_,isSuspended:function(){return 0===w},run:function(){0===w&&(T.isDraining()?L(d):T.enqueue((function(){L(d)})))}}}function F(n,t,r,o){var u=0,i={},c=0,l={},m=new Error("[ParAff] Early exit"),p=null,g=e;function y(t,r,o){var a,u,c=r,l=null,m=null,p=0,g={};e:for(;;)switch(a=null,c.tag){case w:if(c._3===e&&(a=i[c._1],g[p++]=a.kill(t,(function(e){return function(){0==--p&&o(e)()}}))),null===l)break e;c=l._2,null===m?l=null:(l=m._1,m=m._2);break;case s:c=c._2;break;case f:case d:l&&(m=new h(v,l,m)),l=c,c=c._1}if(0===p)o(n.right(void 0))();else for(u=0,a=p;ut=>()=>{try{let r;return r=new n.default(t),r.finalizers=[],e("Created a new WebSocket")(),r}catch(n){throw e("Failed to create a new WebSocket"),n}},e._onWsConnect=e=>n=>()=>{e.addEventListener("open",n),e.finalizers.push((()=>{e.removeEventListener("open",n)}))},e._onWsError=e=>n=>()=>{const t=function(e){n(e.toString())()};return e.addEventListener("error",t),e.finalizers.push((()=>{e.removeEventListener("error",t)})),t},e._removeOnWsError=e=>n=>()=>e.removeEventListener("error",n),e._onWsMessage=e=>n=>t=>()=>{const r=function(e){const r=e.data;n(`message: ${r}`)(),t(r)()};e.addEventListener("message",r),e.finalizers.push((()=>{e.removeEventListener("message",r)}))},e._wsFinalize=e=>()=>{for(let n of e.finalizers)try{n()}catch(e){}e.finalizers=[]},e._wsSend=e=>n=>t=>()=>{n(`sending: ${t}`)(),e.send(t)},e._wsClose=e=>()=>{e.close()}}(c["Ctl.Internal.JsWebSocket"]=c["Ctl.Internal.JsWebSocket"]||{}),function(e){"use strict";e["Ctl.Internal.JsWebSocket"]=e["Ctl.Internal.JsWebSocket"]||{};var n=e["Ctl.Internal.JsWebSocket"],t=e["Ctl.Internal.JsWebSocket"];n._mkWebSocket=t._mkWebSocket,n._onWsConnect=t._onWsConnect,n._onWsError=t._onWsError,n._removeOnWsError=t._removeOnWsError,n._onWsMessage=t._onWsMessage,n._wsSend=t._wsSend,n._wsClose=t._wsClose,n._wsFinalize=t._wsFinalize}(c),function(e){"use strict";e["Data.List"]=e["Data.List"]||{};var n,t=e["Data.List"],r=e["Control.Alt"],o=e["Control.Applicative"],a=e["Control.Apply"],u=e["Control.Lazy"],i=e["Data.Boolean"],c=e["Data.Eq"],l=e["Data.Foldable"],s=e["Data.Functor"],f=e["Data.List.Types"],d=e["Data.Maybe"],v=e["Data.Ord"],m=e["Data.Ordering"],p=e["Data.Tuple"],g=e["Data.Unfoldable"],y=function(e){return new f.Cons(e,f.Nil.value)},w=function(e){var n=function(t){return function(r){if(t instanceof f.Cons&&r instanceof f.Cons){if(c.eq(m.eqOrdering)(e(t.value0)(r.value0))(m.GT.value))return new f.Cons(r.value0,n(t)(r.value1));if(i.otherwise)return new f.Cons(t.value0,n(t.value1)(r))}if(t instanceof f.Nil)return r;if(r instanceof f.Nil)return t;throw new Error("Failed pattern match at Data.List (line 477, column 3 - line 477, column 38): "+[t.constructor.name,r.constructor.name])}},t=function(e){return e instanceof f.Cons&&e.value1 instanceof f.Cons?new f.Cons(n(e.value0)(e.value1.value0),t(e.value1.value1)):e},r=function(n){if(n instanceof f.Cons&&n.value1 instanceof f.Cons){if(c.eq(m.eqOrdering)(e(n.value0)(n.value1.value0))(m.GT.value))return o(n.value1.value0)(y(n.value0))(n.value1.value1);if(i.otherwise)return a(n.value1.value0)((function(e){return new f.Cons(n.value0,e)}))(n.value1.value1)}return y(n)},o=function(n){return function(t){return function(o){for(var a,u,i,l,s=n,d=t,v=!1;!v;)u=s,i=d,a=(l=o)instanceof f.Cons&&c.eq(m.eqOrdering)(e(u)(l.value0))(m.GT.value)?(s=l.value0,d=new f.Cons(u,i),void(o=l.value1)):(v=!0,new f.Cons(new f.Cons(u,i),r(l)));return a}}},a=function(n){return function(t){return function(o){var a,u=n,i=t,l=!1;function s(n,t,a){return a instanceof f.Cons&&c.notEq(m.eqOrdering)(e(n)(a.value0))(m.GT.value)?(u=a.value0,i=function(e){return t(new f.Cons(n,e))},void(o=a.value1)):(l=!0,new f.Cons(t(y(n)),r(a)))}for(;!l;)a=s(u,i,o);return a}}};return function(e){return function(e){var n,r=!1;function o(n){if(n instanceof f.Cons&&n.value1 instanceof f.Nil)return r=!0,n.value0;e=t(n)}for(;!r;)n=o(e);return n}(r(e))}},h=(n=f.Nil.value,function(e){var t,r=n,o=!1;function a(n,t){if(t instanceof f.Nil)return o=!0,n;if(t instanceof f.Cons)return r=new f.Cons(t.value0,n),void(e=t.value1);throw new Error("Failed pattern match at Data.List (line 372, column 3 - line 372, column 19): "+[n.constructor.name,t.constructor.name])}for(;!o;)t=a(r,e);return t}),b=function(e){return function(n){return function(t){var r,o=e,a=n,u=!1;function i(e,n,r){if(n<1)return u=!0,h(e);if(r instanceof f.Nil)return u=!0,h(e);if(r instanceof f.Cons)return o=new f.Cons(r.value0,e),a=n-1|0,void(t=r.value1);throw new Error("Failed pattern match at Data.List (line 524, column 3 - line 524, column 35): "+[e.constructor.name,n.constructor.name,r.constructor.name])}for(;!u;)r=i(o,a,t);return r}}}(f.Nil.value),C=function(e){return function(n){return function(t){return a.apply(e.Applicative0().Apply0())(s.map(e.Plus1().Alt0().Functor0())(f.Cons.create)(t))(u.defer(n)((function(r){return A(e)(n)(t)})))}}},A=function(e){return function(n){return function(t){return r.alt(e.Plus1().Alt0())(C(e)(n)(t))(o.pure(e.Applicative0())(f.Nil.value))}}},S=l.foldl(f.foldableList)((function(e){return function(n){return e+1|0}}))(0);t.toUnfoldable=function(e){return g.unfoldr(e)((function(e){return s.map(d.functorMaybe)((function(e){return new p.Tuple(e.head,e.tail)}))(function(e){if(e instanceof f.Nil)return d.Nothing.value;if(e instanceof f.Cons)return new d.Just({head:e.value0,tail:e.value1});throw new Error("Failed pattern match at Data.List (line 263, column 1 - line 263, column 66): "+[e.constructor.name])}(e))}))},t.fromFoldable=function(e){return l.foldr(e)(f.Cons.create)(f.Nil.value)},t.some=C,t.null=function(e){return e instanceof f.Nil},t.length=S,t.head=function(e){if(e instanceof f.Nil)return d.Nothing.value;if(e instanceof f.Cons)return new d.Just(e.value0);throw new Error("Failed pattern match at Data.List (line 234, column 1 - line 234, column 22): "+[e.constructor.name])},t.reverse=h,t.filter=function(e){return function(n){return function(t){var r,o=n,a=!1;function u(n,r){if(r instanceof f.Nil)return a=!0,h(n);if(r instanceof f.Cons){if(e(r.value0))return o=new f.Cons(r.value0,n),void(t=r.value1);if(i.otherwise)return o=n,void(t=r.value1)}throw new Error("Failed pattern match at Data.List (line 394, column 3 - line 394, column 27): "+[n.constructor.name,r.constructor.name])}for(;!a;)r=u(o,t);return r}}(f.Nil.value)},t.mapMaybe=function(e){return function(n){return function(t){var r,o=n,a=!1;function u(n,r){if(r instanceof f.Nil)return a=!0,h(n);if(r instanceof f.Cons){var u=e(r.value0);if(u instanceof d.Nothing)return o=n,void(t=r.value1);if(u instanceof d.Just)return o=new f.Cons(u.value0,n),void(t=r.value1);throw new Error("Failed pattern match at Data.List (line 423, column 5 - line 425, column 32): "+[u.constructor.name])}throw new Error("Failed pattern match at Data.List (line 421, column 3 - line 421, column 27): "+[n.constructor.name,r.constructor.name])}for(;!a;)r=u(o,t);return r}}(f.Nil.value)},t.sort=function(e){return function(n){return w(v.compare(e))(n)}},t.sortBy=w,t.take=b}(c),function(e){"use strict";e.new=function(e){return function(){return{value:e}}},e.read=function(e){return function(){return e.value}},e.modifyImpl=function(e){return function(n){return function(){var t=e(n.value);return n.value=t.state,t.value}}},e.write=function(e){return function(n){return function(){n.value=e}}}}(c["Effect.Ref"]=c["Effect.Ref"]||{}),function(e){"use strict";e["Effect.Ref"]=e["Effect.Ref"]||{};var n=e["Effect.Ref"],t=e["Effect.Ref"],r=e["Data.Functor"],o=e.Effect,a=t.modifyImpl;n.modify_=function(e){return function(n){return r.void(o.functorEffect)(function(e){return a((function(n){var t=e(n);return{state:t,value:t}}))}(e)(n))}},n.new=t.new,n.read=t.read,n.write=t.write}(c),function(e){"use strict";e["Ctl.Internal.Logging"]=e["Ctl.Internal.Logging"]||{};var n=e["Ctl.Internal.Logging"],t=e["Control.Applicative"],r=e["Ctl.Internal.Helpers"],o=e["Data.Foldable"],a=e["Data.Functor"],u=e["Data.JSDate"],i=e["Data.List"],c=e["Data.List.Types"],l=e["Data.Log.Level"],s=e["Data.Map.Internal"],f=e["Data.Maybe"],d=e["Data.Ord"],v=e.Effect,m=e["Effect.Aff"],p=e["Effect.Class"],g=e["Effect.Ref"],y=function(e){return function(n){return function(t){return function(o){if(n instanceof f.Nothing)return r.logString(e)(t)(o);if(n instanceof f.Just)return p.liftEffect(p.monadEffectEffect)((function(){var r=u.now();return m.launchAff_(n.value0(e)({level:t,message:o,tags:s.empty,timestamp:r}))()}));throw new Error("Failed pattern match at Ctl.Internal.Logging (line 30, column 3 - line 35, column 55): "+[n.constructor.name])}}}};n.setupLogs=function(e){return function(n){return function(){var r,u=p.liftEffect(p.monadEffectEffect)(g.new(c.Nil.value))(),s=y(e)(n),w=g.write(c.Nil.value)(u),h=function(e){return function(n){return t.when(v.applicativeEffect)(d.greaterThanOrEq(l.ordLogLevel)(n.level)(e))(g.modify_(c.Cons.create(n))(u))}},b=y(e)(new f.Just((r=a.map(a.functorFn)(p.liftEffect(m.monadEffectAff)),function(e){return r(h(e))})));return{addLogEntry:h,logger:s,printLogs:function(){var e=a.map(v.functorEffect)(i.reverse)(g.read(u))();return w(),o.for_(v.applicativeEffect)(c.foldableList)(e)((function(e){return s(e.level)(e.message)}))()},clearLogs:w,suppressedLogger:b}}}},n.mkLogger=y}(c),function(e){let n;n=t(1164),n=t(6359)(n);const r=(e,t)=>r=>o=>{let a=null;try{a=n[e][t](o)}catch(e){}return null==a?r.nothing:r.just(a)},o=e=>n=>n[e](),a=o("to_address"),u=o("to_bytes"),i=o("to_bech32"),c=o("network_id"),l=o("payment_cred"),s=o("stake_cred");e.withStakeCredential=e=>t=>t.kind()==n.StakeCredKind.Key?e.onKeyHash(t.to_keyhash()):e.onScriptHash(t.to_scripthash()),e.keyHashCredential=n.StakeCredential.from_keyhash,e.scriptHashCredential=n.StakeCredential.from_scripthash,e.addressBytes=u,e.stakeCredentialToBytes=u,e.addressBech32=i,e._addressNetworkId=e=>n=>e(c(n)),e._addressFromBech32=r("Address","from_bech32"),e._baseAddressFromAddress=r("BaseAddress","from_address"),e._enterpriseAddressFromAddress=r("EnterpriseAddress","from_address"),e._pointerAddressFromAddress=r("PointerAddress","from_address"),e._rewardAddressFromAddress=r("RewardAddress","from_address"),e.baseAddressToAddress=a,e.enterpriseAddressToAddress=a,e.pointerAddressToAddress=a,e.rewardAddressToAddress=a,e.baseAddressPaymentCred=l,e.enterpriseAddressPaymentCred=l,e.pointerAddressPaymentCred=l,e.baseAddressDelegationCred=s,e.pointerAddressStakePointer=e=>{const n=e.stake_pointer();return{slot:n.slot_bignum(),txIx:n.tx_index_bignum(),certIx:n.cert_index_bignum()}},e._enterpriseAddress=e=>t=>n.EnterpriseAddress.new(e(t.network),t.paymentCred),e._rewardAddress=e=>t=>n.RewardAddress.new(e(t.network),t.paymentCred),e._baseAddress=e=>t=>n.BaseAddress.new(e(t.network),t.paymentCred,t.delegationCred),e._pointerAddress=e=>t=>{const r=t.stakePointer,o=n.Pointer.new_pointer(r.slot,r.txIx,r.certIx);return n.PointerAddress.new(e(t.network),t.paymentCred,o)}}(c["Ctl.Internal.Serialization.Address"]=c["Ctl.Internal.Serialization.Address"]||{}),function(e){const n=e=>{const n=[];for(let t=0;tt=>n(t[e]());e._containerHelper=e=>({unpack:n,unpackFromProperty:t,unpackKeyIndexed:n=>{const t=[];for(let r=0;r{const t=e.new();return n.forEach((e=>t.add(e))),t},packMap:(n,t)=>{const r=n.new();return t.forEach((n=>{const[t,o]=e.untuple(n);r.insert(t,o)})),r}})}(c["Ctl.Internal.FfiHelpers"]=c["Ctl.Internal.FfiHelpers"]||{}),function(e){"use strict";e["Ctl.Internal.FfiHelpers"]=e["Ctl.Internal.FfiHelpers"]||{};var n=e["Ctl.Internal.FfiHelpers"],t=e["Ctl.Internal.FfiHelpers"],r=e["Data.Either"],o=e["Data.Maybe"],a=e["Data.Tuple"],u={nothing:o.Nothing.value,just:o.Just.create,from:o.fromMaybe},i=t._containerHelper({untuple:function(e){return[e.value0,e.value1]},tuple:a.Tuple.create});n.maybeFfiHelper=u,n.containerHelper=i,n.errorHelper=function(e){return{error:function(n){return r.Left.create(e(n))},valid:r.Right.create,from:function(e){var n=o.fromMaybe(e);return function(e){return n(r.hush(e))}}}}}(c),function(e){"use strict";e["Ctl.Internal.TypeLevel.Nat"]=e["Ctl.Internal.TypeLevel.Nat"]||{};var n=e["Ctl.Internal.TypeLevel.Nat"],t=e["Type.Proxy"],r=function(e){return e.natVal};n.natVal=r,n.knownNatZ={natVal:function(e){return 0}},n.knownNatS=function(e){return{natVal:function(n){return 1+r(e)(t.Proxy.value)|0}}}}(c),function(e){let n;n=t(1164),n=t(6359)(n),e.bnCompare=e=>n=>e.compare(n),e.zero=n.BigNum.zero(),e.one=n.BigNum.one(),e.bnAdd=e=>n=>t=>{try{return e.just(n.checked_add(t))}catch(n){return e.nothing}},e._fromString=e=>t=>{try{return e.just(n.BigNum.from_str(t))}catch(n){return e.nothing}},e.toString=e=>e.to_str()}(c["Ctl.Internal.Types.BigNum"]=c["Ctl.Internal.Types.BigNum"]||{}),function(e){"use strict";e["Ctl.Internal.Types.BigNum"]=e["Ctl.Internal.Types.BigNum"]||{};var n,t,r,o,a=e["Ctl.Internal.Types.BigNum"],u=e["Ctl.Internal.Types.BigNum"],i=e.Aeson,c=e["Control.Bind"],l=e["Ctl.Internal.FfiHelpers"],s=e["Data.Argonaut.Decode.Error"],f=e["Data.BigInt"],d=e["Data.Either"],v=e["Data.Int"],m=e["Data.Maybe"],p=e["Data.Ordering"],g=e["Data.UInt"],y={show:function(e){return'fromString "'+u.toString(e)+'"'}},w={eq:function(e){return function(n){return 0===u.bnCompare(e)(n)}}},h={compare:function(e){return function(n){var t=u.bnCompare(e)(n);return 1===t?p.GT.value:0===t?p.EQ.value:p.LT.value}},Eq0:function(){return w}},b=(n=m.fromJust(),function(e){return n(f.fromString(u.toString(e)))}),C={encodeAeson:(t=i.encodeAeson(i.encodeAesonBigInt),function(e){return t(b(e))})},A=u._fromString(l.maybeFfiHelper),S=(r=m.fromJust(),function(e){return r(A(e))}),I=S("18446744073709551615"),T=function(e){return A(f.toString(e))},D={decodeAeson:c.composeKleisliFlipped(d.bindEither)((o=d.note(new s.TypeMismatch("Couldn't convert `BigInt` to `BigNum`")),function(e){return o(T(e))}))(i.decodeAeson(i.decodeAesonBigInt))},F=u.bnAdd(l.maybeFfiHelper);a.add=F,a.fromBigInt=T,a.fromInt=function(e){return S(g.toString(g.fromInt(e)))},a.fromString=A,a.fromStringUnsafe=S,a.maxValue=I,a.toBigInt=b,a.toInt=function(e){return v.fromString(u.toString(e))},a.fromUInt=function(e){return S(g.toString(e))},a.eqBigNum=w,a.ordBigNum=h,a.showBigNum=y,a.decodeAesonBigNum=D,a.encodeAesonBigNum=C,a.one=u.one,a.toString=u.toString,a.zero=u.zero}(c),function(e){e.ord_=e=>n=>t=>{let r=0;const o=n.length,a=t.length;for(;ra?-1:1},e.concat_=e=>n=>{const t=new Uint8Array(e.length+n.length);for(let n=0;ni.from(e).toString("hex");const{ceil:n}=Math,{fromCharCode:t}=String;e.hexToByteArray_=e=>n=>t=>{let r=[];for(let n=0;nnew Uint8Array(e),e.byteArrayFromIntArray_=e=>n=>t=>t.every((e=>e<256&&e>=0))?n(new Uint8Array(t)):e,e.byteArrayToIntArray=e=>Array.from(e),e.byteLength=e=>e.byteLength,e.subarray=e=>n=>t=>t.subarray(e,n)}(c["Ctl.Internal.Types.ByteArray"]=c["Ctl.Internal.Types.ByteArray"]||{}),function(e){"use strict";e.toCharCode=function(e){return e.charCodeAt(0)},e.fromCharCode=function(e){return String.fromCharCode(e)}}(c["Data.Enum"]=c["Data.Enum"]||{}),function(e){"use strict";e["Data.Enum"]=e["Data.Enum"]||{};var n,t=e["Data.Enum"],r=e["Data.Enum"],o=e["Data.Bounded"],a=e["Data.Maybe"],u=e["Data.Ord"],i=function(e){return e.toEnum},c=function(e){return e.fromEnum},l=function(e){return e>=o.bottom(o.boundedInt)&&e<=o.top(o.boundedInt)?new a.Just(r.fromCharCode(e)):a.Nothing.value},s={succ:(n=l,function(e){return function(t){return n(e(t)+1|0)}})(r.toCharCode),pred:function(e){return function(n){return function(t){return e(n(t)-1|0)}}}(l)(r.toCharCode),Ord0:function(){return u.ordChar}},f={cardinality:r.toCharCode(o.top(o.boundedChar))-r.toCharCode(o.bottom(o.boundedChar))|0,toEnum:l,fromEnum:r.toCharCode,Bounded0:function(){return o.boundedChar},Enum1:function(){return s}};t.toEnum=i,t.fromEnum=c,t.toEnumWithDefaults=function(e){return function(n){return function(t){return function(r){var u=i(e)(r);if(u instanceof a.Just)return u.value0;if(u instanceof a.Nothing)return r=0?a.pure(f.applicativeMaybe)(n):f.Nothing.value})))},t.hexToByteArray=S,t.showByteArray=y,t.eqByteArray=C,t.ordByteArray=b,t.monoidByteArray=h,t.decodeAesonByteArray=I,t.encodeAesonByteArray=A,t.byteArrayToHex=r.byteArrayToHex,t.byteArrayToIntArray=r.byteArrayToIntArray,t.byteLength=r.byteLength,t.subarray=r.subarray}(c),function(e){"use strict";e["Data.Generic.Rep"]=e["Data.Generic.Rep"]||{};var n=e["Data.Generic.Rep"],t=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),r=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),o=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),a=function(){function e(){}return e.value=new e,e}();n.to=function(e){return e.to},n.from=function(e){return e.from},n.NoArguments=a,n.Inl=t,n.Inr=r,n.Product=o}(c),function(e){"use strict";e.intercalate=function(e){return function(n){var t=n.length;if(0===t)return"";for(var r=n[0],o=1;oe.to_bytes(),e.hashFromBytes=e=>t=>o=>r(n[e].from_bytes)(t)(o),e.hashToBech32Unsafe=e=>n=>n.to_bech32(e);const r=e=>n=>t=>{let r=null;try{r=e(t)}catch(e){}return null==r?n.nothing:n.just(r)};e.hashToBech32Impl=e=>n=>t=>{let r=null;try{r=t.to_bech32(n)}catch(e){}return null==r?e.nothing:e.just(r)},e._ed25519KeyHashFromBech32Impl=e=>t=>r(n.Ed25519KeyHash.from_bech32)(e)(t),e.nativeScriptHash=e=>e.hash()}(c["Ctl.Internal.Serialization.Hash"]=c["Ctl.Internal.Serialization.Hash"]||{}),function(e){"use strict";e["Data.Void"]=e["Data.Void"]||{},e["Data.Void"].absurd=function(e){return function(e){for(var n;;)n=void 0;return n}()}}(c),function(e){"use strict";e["Ctl.Internal.ToData"]=e["Ctl.Internal.ToData"]||{};var n,t,r,o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.Helpers"],u=e["Ctl.Internal.TypeLevel.Nat"],i=e["Ctl.Internal.Types.BigNum"],c=e["Ctl.Internal.Types.PlutusData"],l=e["Data.Array"],s=e["Data.Functor"],f=e["Data.Generic.Rep"],d=e["Data.Maybe"],v=e["Data.Newtype"],m=e["Data.Ord"],p=e["Data.Semigroup"],g=e["Data.Tuple"],y=e["Data.Void"],w=e.Record,h=e["Type.Proxy"],b={toData:y.absurd},C={toData:(n=v.unwrap(),function(e){return c.Bytes.create(n(e))})},A={toData:c.Bytes.create},S={toData:c.Integer.create},I=function(e){return e.toDataWithSchema},T=function(e){return e["toDataArgsRec'"]},D=function(e){return e.toDataArgs},F=function(e){return e.toData},E={toData:(t=F(S),function(e){return t(i.toBigInt(e))})},x={toData:(r=F(S),function(e){return r(a.uIntToBigInt(e))})};o.genericToData=function(e){return function(n){var t=I(n)(h.Proxy.value),r=f.from(e);return function(e){return t(r(e))}}},o.toData=F,o.toDataArgsRL=function(e){return{toDataArgsRec:function(n){return function(t){return function(r){return function(o){return s.map(s.functorArray)(g.snd)(l.sortWith(m.ordInt)(g.fst)(T(e)(n)(t)(r)(o)))}}}},ToDataArgsRLHelper0:function(){return e}}},o.toDataWithSchemaSum=function(e){return function(n){return{toDataWithSchema:function(t){return function(r){if(r instanceof f.Inl)return I(e)(t)(r.value0);if(r instanceof f.Inr)return I(n)(t)(r.value0);throw new Error("Failed pattern match at Ctl.Internal.ToData (line 140, column 1 - line 146, column 54): "+[t.constructor.name,r.constructor.name])}}}}},o.toDataWithSchemaConstruct=function(e){return function(e){return function(){return function(){return function(n){return function(n){return{toDataWithSchema:function(t){return function(r){return new c.Constr(i.fromInt(u.natVal(n)(h.Proxy.value)),D(e)(t)(h.Proxy.value)(r))}}}}}}}}},o.toDataArgsNoArguments=function(e){return{toDataArgs:function(e){return function(e){return function(e){return[]}}},IsSymbol0:function(){return e}}},o.toDataArgsArgumentRecord=function(e){return{toDataArgs:function(n){return function(t){return function(r){return D(e)(n)(t)(r)}}},IsSymbol0:e.IsSymbol0}},o.toDataArgsArgument=function(e){return function(n){return{toDataArgs:function(n){return function(n){return function(n){return[F(e)(n)]}}},IsSymbol0:function(){return n}}}},o.toDataArgsRecord=function(e){return function(n){return function(){return{toDataArgs:function(e){return function(t){return function(r){return n.toDataArgsRec(e)(t)(h.Proxy.value)(r)}}},IsSymbol0:function(){return e}}}}},o.toDataArgsProduct=function(e){return function(n){return{toDataArgs:function(t){return function(r){return function(o){return p.append(p.semigroupArray)(D(e)(t)(r)(o.value0))(D(n)(t)(r)(o.value1))}}},IsSymbol0:e.IsSymbol0}}},o.toDataArgsRLHelperNilRow={"toDataArgsRec'":function(e){return function(e){return function(e){return function(e){return[]}}}}},o.toDataArgsRLHelperCons=function(e){return function(n){return function(){return function(){return function(){return function(t){return function(r){return function(){return function(){return function(){return function(){return function(r){return{"toDataArgsRec'":function(o){return function(o){return function(a){return function(a){var i=u.natVal(r)(h.Proxy.value),c=w.get(t)()(h.Proxy.value)(a);return l.cons(new g.Tuple(i,F(e)(c)))(T(n)(h.Proxy.value)(o)(h.Proxy.value)(w.delete(t)()()(h.Proxy.value)(a)))}}}}}}}}}}}}}}}}},o.toDataVoid=b,o.toDataMaybe=function(e){return{toData:function(n){if(n instanceof d.Just)return new c.Constr(i.zero,[F(e)(n.value0)]);if(n instanceof d.Nothing)return new c.Constr(i.one,[]);throw new Error("Failed pattern match at Ctl.Internal.ToData (line 262, column 1 - line 264, column 40): "+[n.constructor.name])}}},o.toDataBigInt=S,o.toDataBigNum=E,o.toDataUInt=x,o.toDataByteArray=A,o.toDataRawBytes=C}(c),function(e){"use strict";e["Ctl.Internal.Types.RawBytes"]=e["Ctl.Internal.Types.RawBytes"]||{};var n,t,r=e["Ctl.Internal.Types.RawBytes"],o=e["Ctl.Internal.Types.ByteArray"],a=e["Data.Functor"],u=e["Data.Maybe"],i=e["Data.Newtype"],c=e["Data.Show"],l=o.ordByteArray,s=o.monoidByteArray,f=o.eqByteArray,d=(n=i.unwrap(),function(e){return o.byteArrayToHex(n(e))}),v={show:function(e){return"(hexToRawBytesUnsafe "+c.show(c.showString)(d(e))+")"}},m=(t=a.map(u.functorMaybe)(i.wrap()),function(e){return t(o.hexToByteArray(e))});r.rawBytesToHex=d,r.hexToRawBytes=m,r.showRawBytes=v,r.eqRawBytes=f,r.ordRawBytes=l,r.monoidRawBytes=s}(c),function(e){"use strict";e["Ctl.Internal.Serialization.Hash"]=e["Ctl.Internal.Serialization.Hash"]||{};var n,t,r,o,a,u,i,c,l,s,f,d=e["Ctl.Internal.Serialization.Hash"],v=e["Ctl.Internal.Serialization.Hash"],m=e.Aeson,p=e["Control.Bind"],g=e["Ctl.Internal.FfiHelpers"],y=e["Ctl.Internal.ToData"],w=e["Ctl.Internal.Types.ByteArray"],h=e["Ctl.Internal.Types.PlutusData"],b=e["Ctl.Internal.Types.RawBytes"],C=e["Data.Argonaut.Decode.Error"],A=e["Data.Either"],S=e["Data.Eq"],I=e["Data.Function"],T=e["Data.Maybe"],D=e["Data.Newtype"],F=e["Data.Ord"],E=(n=D.wrap(),function(e){return n(v.hashToBytes(e))}),x={eq:I.on(S.eq(b.eqRawBytes))(E)},M={compare:I.on(F.compare(b.ordRawBytes))(E),Eq0:function(){return x}},R={show:function(e){return"(ScriptHash "+b.rawBytesToHex(E(e))+")"}},P={toData:(t=y.toData(y.toDataByteArray),r=D.unwrap(),function(e){return t(r(E(e)))})},B=v.hashToBech32Unsafe,k=v.hashFromBytes("ScriptHash")(g.maybeFfiHelper),N={decodeAeson:(o=T.maybe(new A.Left(new C.TypeMismatch("Expected hex-encoded script hash")))(A.Right.create),a=m.caseAesonString(T.Nothing.value)(p.composeKleisliFlipped(T.bindMaybe)(T.Just.create)(p.composeKleisliFlipped(T.bindMaybe)(k)(w.hexToByteArray))),function(e){return o(a(e))})},L={fromData:function(e){return e instanceof h.Bytes?k(e.value0):T.Nothing.value}},_=(u=D.wrap(),function(e){return u(v.hashToBytes(e))}),U={encodeAeson:(i=m.encodeAeson(m.encodeAesonString),function(e){return i(b.rawBytesToHex(_(e)))})},H={eq:I.on(S.eq(b.eqRawBytes))(_)},q={compare:I.on(F.compare(b.ordRawBytes))(_),Eq0:function(){return H}},O={show:function(e){return"(Ed25519KeyHash "+b.rawBytesToHex(_(e))+")"}},W={toData:(c=y.toData(y.toDataByteArray),l=D.unwrap(),function(e){return c(l(_(e)))})},V=v.hashToBech32Unsafe,K=v.hashFromBytes("Ed25519KeyHash")(g.maybeFfiHelper),z={decodeAeson:m.caseAesonString(new A.Left(new C.TypeMismatch("Expected Plutus BuiltinByteString")))(p.composeKleisliFlipped(A.bindEither)((f=A.note(new C.TypeMismatch("Invalid Ed25519KeyHash")),function(e){return f(K(e))}))((s=A.note(new C.TypeMismatch("Invalid ByteArray")),function(e){return s(w.hexToByteArray(e))})))},J={fromData:function(e){return e instanceof h.Bytes?K(e.value0):T.Nothing.value}},j=v._ed25519KeyHashFromBech32Impl(g.maybeFfiHelper),Q=(0,v.hashToBech32Impl)(g.maybeFfiHelper);d.ed25519KeyHashFromBech32=j,d.ed25519KeyHashFromBytes=K,d.ed25519KeyHashToBech32=Q,d.ed25519KeyHashToBech32Unsafe=V,d.ed25519KeyHashToBytes=_,d.scriptHashFromBytes=k,d.scriptHashToBech32Unsafe=B,d.scriptHashToBytes=E,d.eqEd25519KeyHash=H,d.ordEd25519KeyHash=q,d.showEd25519KeyHash=O,d.toDataEd25519KeyHash=W,d.fromDataEd25519KeyHash=J,d.decodeAesonEd25519KeyHash=z,d.encodeAesonEd25519KeyHash=U,d.eqScriptHash=x,d.ordScriptHash=M,d.showScriptHash=R,d.toDataScriptHash=P,d.fromDataScriptHash=L,d.decodeAesonScriptHash=N,d.nativeScriptHash=v.nativeScriptHash}(c),function(e){"use strict";e["Ctl.Internal.Types.CborBytes"]=e["Ctl.Internal.Types.CborBytes"]||{};var n,t,r,o,a=e["Ctl.Internal.Types.CborBytes"],u=e["Ctl.Internal.Types.ByteArray"],i=e["Data.Functor"],c=e["Data.Maybe"],l=e["Data.Newtype"],s=u.ordByteArray,f=u.eqByteArray,d=u.decodeAesonByteArray,v=(n=l.wrap(),t=l.unwrap(),function(e){return n(t(e))}),m=(r=i.map(c.functorMaybe)(l.wrap()),function(e){return r(u.hexToByteArray(e))}),p=(o=l.unwrap(),function(e){return u.byteArrayToHex(o(e))});a.CborBytes=function(e){return e},a.cborBytesToHex=p,a.hexToCborBytes=m,a.rawBytesAsCborBytes=v,a.eqCborBytes=f,a.ordCborBytes=s,a.decodeAesonCborBytes=d}(c),function(e){"use strict";e["Ctl.Internal.Serialization.Address"]=e["Ctl.Internal.Serialization.Address"]||{};var n,t=e["Ctl.Internal.Serialization.Address"],r=e["Ctl.Internal.Serialization.Address"],o=e.Aeson,a=e["Control.Alt"],u=e["Control.Bind"],i=e["Ctl.Internal.FfiHelpers"],c=e["Ctl.Internal.FromData"],l=e["Ctl.Internal.Serialization.Hash"],s=e["Ctl.Internal.ToData"],f=e["Ctl.Internal.Types.BigNum"],d=e["Ctl.Internal.Types.CborBytes"],v=e["Data.Argonaut.Decode.Error"],m=e["Data.Either"],p=e["Data.Eq"],g=e["Data.Function"],y=e["Data.Functor"],w=e["Data.Generic.Rep"],h=e["Data.Maybe"],b=e["Data.Ord"],C=e["Data.Show"],A=e["Data.Show.Generic"],S=function(){function e(){}return e.value=new e,e}(),I=function(){function e(){}return e.value=new e,e}(),T=s.toDataBigNum,D=s.toDataBigNum,F=s.toDataBigNum,E={show:function(e){return"(Address "+r.addressBech32(e)+")"}},x={show:A.genericShow({to:function(e){return e},from:function(e){return e}})(A.genericShowConstructor(A.genericShowArgsArgument(f.showBigNum))({reflectSymbol:function(){return"TransactionIndex"}}))},M={show:A.genericShow({to:function(e){return e},from:function(e){return e}})(A.genericShowConstructor(A.genericShowArgsArgument(f.showBigNum))({reflectSymbol:function(){return"Slot"}}))},R={to:function(e){if(e instanceof w.Inl)return S.value;if(e instanceof w.Inr)return I.value;throw new Error("Failed pattern match at Ctl.Internal.Serialization.Address (line 392, column 1 - line 392, column 36): "+[e.constructor.name])},from:function(e){if(e instanceof S)return new w.Inl(w.NoArguments.value);if(e instanceof I)return new w.Inr(w.NoArguments.value);throw new Error("Failed pattern match at Ctl.Internal.Serialization.Address (line 392, column 1 - line 392, column 36): "+[e.constructor.name])}},P={show:A.genericShow(R)(A.genericShowSum(A.genericShowConstructor(A.genericShowArgsNoArguments)({reflectSymbol:function(){return"TestnetId"}}))(A.genericShowConstructor(A.genericShowArgsNoArguments)({reflectSymbol:function(){return"MainnetId"}})))},B={show:A.genericShow({to:function(e){return e},from:function(e){return e}})(A.genericShowConstructor(A.genericShowArgsArgument(f.showBigNum))({reflectSymbol:function(){return"CertificateIndex"}}))},k=c.fromDataBigNum,N=c.fromDataBigNum,L=c.fromDataBigNum,_={eq:g.on(p.eq(d.eqCborBytes))(r.stakeCredentialToBytes)},U=f.eqBigNum,H={eq:function(e){return function(n){return e instanceof S&&n instanceof S||e instanceof I&&n instanceof I}}},q={eq:g.on(p.eq(d.eqCborBytes))(r.addressBytes)},O={eq:g.on(p.eq(q))(r.rewardAddressToAddress)},W={compare:g.on(b.compare(d.ordCborBytes))(r.addressBytes),Eq0:function(){return q}},V=f.decodeAesonBigNum,K=r.withStakeCredential({onKeyHash:g.const(h.Nothing.value),onScriptHash:h.Just.create}),z=r.withStakeCredential({onKeyHash:h.Just.create,onScriptHash:g.const(h.Nothing.value)}),J=function(e){return function(n){return function(t){return function(r){return"("+n+" "+C.show(e)(t(r))+")"}}}},j={show:J(E)("RewardAddress")(r.rewardAddressToAddress)},Q={show:J(C.showString)("StakeCredenetial")(r.withStakeCredential({onKeyHash:C.show(l.showEd25519KeyHash),onScriptHash:C.show(l.showScriptHash)}))},G=r._rewardAddressFromAddress(i.maybeFfiHelper),Z=function(e){return r.addressBytes(r.rewardAddressToAddress(e))},X={compare:g.on(b.compare(d.ordCborBytes))(Z),Eq0:function(){return O}},Y=r._pointerAddressFromAddress(i.maybeFfiHelper),$=function(e){if(e instanceof S)return 0;if(e instanceof I)return 1;throw new Error("Failed pattern match at Ctl.Internal.Serialization.Address (line 387, column 18 - line 389, column 17): "+[e.constructor.name])},ee=r._pointerAddress($),ne=r._rewardAddress($),te=r._enterpriseAddressFromAddress(i.maybeFfiHelper),re=r._enterpriseAddress($),oe=r._baseAddressFromAddress(i.maybeFfiHelper),ae=r._baseAddress($),ue=function(e){return function(n){return function(t){return ae({network:e,paymentCred:r.scriptHashCredential(n),delegationCred:r.scriptHashCredential(t)})}}},ie=r._addressNetworkId((function(e){return h.fromJust()(0===(n=e)?new h.Just(S.value):1===n?new h.Just(I.value):h.Nothing.value);var n})),ce=r._addressFromBech32(i.maybeFfiHelper),le=u.composeKleisli(h.bindMaybe)(ce)(G),se={decodeAeson:u.composeKleisli(m.bindEither)(o.decodeAeson(o.decodeAesonString))((n=m.note(new v.TypeMismatch("RewardAddress")),function(e){return n(le(e))}))};t.Slot=function(e){return e},t.addressNetworkId=ie,t.baseAddress=ae,t.paymentKeyHashStakeKeyHashAddress=function(e){return function(n){return function(t){return ae({network:e,paymentCred:r.keyHashCredential(n),delegationCred:r.keyHashCredential(t)})}}},t.scriptHashStakeKeyHashAddress=function(e){return function(n){return function(t){return ae({network:e,paymentCred:r.scriptHashCredential(n),delegationCred:r.keyHashCredential(t)})}}},t.paymentKeyHashScriptHashAddress=function(e){return function(n){return function(t){return ae({network:e,paymentCred:r.keyHashCredential(n),delegationCred:r.scriptHashCredential(t)})}}},t.scriptHashScriptHashAddress=ue,t.scriptAddress=function(e){return function(n){return ue(e)(n)(n)}},t.MainnetId=I,t.TestnetId=S,t.stakeCredentialToKeyHash=z,t.stakeCredentialToScriptHash=K,t.addressFromBech32=ce,t.addressPaymentCred=function(e){return a.alt(h.altMaybe)(a.alt(h.altMaybe)(y.map(h.functorMaybe)(r.baseAddressPaymentCred)(oe(e)))(y.map(h.functorMaybe)(r.pointerAddressPaymentCred)(Y(e))))(y.map(h.functorMaybe)(r.enterpriseAddressPaymentCred)(te(e)))},t.addressStakeCred=function(e){return y.map(h.functorMaybe)(r.baseAddressDelegationCred)(oe(e))},t.baseAddressFromAddress=oe,t.baseAddressBytes=function(e){return r.addressBytes(r.baseAddressToAddress(e))},t.enterpriseAddress=re,t.enterpriseAddressFromAddress=te,t.enterpriseAddressBytes=function(e){return r.addressBytes(r.enterpriseAddressToAddress(e))},t.paymentKeyHashEnterpriseAddress=function(e){return function(n){return re({network:e,paymentCred:r.keyHashCredential(n)})}},t.scriptHashEnterpriseAddress=function(e){return function(n){return re({network:e,paymentCred:r.scriptHashCredential(n)})}},t.pointerAddressFromAddress=Y,t.pointerAddressBytes=function(e){return r.addressBytes(r.pointerAddressToAddress(e))},t.paymentKeyHashPointerAddress=function(e){return function(n){return function(t){return ee({network:e,paymentCred:r.keyHashCredential(n),stakePointer:t})}}},t.scriptHashPointerAddress=function(e){return function(n){return function(t){return ee({network:e,paymentCred:r.scriptHashCredential(n),stakePointer:t})}}},t.rewardAddress=ne,t.rewardAddressBytes=Z,t.rewardAddressBech32=function(e){return r.addressBech32(r.rewardAddressToAddress(e))},t.rewardAddressFromAddress=G,t.eqSlot=U,t.decodeAesonSlot=V,t.fromDataSlot=N,t.toDataSlot=D,t.showSlot=M,t.toDataTransactionIndex=T,t.fromDataTransactionIndex=k,t.showTransactionIndex=x,t.toDataCertificateIndex=F,t.fromDataCertificateIndex=L,t.showCertificateIndex=B,t.showAddress=E,t.eqAddress=q,t.ordAddress=W,t.eqRewardAddress=O,t.showRewardAddress=j,t.ordRewardAddress=X,t.decodeAesonRewardAddress=se,t.eqStakeCredential=_,t.showStakeCredential=Q,t.eqNetworkId=H,t.showNetworkId=P,t.addressBech32=r.addressBech32,t.keyHashCredential=r.keyHashCredential,t.scriptHashCredential=r.scriptHashCredential,t.withStakeCredential=r.withStakeCredential,t.baseAddressPaymentCred=r.baseAddressPaymentCred,t.baseAddressDelegationCred=r.baseAddressDelegationCred,t.baseAddressToAddress=r.baseAddressToAddress,t.enterpriseAddressPaymentCred=r.enterpriseAddressPaymentCred,t.enterpriseAddressToAddress=r.enterpriseAddressToAddress,t.pointerAddressPaymentCred=r.pointerAddressPaymentCred,t.pointerAddressToAddress=r.pointerAddressToAddress,t.pointerAddressStakePointer=r.pointerAddressStakePointer,t.rewardAddressToAddress=r.rewardAddressToAddress}(c),function(e){"use strict";e["Ctl.Internal.Cardano.Types.NativeScript"]=e["Ctl.Internal.Cardano.Types.NativeScript"]||{};var n=e["Ctl.Internal.Cardano.Types.NativeScript"],t=e["Ctl.Internal.Serialization.Address"],r=e["Ctl.Internal.Serialization.Hash"],o=e["Data.Eq"],a=e["Data.Generic.Rep"],u=e["Data.Show"],i=e["Data.Show.Generic"],c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),d=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),v=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),m={to:function(e){if(e instanceof a.Inl)return new c(e.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inl)return new l(e.value0.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inr&&e.value0.value0 instanceof a.Inl)return new s(e.value0.value0.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inr&&e.value0.value0 instanceof a.Inr&&e.value0.value0.value0 instanceof a.Inl)return new f(e.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value1);if(e instanceof a.Inr&&e.value0 instanceof a.Inr&&e.value0.value0 instanceof a.Inr&&e.value0.value0.value0 instanceof a.Inr&&e.value0.value0.value0.value0 instanceof a.Inl)return new d(e.value0.value0.value0.value0.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inr&&e.value0.value0 instanceof a.Inr&&e.value0.value0.value0 instanceof a.Inr&&e.value0.value0.value0.value0 instanceof a.Inr)return new v(e.value0.value0.value0.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.Cardano.Types.NativeScript (line 48, column 1 - line 48, column 39): "+[e.constructor.name])},from:function(e){if(e instanceof c)return new a.Inl(e.value0);if(e instanceof l)return new a.Inr(new a.Inl(e.value0));if(e instanceof s)return new a.Inr(new a.Inr(new a.Inl(e.value0)));if(e instanceof f)return new a.Inr(new a.Inr(new a.Inr(new a.Inl(new a.Product(e.value0,e.value1)))));if(e instanceof d)return new a.Inr(new a.Inr(new a.Inr(new a.Inr(new a.Inl(e.value0)))));if(e instanceof v)return new a.Inr(new a.Inr(new a.Inr(new a.Inr(new a.Inr(e.value0)))));throw new Error("Failed pattern match at Ctl.Internal.Cardano.Types.NativeScript (line 48, column 1 - line 48, column 39): "+[e.constructor.name])}},p={show:function(e){return i.genericShow(m)(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsArgument(r.showEd25519KeyHash))({reflectSymbol:function(){return"ScriptPubkey"}}))(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsArgument(u.showArray(p)))({reflectSymbol:function(){return"ScriptAll"}}))(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsArgument(u.showArray(p)))({reflectSymbol:function(){return"ScriptAny"}}))(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsProduct(i.genericShowArgsArgument(u.showInt))(i.genericShowArgsArgument(u.showArray(p))))({reflectSymbol:function(){return"ScriptNOfK"}}))(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsArgument(t.showSlot))({reflectSymbol:function(){return"TimelockStart"}}))(i.genericShowConstructor(i.genericShowArgsArgument(t.showSlot))({reflectSymbol:function(){return"TimelockExpiry"}})))))))(e)}},g={eq:function(e){return function(n){return e instanceof c&&n instanceof c?o.eq(r.eqEd25519KeyHash)(e.value0)(n.value0):e instanceof l&&n instanceof l||e instanceof s&&n instanceof s?o.eq(o.eqArray(g))(e.value0)(n.value0):e instanceof f&&n instanceof f?e.value0===n.value0&&o.eq(o.eqArray(g))(e.value1)(n.value1):(e instanceof d&&n instanceof d||e instanceof v&&n instanceof v)&&o.eq(t.eqSlot)(e.value0)(n.value0)}}};n.ScriptPubkey=c,n.ScriptAll=l,n.ScriptAny=s,n.ScriptNOfK=f,n.TimelockStart=d,n.TimelockExpiry=v,n.eqNativeScript=g,n.showNativeScript=p}(c),function(e){"use strict";e["Ctl.Internal.Types.Scripts"]=e["Ctl.Internal.Types.Scripts"]||{};var n=e["Ctl.Internal.Types.Scripts"],t=e["Ctl.Internal.Cardano.Types.NativeScript"],r=e["Ctl.Internal.Serialization.Hash"],o=e["Ctl.Internal.Types.ByteArray"],a=e["Data.Eq"],u=e["Data.Generic.Rep"],i=e["Data.Ordering"],c=e["Data.Show.Generic"],l=e["Data.Tuple"],s=function(){function e(){}return e.value=new e,e}(),f=function(){function e(){}return e.value=new e,e}(),d=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),v=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),m=r.toDataScriptHash,p=r.ordScriptHash,g=r.ordScriptHash,y={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(r.showScriptHash))({reflectSymbol:function(){return"ValidatorHash"}}))},w={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(r.showScriptHash))({reflectSymbol:function(){return"StakeValidatorHash"}}))},h={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(t.showNativeScript))({reflectSymbol:function(){return"NativeScriptStakeValidator"}}))},b={to:function(e){if(e instanceof u.Inl)return new d(e.value0);if(e instanceof u.Inr)return new v(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.Scripts (line 110, column 1 - line 110, column 40): "+[e.constructor.name])},from:function(e){if(e instanceof d)return new u.Inl(e.value0);if(e instanceof v)return new u.Inr(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.Scripts (line 110, column 1 - line 110, column 40): "+[e.constructor.name])}},C={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(r.showScriptHash))({reflectSymbol:function(){return"MintingPolicyHash"}}))},A={to:function(e){if(e instanceof u.Inl)return s.value;if(e instanceof u.Inr)return f.value;throw new Error("Failed pattern match at Ctl.Internal.Types.Scripts (line 52, column 1 - line 52, column 35): "+[e.constructor.name])},from:function(e){if(e instanceof s)return new u.Inl(u.NoArguments.value);if(e instanceof f)return new u.Inr(u.NoArguments.value);throw new Error("Failed pattern match at Ctl.Internal.Types.Scripts (line 52, column 1 - line 52, column 35): "+[e.constructor.name])}},S={show:c.genericShow(A)(c.genericShowSum(c.genericShowConstructor(c.genericShowArgsNoArguments)({reflectSymbol:function(){return"PlutusV1"}}))(c.genericShowConstructor(c.genericShowArgsNoArguments)({reflectSymbol:function(){return"PlutusV2"}})))},I={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(l.showTuple(o.showByteArray)(S)))({reflectSymbol:function(){return"PlutusScript"}}))},T={show:c.genericShow(b)(c.genericShowSum(c.genericShowConstructor(c.genericShowArgsArgument(I))({reflectSymbol:function(){return"PlutusMintingPolicy"}}))(c.genericShowConstructor(c.genericShowArgsArgument(t.showNativeScript))({reflectSymbol:function(){return"NativeMintingPolicy"}})))},D={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(I))({reflectSymbol:function(){return"PlutusScriptStakeValidator"}}))},F={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(I))({reflectSymbol:function(){return"Validator"}}))},E=r.fromDataScriptHash,x={eq:function(e){return function(n){return e instanceof s&&n instanceof s||e instanceof f&&n instanceof f}}},M=l.eqTuple(o.eqByteArray)(x),R={eq:function(e){return function(n){return e instanceof d&&n instanceof d?a.eq(M)(e.value0)(n.value0):e instanceof v&&n instanceof v&&a.eq(t.eqNativeScript)(e.value0)(n.value0)}}},P=M,B={compare:function(e){return function(n){if(e instanceof s&&n instanceof s)return i.EQ.value;if(e instanceof s)return i.LT.value;if(n instanceof s)return i.GT.value;if(e instanceof f&&n instanceof f)return i.EQ.value;throw new Error("Failed pattern match at Ctl.Internal.Types.Scripts (line 51, column 1 - line 51, column 29): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return x}};n.PlutusMintingPolicy=d,n.NativeMintingPolicy=v,n.MintingPolicyHash=function(e){return e},n.PlutusScript=function(e){return e},n.ValidatorHash=function(e){return e},n.PlutusV1=s,n.PlutusV2=f,n.plutusV1Script=function(e){return new l.Tuple(e,s.value)},n.plutusV2Script=function(e){return new l.Tuple(e,f.value)},n.ordLanguage=B,n.showLanguage=S,n.eqPlutusScript=M,n.showPlutusScript=I,n.eqMintingPolicy=R,n.showMintingPolicy=T,n.eqValidator=P,n.showValidator=F,n.showNativeScriptStakeVali=h,n.showPlutusScriptStakeVali=D,n.ordMintingPolicyHash=g,n.showMintingPolicyHash=C,n.ordValidatorHash=p,n.fromDataValidatorHash=E,n.toDataValidatorHash=m,n.showValidatorHash=y,n.showStakeValidatorHash=w}(c),function(e){"use strict";e["Ctl.Internal.Cardano.Types.ScriptRef"]=e["Ctl.Internal.Cardano.Types.ScriptRef"]||{};var n=e["Ctl.Internal.Cardano.Types.ScriptRef"],t=e["Ctl.Internal.Cardano.Types.NativeScript"],r=e["Ctl.Internal.Types.Scripts"],o=e["Data.Eq"],a=e["Data.Generic.Rep"],u=e["Data.Maybe"],i=e["Data.Show.Generic"],c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s={to:function(e){if(e instanceof a.Inl)return new c(e.value0);if(e instanceof a.Inr)return new l(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Cardano.Types.ScriptRef (line 38, column 1 - line 38, column 36): "+[e.constructor.name])},from:function(e){if(e instanceof c)return new a.Inl(e.value0);if(e instanceof l)return new a.Inr(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Cardano.Types.ScriptRef (line 38, column 1 - line 38, column 36): "+[e.constructor.name])}},f={show:i.genericShow(s)(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsArgument(t.showNativeScript))({reflectSymbol:function(){return"NativeScriptRef"}}))(i.genericShowConstructor(i.genericShowArgsArgument(r.showPlutusScript))({reflectSymbol:function(){return"PlutusScriptRef"}})))},d={eq:function(e){return function(n){return e instanceof c&&n instanceof c?o.eq(t.eqNativeScript)(e.value0)(n.value0):e instanceof l&&n instanceof l&&o.eq(r.eqPlutusScript)(e.value0)(n.value0)}}};n.NativeScriptRef=c,n.PlutusScriptRef=l,n.getPlutusScript=function(e){return e instanceof l?new u.Just(e.value0):u.Nothing.value},n.eqScriptRef=d,n.showScriptRef=f}(c),function(e){"use strict";e["Control.Alternative"]=e["Control.Alternative"]||{};var n=e["Control.Alternative"],t=e["Control.Applicative"],r=e["Control.Plus"],o=e["Data.Unit"];n.guard=function(e){return function(n){if(n)return t.pure(e.Applicative0())(o.unit);if(!n)return r.empty(e.Plus1());throw new Error("Failed pattern match at Control.Alternative (line 48, column 1 - line 48, column 54): "+[n.constructor.name])}}}(c),function(e){"use strict";e["Data.Array.NonEmpty.Internal"]=e["Data.Array.NonEmpty.Internal"]||{};var n=e["Data.Array.NonEmpty.Internal"],t=e["Control.Bind"],r=e["Data.Foldable"],o=e["Data.Functor"],a=e["Data.Traversable"].traversableArray,u=o.functorArray,i=r.foldableArray,c=t.bindArray;n.NonEmptyArray=function(e){return e},n.functorNonEmptyArray=u,n.foldableNonEmptyArray=i,n.traversableNonEmptyArray=a,n.bindNonEmptyArray=c}(c),function(e){"use strict";e["Data.Array.NonEmpty"]=e["Data.Array.NonEmpty"]||{};var n,t,r=e["Data.Array.NonEmpty"],o=e["Data.Array"],a=e["Data.Array.NonEmpty.Internal"],u=e["Data.Boolean"],i=e["Data.Maybe"],c=e["Data.Ord"],l=e["Data.Semigroup"],s=a.NonEmptyArray,f=(n=o.uncons,t=i.fromJust(),function(e){return t(n(e))}),d=function(e){return function(n){return e(n)}},v=(d(o.length),function(e){var n=d(e);return function(e){return s(n(e))}});r.fromArray=function(e){if(o.length(e)>0)return new i.Just(s(e));if(u.otherwise)return i.Nothing.value;throw new Error("Failed pattern match at Data.Array.NonEmpty (line 159, column 1 - line 159, column 58): "+[e.constructor.name])},r.toArray=function(e){return e},r.singleton=function(e){return s(o.singleton(e))},r.range=function(e){return function(n){return s(o.range(e)(n))}},r.replicate=function(e){return function(n){return s(o.replicate(c.max(c.ordInt)(1)(e))(n))}},r["cons'"]=function(e){return function(n){return s(o.cons(e)(n))}},r.appendArray=function(e){return function(n){return s(l.append(l.semigroupArray)(e)(n))}},r.uncons=f,r.sortBy=function(e){return v(o.sortBy(e))},r.sortWith=function(e){return function(n){return v(o.sortWith(e)(n))}},r.zipWith=function(e){return function(n){return function(t){return s(o.zipWith(e)(n)(t))}}},r.zip=function(e){return function(n){return s(o.zip(e)(n))}}}(c),function(e){"use strict";e["Ctl.Internal.Partition"]=e["Ctl.Internal.Partition"]||{};var n,t,r=e["Ctl.Internal.Partition"],o=e["Data.Array"],a=e["Data.Array.NonEmpty"],u=e["Data.Array.NonEmpty.Internal"],i=e["Data.BigInt"],c=e["Data.Boolean"],l=e["Data.Eq"],s=e["Data.EuclideanRing"],f=e["Data.Foldable"],d=e["Data.Function"],v=e["Data.Functor"],m=e["Data.HeytingAlgebra"],p=e["Data.Maybe"],g=e["Data.Newtype"],y=e["Data.Ord"],w=e["Data.Ordering"],h=e["Data.Ring"],b=e["Data.Semigroup"],C=e["Data.Semiring"],A=e["Data.Tuple"],S=function(e){return e},I=(n=p.fromJust(),function(e){return n(i.toInt(e))}),T=function(e){return function(n){return function(t){return new A.Tuple(s.div(e)(n)(t),s.mod(e)(n)(t))}}},D={equipartition:function(e){return function(n){if(n<=1)return a.singleton(e);if(c.otherwise){var t=v.map(A.functorTuple)(I)(T(i.euclideanRingBigInt)(e)(i.fromInt(n)));return a.appendArray(a.replicate(n-t.value1|0)(t.value0))(o.replicate(t.value1)(C.add(i.semiringBigInt)(t.value0)(C.one(i.semiringBigInt))))}throw new Error("Failed pattern match at Ctl.Internal.Partition (line 102, column 1 - line 111, column 61): "+[e.constructor.name,n.constructor.name])}}},F=(t=p.fromJust(),function(e){return t(a.fromArray(e))}),E={partition:function(e){return function(n){if(f.any(u.foldableNonEmptyArray)(m.heytingAlgebraBoolean)((function(e){return y.lessThan(i.ordBigInt)(e)(C.zero(i.semiringBigInt))}))(n))return p.Nothing.value;if(l.eq(i.eqBigInt)(f.sum(u.foldableNonEmptyArray)(i.semiringBigInt)(n))(C.zero(i.semiringBigInt)))return p.Nothing.value;if(c.otherwise){var t=f.sum(u.foldableNonEmptyArray)(i.semiringBigInt)(n),r=v.mapFlipped(u.functorNonEmptyArray)(n)((function(n){return T(i.euclideanRingBigInt)(C.mul(i.semiringBigInt)(e)(n))(t)})),s=I(h.sub(i.ringBigInt)(e)(f.sum(u.foldableNonEmptyArray)(i.semiringBigInt)(v.map(u.functorNonEmptyArray)(A.fst)(r)))),D=v.map(u.functorNonEmptyArray)(A.snd)(a.sortBy(y.comparing(y.ordInt)(A.fst))((E=a.sortBy(d.on((function(e){var n,t=y.compare((n=i.ordBigInt,{compare:function(e){return function(t){var r=y.compare(n)(e.value1)(t.value1);return r instanceof w.EQ?y.compare(n)(e.value0)(t.value0):r}},Eq0:function(){return e=n.Eq0(),A.eqTuple(e)(e);var e}}))(e);return function(e){return w.invert(t(e))}}))(A.snd))(a.zip(a.range(1)(f.length(u.foldableNonEmptyArray)(C.semiringInt)(r)))(v.map(u.functorNonEmptyArray)(S)(r))),a.zipWith(C.add(A.semiringTuple(C.semiringInt)(i.semiringBigInt)))(v.map(u.functorNonEmptyArray)(v.map(A.functorTuple)((x=g.unwrap(),function(e){return A.fst(x(e))})))(E))(F(b.append(b.semigroupArray)(o.replicate(s)(C.one(A.semiringTuple(C.semiringInt)(i.semiringBigInt))))(o.replicate(f.length(u.foldableNonEmptyArray)(C.semiringInt)(E)-s|0)(C.zero(A.semiringTuple(C.semiringInt)(i.semiringBigInt)))))))));return new p.Just(D)}var E,x;throw new Error("Failed pattern match at Ctl.Internal.Partition (line 42, column 1 - line 91, column 33): "+[e.constructor.name,n.constructor.name])}}};r.equipartition=function(e){return e.equipartition},r.partition=function(e){return e.partition},r.partitionBigInt=E,r.equipartitionBigInt=D}(c),function(e){let n;n=TextDecoder,e.assetNameName=("name",e=>e.name())}(c["Ctl.Internal.Types.TokenName"]=c["Ctl.Internal.Types.TokenName"]||{}),function(e){"use strict";e["Ctl.Internal.Types.TokenName"]=e["Ctl.Internal.Types.TokenName"]||{};var n=e["Ctl.Internal.Types.TokenName"],t=e["Ctl.Internal.Types.TokenName"],r=e["Control.Applicative"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.Types.ByteArray"],u=e["Ctl.Internal.Types.RawBytes"],i=e["Data.Boolean"],c=e["Data.Maybe"],l=e["Data.Monoid"],s=e["Data.Newtype"],f=e["Data.Show"],d=o.toDataRawBytes,v={show:function(e){return"(TokenName "+f.show(u.showRawBytes)(e)+")"}},m=u.ordRawBytes,p=u.eqRawBytes,g=l.mempty(u.monoidRawBytes);n.adaToken=g,n.getTokenName=function(e){return s.unwrap()(e)},n.mkTokenName=function(e){if(a.byteLength(e)<=32)return r.pure(c.applicativeMaybe)(s.wrap()(e));if(i.otherwise)return c.Nothing.value;throw new Error("Failed pattern match at Ctl.Internal.Types.TokenName (line 106, column 1 - line 106, column 44): "+[e.constructor.name])},n.eqTokenName=p,n.ordTokenName=m,n.toDataTokenName=d,n.showTokenName=v,n.assetNameName=t.assetNameName}(c),function(e){"use strict";e.mapWithIndexArray=function(e){return function(n){for(var t=n.length,r=Array(t),o=0;ot=>r=>{try{return e.valid(n[t].from_bytes(r))}catch(n){return e.error(t+".from_bytes() raised "+n)}}}(c["Ctl.Internal.Deserialization.FromBytes"]=c["Ctl.Internal.Deserialization.FromBytes"]||{}),function(e){"use strict";e["Data.Variant"]=e["Data.Variant"]||{};var n=e["Data.Variant"],t=e["Data.Symbol"];n.inj=function(){return function(e){return function(n){return function(r){return{type:t.reflectSymbol(e)(n),value:r}}}}}}(c),function(e){"use strict";e["Ctl.Internal.Deserialization.Error"]=e["Ctl.Internal.Deserialization.Error"]||{};var n=e["Ctl.Internal.Deserialization.Error"],t=e["Ctl.Internal.FfiHelpers"],r=e["Data.Variant"],o=e["Type.Proxy"].Proxy.value,a=t.errorHelper(r.inj()({reflectSymbol:function(){return"fromBytesError"}})(o));n.fromBytesErrorHelper=a}(c),function(e){"use strict";e["Ctl.Internal.Deserialization.FromBytes"]=e["Ctl.Internal.Deserialization.FromBytes"]||{};var n=e["Ctl.Internal.Deserialization.FromBytes"],t=e["Ctl.Internal.Deserialization.FromBytes"],r=e["Control.Applicative"],o=e["Ctl.Internal.Deserialization.Error"],a=e["Data.Either"],u=e["Data.Maybe"],i=e["Data.Newtype"],c=e.Effect,l=e["Effect.Exception"],s=t._fromBytes(o.fromBytesErrorHelper),f={"fromBytes'":s("Address")},d={"fromBytes'":s("AuxiliaryDataHash")},v={"fromBytes'":s("DataHash")},m={"fromBytes'":s("Ed25519Signature")},p={"fromBytes'":s("GeneralTransactionMetadata")},g={"fromBytes'":s("GenesisDelegateHash")},y={"fromBytes'":s("GenesisHash")},w={"fromBytes'":s("NativeScript")},h={"fromBytes'":s("PlutusData")},b={"fromBytes'":s("PoolMetadataHash")},C={"fromBytes'":s("PublicKey")},A={"fromBytes'":s("ScriptDataHash")},S={"fromBytes'":s("TransactionHash")},I={"fromBytes'":s("TransactionUnspentOutput")},T={"fromBytes'":s("TransactionWitnessSet")},D={"fromBytes'":s("VRFKeyHash")},F={"fromBytes'":s("Value")},E=function(e){var n=e["fromBytes'"],t=i.unwrap();return function(e){return a.hush(n(t(e)))}};n.fromBytes=E,n.fromBytesEffect=function(e){return function(n){var t=E(e)(n);if(t instanceof u.Nothing)return l.throw("from_bytes() call failed");if(t instanceof u.Just)return r.pure(c.applicativeEffect)(t.value0);throw new Error("Failed pattern match at Ctl.Internal.Deserialization.FromBytes (line 142, column 3 - line 144, column 21): "+[t.constructor.name])}},n.fromBytesAddress=f,n.fromBytesAuxiliaryDataHas=d,n.fromBytesDataHash=v,n.fromBytesEd25519Signature=m,n.fromBytesGeneralTransacti=p,n.fromBytesGenesisDelegateH=g,n.fromBytesGenesisHash=y,n.fromBytesNativeScript=w,n.fromBytesPlutusData=h,n.fromBytesPoolMetadataHash=b,n.fromBytesPublicKey=C,n.fromBytesScriptDataHash=A,n.fromBytesTransactionHash=S,n.fromBytesTransactionUnspe=I,n.fromBytesTransactionWitne=T,n.fromBytesValue=F,n.fromBytesVRFKeyHash=D}(c),function(e){let n;n=t(1164),n=t(6359)(n),e._publicKeyFromBech32=e=>t=>{try{return e.just(n.PublicKey.from_bech32(t))}catch(n){return e.nothing}},e._ed25519SignatureFromBech32=e=>t=>{try{return e.just(n.Ed25519Signature.from_bech32(t))}catch(n){return e.nothing}},e._privateKeyFromBytes=e=>t=>{try{return e.just(n.PrivateKey.from_normal_bytes(t))}catch(n){return e.nothing}}}(c["Ctl.Internal.Deserialization.Keys"]=c["Ctl.Internal.Deserialization.Keys"]||{}),function(e){"use strict";e["Ctl.Internal.Deserialization.Keys"]=e["Ctl.Internal.Deserialization.Keys"]||{};var n=e["Ctl.Internal.Deserialization.Keys"],t=e["Ctl.Internal.Deserialization.Keys"],r=e["Ctl.Internal.FfiHelpers"],o=t._publicKeyFromBech32(r.maybeFfiHelper),a=t._privateKeyFromBytes(r.maybeFfiHelper),u=t._ed25519SignatureFromBech32(r.maybeFfiHelper);n.publicKeyFromBech32=o,n.privateKeyFromBytes=a,n.ed25519SignatureFromBech32=u}(c),function(e){e.bytesFromPublicKey=e=>e.as_bytes(),e.publicKeyFromPrivateKey=e=>e.to_public();const n=e=>e.to_bech32();e.bech32FromPublicKey=n,e.bech32FromEd25519Signature=n}(c["Ctl.Internal.Serialization.Keys"]=c["Ctl.Internal.Serialization.Keys"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.Keys"]=e["Ctl.Internal.Serialization.Keys"]||{};var n=e["Ctl.Internal.Serialization.Keys"],t=e["Ctl.Internal.Serialization.Keys"];n.bytesFromPublicKey=t.bytesFromPublicKey,n.bech32FromPublicKey=t.bech32FromPublicKey,n.bech32FromEd25519Signature=t.bech32FromEd25519Signature,n.publicKeyFromPrivateKey=t.publicKeyFromPrivateKey}(c),function(e){e._toBytes=e=>e.to_bytes()}(c["Ctl.Internal.Serialization.ToBytes"]=c["Ctl.Internal.Serialization.ToBytes"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.ToBytes"]=e["Ctl.Internal.Serialization.ToBytes"]||{};var n=e["Ctl.Internal.Serialization.ToBytes"],t=e["Ctl.Internal.Serialization.ToBytes"],r=e["Ctl.Internal.Types.CborBytes"];n.toBytes=function(){return function(e){return r.CborBytes(t._toBytes(e))}}}(c),function(e){let n;n=t(1164),n=t(6359)(n),e.newPositive=n.Int.new,e.newNegative=n.Int.new_negative,e._intToStr=e=>e.to_str()}(c["Ctl.Internal.Types.Int"]=c["Ctl.Internal.Types.Int"]||{}),function(e){"use strict";e["Ctl.Internal.Types.Int"]=e["Ctl.Internal.Types.Int"]||{};var n=e["Ctl.Internal.Types.Int"],t=e["Ctl.Internal.Types.Int"],r=e.Aeson,o=e["Control.Alt"],a=e["Control.Bind"],u=e["Ctl.Internal.Types.BigNum"],i=e["Data.Argonaut.Decode.Error"],c=e["Data.BigInt"],l=e["Data.Either"],s=e["Data.Eq"],f=e["Data.Function"],d=e["Data.Functor"],v=e["Data.Maybe"],m=e["Data.Ord"],p=e["Data.Ring"],g={show:t._intToStr},y={eq:f.on(s.eq(s.eqString))(t._intToStr)},w={compare:f.on(m.compare(c.ordBigInt))((function(e){return v.fromJust()(c.fromString(t._intToStr(e)))})),Eq0:function(){return y}},h=function(e){return o.alt(v.altMaybe)(d.map(v.functorMaybe)(t.newPositive)(u.fromBigInt(e)))(d.map(v.functorMaybe)(t.newNegative)(u.fromBigInt(p.negate(c.ringBigInt)(e))))},b=(a.composeKleisliFlipped(v.bindMaybe)(h)(c.fromString),{decodeAeson:function(e){return a.bind(l.bindEither)(r.decodeAeson(r.decodeAesonBigInt)(e))((n=l.note(new i.TypeMismatch("Int")),function(e){return n(h(e))}));var n}});n.eqInt=y,n.ordInt=w,n.showInt=g,n.decodeAesonInt=b}(c),function(e){"use strict";e["Ctl.Internal.Types.Datum"]=e["Ctl.Internal.Types.Datum"]||{};var n=e["Ctl.Internal.Types.Datum"],t=e["Ctl.Internal.FromData"],r=e["Ctl.Internal.Types.PlutusData"],o=e["Data.Show.Generic"],a={show:o.genericShow({to:function(e){return e},from:function(e){return e}})(o.genericShowConstructor(o.genericShowArgsArgument(r.showPlutusData))({reflectSymbol:function(){return"Datum"}}))},u=t.fromDataPlutusData,i=r.eqPlutusData;n.eqDatum=i,n.fromDataDatum=u,n.showDatum=a}(c),function(e){"use strict";e["Ctl.Internal.Types.Transaction"]=e["Ctl.Internal.Types.Transaction"]||{};var n=e["Ctl.Internal.Types.Transaction"],t=e["Control.Apply"],r=e["Ctl.Internal.FromData"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.Types.BigNum"],u=e["Ctl.Internal.Types.ByteArray"],i=e["Ctl.Internal.Types.PlutusData"],c=e["Data.Eq"],l=e["Data.Functor"],s=e["Data.Maybe"],f=e["Data.Ord"],d=e["Data.Ordering"],v=e["Data.Show"],m=e["Data.Show.Generic"],p=e["Data.UInt"],g=function(e){return e},y=function(e){return e},w={toData:function(e){return new i.Constr(a.zero,[o.toData(o.toDataByteArray)(e)])}},h={toData:function(e){return new i.Constr(a.zero,[o.toData(w)(e.transactionId),o.toData(o.toDataUInt)(e.index)])}},b=u.ordByteArray,C={show:m.genericShow({to:function(e){return e},from:function(e){return e}})(m.genericShowConstructor(m.genericShowArgsArgument(u.showByteArray))({reflectSymbol:function(){return"TransactionHash"}}))},A={show:m.genericShow({to:function(e){return e},from:function(e){return e}})(m.genericShowConstructor(m.genericShowArgsArgument(v.showRecord()(v.showRecordFieldsCons({reflectSymbol:function(){return"index"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"transactionId"}})(v.showRecordFieldsNil)(C))(p.uintShowInstance))))({reflectSymbol:function(){return"TransactionInput"}}))},S={show:m.genericShow({to:function(e){return e},from:function(e){return e}})(m.genericShowConstructor(m.genericShowArgsArgument(u.showByteArray))({reflectSymbol:function(){return"DataHash"}}))},I={fromData:function(e){return e instanceof i.Constr&&1===e.value1.length&&c.eq(a.eqBigNum)(e.value0)(a.zero)?l.map(s.functorMaybe)(g)(r.fromData(r.fromDataByteArray)(e.value1[0])):s.Nothing.value}},T={fromData:function(e){return e instanceof i.Constr&&2===e.value1.length&&c.eq(a.eqBigNum)(e.value0)(a.zero)?l.map(s.functorMaybe)(y)(t.apply(s.applyMaybe)(l.map(s.functorMaybe)((function(e){return function(n){return{transactionId:e,index:n}}}))(r.fromData(I)(e.value1[0])))(r.fromData(r.fromDataUInt)(e.value1[1]))):s.Nothing.value}},D=u.eqByteArray,F=c.eqRec()(c.eqRowCons(c.eqRowCons(c.eqRowNil)()({reflectSymbol:function(){return"transactionId"}})(D))()({reflectSymbol:function(){return"index"}})(p.uintEqInstance)),E={compare:function(e){return function(n){return f.compare(f.ordString)(u.byteArrayToHex(e))(u.byteArrayToHex(n))}},Eq0:function(){return D}},x={compare:function(e){return function(n){var t=f.compare(E)(e.transactionId)(n.transactionId);return t instanceof d.EQ?f.compare(p.uintOrd)(e.index)(n.index):t}},Eq0:function(){return F}},M=u.eqByteArray,R=u.decodeAesonByteArray,P=u.decodeAesonByteArray;n.DataHash=function(e){return e},n.eqTransactionInput=F,n.ordTransactionInput=x,n.showTransactionInput=A,n.fromDataTransactionInput=T,n.toDataTransactionInput=h,n.decodeAesonTransactionHas=R,n.ordTransactionHash=E,n.showTransactionHash=C,n.eqDataHash=M,n.ordDataHash=b,n.decodeAesonDataHash=P,n.showDataHash=S}(c),function(e){"use strict";e["Ctl.Internal.Types.OutputDatum"]=e["Ctl.Internal.Types.OutputDatum"]||{};var n=e["Ctl.Internal.Types.OutputDatum"],t=e["Ctl.Internal.Types.Datum"],r=e["Ctl.Internal.Types.Transaction"],o=e["Data.Eq"],a=e["Data.Generic.Rep"],u=e["Data.Maybe"],i=e["Data.Show.Generic"],c=function(){function e(){}return e.value=new e,e}(),l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f={to:function(e){if(e instanceof a.Inl)return c.value;if(e instanceof a.Inr&&e.value0 instanceof a.Inl)return new l(e.value0.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inr)return new s(e.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.OutputDatum (line 38, column 1 - line 38, column 38): "+[e.constructor.name])},from:function(e){if(e instanceof c)return new a.Inl(a.NoArguments.value);if(e instanceof l)return new a.Inr(new a.Inl(e.value0));if(e instanceof s)return new a.Inr(new a.Inr(e.value0));throw new Error("Failed pattern match at Ctl.Internal.Types.OutputDatum (line 38, column 1 - line 38, column 38): "+[e.constructor.name])}},d={show:i.genericShow(f)(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsNoArguments)({reflectSymbol:function(){return"NoOutputDatum"}}))(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsArgument(r.showDataHash))({reflectSymbol:function(){return"OutputDatumHash"}}))(i.genericShowConstructor(i.genericShowArgsArgument(t.showDatum))({reflectSymbol:function(){return"OutputDatum"}}))))},v={eq:function(e){return function(n){return e instanceof c&&n instanceof c||(e instanceof l&&n instanceof l?o.eq(r.eqDataHash)(e.value0)(n.value0):e instanceof s&&n instanceof s&&o.eq(t.eqDatum)(e.value0)(n.value0))}}};n.NoOutputDatum=c,n.OutputDatumHash=l,n.OutputDatum=s,n.outputDatumDataHash=function(e){return e instanceof l?new u.Just(e.value0):u.Nothing.value},n.outputDatumDatum=function(e){return e instanceof s?new u.Just(e.value0):u.Nothing.value},n.eqOutputDatum=v,n.showOutputDatum=d}(c),function(e){"use strict";e["Ctl.Internal.Types.PubKeyHash"]=e["Ctl.Internal.Types.PubKeyHash"]||{};var n=e["Ctl.Internal.Types.PubKeyHash"],t=e["Ctl.Internal.Serialization.Address"],r=e["Ctl.Internal.Serialization.Hash"],o=e["Data.Newtype"],a=e["Data.Show.Generic"],u=r.toDataEd25519KeyHash,i=u,c=r.ordEd25519KeyHash,l={show:a.genericShow({to:function(e){return e},from:function(e){return e}})(a.genericShowConstructor(a.genericShowArgsArgument(r.showEd25519KeyHash))({reflectSymbol:function(){return"PubKeyHash"}}))},s={show:a.genericShow({to:function(e){return e},from:function(e){return e}})(a.genericShowConstructor(a.genericShowArgsArgument(l))({reflectSymbol:function(){return"StakePubKeyHash"}}))},f={show:a.genericShow({to:function(e){return e},from:function(e){return e}})(a.genericShowConstructor(a.genericShowArgsArgument(l))({reflectSymbol:function(){return"PaymentPubKeyHash"}}))},d=r.fromDataEd25519KeyHash,v=d,m=r.eqEd25519KeyHash;n.payPubKeyHashBaseAddress=function(e){return function(n){return function(r){return function(e){return function(n){return function(r){return t.baseAddressToAddress(t.paymentKeyHashStakeKeyHashAddress(e)(o.unwrap()(n))(o.unwrap()(o.unwrap()(r))))}}}(e)(n)(r)}}},n.payPubKeyHashEnterpriseAddress=function(e){return function(n){return function(e){var n,r=(n=e,function(e){return t.enterpriseAddress({network:n,paymentCred:t.keyHashCredential(o.unwrap()(e))})});return function(e){return t.enterpriseAddressToAddress(r(e))}}(e)(n)}},n.stakePubKeyHashRewardAddress=function(e){var n,r=(n=e,function(e){return t.rewardAddress({network:n,paymentCred:t.keyHashCredential(o.unwrap()(e))})}),a=o.unwrap();return function(e){return t.rewardAddressToAddress(r(a(e)))}},n.fromDataPubKeyHash=d,n.toDataPubKeyHash=u,n.showPubKeyHash=l,n.eqPaymentPubKeyHash=m,n.fromDataPaymentPubKeyHash=v,n.ordPaymentPubKeyHash=c,n.toDataPaymentPubKeyHash=i,n.showPaymentPubKeyHash=f,n.showStakePubKeyHash=s}(c),function(e){"use strict";e["Ctl.Internal.Types.RedeemerTag"]=e["Ctl.Internal.Types.RedeemerTag"]||{};var n=e["Ctl.Internal.Types.RedeemerTag"],t=e["Data.Generic.Rep"],r=e["Data.Maybe"],o=e["Data.Ordering"],a=e["Data.Show.Generic"],u=function(){function e(){}return e.value=new e,e}(),i=function(){function e(){}return e.value=new e,e}(),c=function(){function e(){}return e.value=new e,e}(),l=function(){function e(){}return e.value=new e,e}(),s={to:function(e){if(e instanceof t.Inl)return u.value;if(e instanceof t.Inr&&e.value0 instanceof t.Inl)return i.value;if(e instanceof t.Inr&&e.value0 instanceof t.Inr&&e.value0.value0 instanceof t.Inl)return c.value;if(e instanceof t.Inr&&e.value0 instanceof t.Inr&&e.value0.value0 instanceof t.Inr)return l.value;throw new Error("Failed pattern match at Ctl.Internal.Types.RedeemerTag (line 25, column 1 - line 25, column 38): "+[e.constructor.name])},from:function(e){if(e instanceof u)return new t.Inl(t.NoArguments.value);if(e instanceof i)return new t.Inr(new t.Inl(t.NoArguments.value));if(e instanceof c)return new t.Inr(new t.Inr(new t.Inl(t.NoArguments.value)));if(e instanceof l)return new t.Inr(new t.Inr(new t.Inr(t.NoArguments.value)));throw new Error("Failed pattern match at Ctl.Internal.Types.RedeemerTag (line 25, column 1 - line 25, column 38): "+[e.constructor.name])}},f={show:a.genericShow(s)(a.genericShowSum(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Spend"}}))(a.genericShowSum(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Mint"}}))(a.genericShowSum(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Cert"}}))(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Reward"}})))))},d={eq:function(e){return function(n){return e instanceof u&&n instanceof u||e instanceof i&&n instanceof i||e instanceof c&&n instanceof c||e instanceof l&&n instanceof l}}},v={compare:function(e){return function(n){if(e instanceof u&&n instanceof u)return o.EQ.value;if(e instanceof u)return o.LT.value;if(n instanceof u)return o.GT.value;if(e instanceof i&&n instanceof i)return o.EQ.value;if(e instanceof i)return o.LT.value;if(n instanceof i)return o.GT.value;if(e instanceof c&&n instanceof c)return o.EQ.value;if(e instanceof c)return o.LT.value;if(n instanceof c)return o.GT.value;if(e instanceof l&&n instanceof l)return o.EQ.value;throw new Error("Failed pattern match at Ctl.Internal.Types.RedeemerTag (line 27, column 1 - line 27, column 32): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return d}};n.Spend=u,n.Mint=i,n.Cert=c,n.Reward=l,n.fromString=function(e){return"spend"===e?new r.Just(u.value):"mint"===e?new r.Just(i.value):"certificate"===e?new r.Just(c.value):"withdrawal"===e?new r.Just(l.value):r.Nothing.value},n.eqRedeemerTag=d,n.ordRedeemerTag=v,n.showRedeemerTag=f}(c),function(e){"use strict";e["Ctl.Internal.Types.RewardAddress"]=e["Ctl.Internal.Types.RewardAddress"]||{};var n=e["Ctl.Internal.Types.RewardAddress"],t=e["Ctl.Internal.Serialization.Address"],r=e["Data.Newtype"],o=t.showRewardAddress,a=t.ordRewardAddress,u=t.eqRewardAddress,i=t.decodeAesonRewardAddress;n.rewardAddressToBech32=function(e){return t.rewardAddressBech32(e)},n.stakePubKeyHashRewardAddress=function(e){return function(n){return t.rewardAddress({network:e,paymentCred:t.keyHashCredential(r.unwrap()(r.unwrap()(n)))})}},n.stakeValidatorHashRewardAddress=function(e){return function(n){return t.rewardAddress({network:e,paymentCred:t.scriptHashCredential(r.unwrap()(n))})}},n.unRewardAddress=function(e){return e},n.eqRewardAddress=u,n.ordRewardAddress=a,n.showRewardAddress=o,n.decodeAesonRewardAddress=i}(c),function(e){"use strict";e["Ctl.Internal.Types.TransactionMetadata"]=e["Ctl.Internal.Types.TransactionMetadata"]||{};var n=e["Ctl.Internal.Types.TransactionMetadata"],t=e["Ctl.Internal.Helpers"],r=e["Ctl.Internal.Types.ByteArray"],o=e["Ctl.Internal.Types.Int"],a=e["Data.BigInt"],u=e["Data.Eq"],i=e["Data.Generic.Rep"],c=e["Data.Map.Internal"],l=e["Data.Ord"],s=e["Data.Ordering"],f=e["Data.Show"],d=e["Data.Show.Generic"],v=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),m=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),p=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),g=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),y=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),w={show:function(e){return t.showWithParens(a.showBigInt)("TransactionMetadatumLabel")(e)}},h=a.ordBigInt,b={append:function(e){return function(n){return t.appendRightMap(h)(e)(n)}}},C={to:function(e){if(e instanceof i.Inl)return new v(e.value0);if(e instanceof i.Inr&&e.value0 instanceof i.Inl)return new m(e.value0.value0);if(e instanceof i.Inr&&e.value0 instanceof i.Inr&&e.value0.value0 instanceof i.Inl)return new p(e.value0.value0.value0);if(e instanceof i.Inr&&e.value0 instanceof i.Inr&&e.value0.value0 instanceof i.Inr&&e.value0.value0.value0 instanceof i.Inl)return new g(e.value0.value0.value0.value0);if(e instanceof i.Inr&&e.value0 instanceof i.Inr&&e.value0.value0 instanceof i.Inr&&e.value0.value0.value0 instanceof i.Inr)return new y(e.value0.value0.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.TransactionMetadata (line 79, column 1 - line 79, column 47): "+[e.constructor.name])},from:function(e){if(e instanceof v)return new i.Inl(e.value0);if(e instanceof m)return new i.Inr(new i.Inl(e.value0));if(e instanceof p)return new i.Inr(new i.Inr(new i.Inl(e.value0)));if(e instanceof g)return new i.Inr(new i.Inr(new i.Inr(new i.Inl(e.value0))));if(e instanceof y)return new i.Inr(new i.Inr(new i.Inr(new i.Inr(e.value0))));throw new Error("Failed pattern match at Ctl.Internal.Types.TransactionMetadata (line 79, column 1 - line 79, column 47): "+[e.constructor.name])}},A={show:function(e){return d.genericShow(C)(d.genericShowSum(d.genericShowConstructor(d.genericShowArgsArgument(c.showMap(A)(A)))({reflectSymbol:function(){return"MetadataMap"}}))(d.genericShowSum(d.genericShowConstructor(d.genericShowArgsArgument(f.showArray(A)))({reflectSymbol:function(){return"MetadataList"}}))(d.genericShowSum(d.genericShowConstructor(d.genericShowArgsArgument(o.showInt))({reflectSymbol:function(){return"Int"}}))(d.genericShowSum(d.genericShowConstructor(d.genericShowArgsArgument(r.showByteArray))({reflectSymbol:function(){return"Bytes"}}))(d.genericShowConstructor(d.genericShowArgsArgument(f.showString))({reflectSymbol:function(){return"Text"}}))))))(e)}},S={show:d.genericShow({to:function(e){return e},from:function(e){return e}})(d.genericShowConstructor(d.genericShowArgsArgument(c.showMap(w)(A)))({reflectSymbol:function(){return"GeneralTransactionMetadata"}}))},I={eq:function(e){return function(n){return e instanceof v&&n instanceof v?u.eq(c.eqMap(I)(I))(e.value0)(n.value0):e instanceof m&&n instanceof m?u.eq(u.eqArray(I))(e.value0)(n.value0):e instanceof p&&n instanceof p?u.eq(o.eqInt)(e.value0)(n.value0):e instanceof g&&n instanceof g?u.eq(r.eqByteArray)(e.value0)(n.value0):e instanceof y&&n instanceof y&&e.value0===n.value0}}},T={compare:function(e){return function(n){if(e instanceof v&&n instanceof v)return l.compare(c.ordMap(T)(T))(e.value0)(n.value0);if(e instanceof v)return s.LT.value;if(n instanceof v)return s.GT.value;if(e instanceof m&&n instanceof m)return l.compare(l.ordArray(T))(e.value0)(n.value0);if(e instanceof m)return s.LT.value;if(n instanceof m)return s.GT.value;if(e instanceof p&&n instanceof p)return l.compare(o.ordInt)(e.value0)(n.value0);if(e instanceof p)return s.LT.value;if(n instanceof p)return s.GT.value;if(e instanceof g&&n instanceof g)return l.compare(r.ordByteArray)(e.value0)(n.value0);if(e instanceof g)return s.LT.value;if(n instanceof g)return s.GT.value;if(e instanceof y&&n instanceof y)return l.compare(l.ordString)(e.value0)(n.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.TransactionMetadata (line 78, column 1 - line 78, column 41): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return I}};n.MetadataMap=v,n.MetadataList=m,n.Int=p,n.Bytes=g,n.Text=y,n.TransactionMetadatumLabel=function(e){return e},n.showGeneralTransactionMet=S,n.semigroupGeneralTransacti=b,n.ordTransactionMetadatumLa=h,n.ordTransactionMetadatum=T}(c),function(e){"use strict";e["Ctl.Internal.Types.VRFKeyHash"]=e["Ctl.Internal.Types.VRFKeyHash"]||{};var n=e["Ctl.Internal.Types.VRFKeyHash"],t=e["Ctl.Internal.Serialization.ToBytes"],r=e["Ctl.Internal.Types.ByteArray"],o=e["Data.Eq"],a=e["Data.Function"],u=e["Data.Newtype"],i=e["Data.Show"],c={show:function(e){return"(VRFKeyHash "+i.show(i.showString)(r.byteArrayToHex(u.unwrap()(t.toBytes()(e))))+")"}},l={eq:a.on(o.eq(r.eqByteArray))((function(e){return u.unwrap()(t.toBytes()(e))}))};n.VRFKeyHash=function(e){return e},n.unVRFKeyHash=function(e){return e},n.showVRFKeyHash=c,n.eqVRFKeyHash=l}(c),function(e){"use strict";e["Data.Profunctor"]=e["Data.Profunctor"]||{};var n=e["Data.Profunctor"];n.dimap=function(e){return e.dimap},n.profunctorFn={dimap:function(e){return function(n){return function(t){return function(r){return n(t(e(r)))}}}}}}(c),function(e){"use strict";e["Data.Lens.Iso"]=e["Data.Lens.Iso"]||{};var n=e["Data.Lens.Iso"],t=e["Data.Boolean"],r=e["Data.Eq"],o=e["Data.Maybe"],a=e["Data.Profunctor"],u=function(e){return function(n){return function(t){return function(r){return a.dimap(t)(e)(n)(r)}}}};n.iso=u,n.non=function(e){return function(n){return function(a){return u(o.fromMaybe(n))((function(a){if(r.eq(e)(a)(n))return o.Nothing.value;if(t.otherwise)return new o.Just(a);throw new Error("Failed pattern match at Data.Lens.Iso (line 45, column 9 - line 46, column 33): "+[a.constructor.name])}))(a)}}}}(c),function(e){"use strict";e["Data.Lens.Iso.Newtype"]=e["Data.Lens.Iso.Newtype"]||{};var n=e["Data.Lens.Iso.Newtype"],t=e["Data.Lens.Iso"],r=e["Data.Newtype"];n._Newtype=function(){return function(){return function(e){return t.iso(r.unwrap())(r.wrap())(e)}}}}(c),function(e){"use strict";e["Data.Profunctor.Strong"]=e["Data.Profunctor.Strong"]||{};var n=e["Data.Profunctor.Strong"],t=e["Data.Functor"],r=e["Data.Profunctor"],o=e["Data.Tuple"],a={first:function(e){return function(n){return new o.Tuple(e(n.value0),n.value1)}},second:t.map(o.functorTuple),Profunctor0:function(){return r.profunctorFn}};n.first=function(e){return e.first},n.strongFn=a}(c),function(e){"use strict";e["Data.Lens.Lens"]=e["Data.Lens.Lens"]||{};var n=e["Data.Lens.Lens"],t=e["Data.Profunctor"],r=e["Data.Profunctor.Strong"],o=e["Data.Tuple"],a=function(e){return function(n){return function(o){return t.dimap(n.Profunctor0())(e)((function(e){return e.value1(e.value0)}))(r.first(n)(o))}}};n.lens=function(e){return function(n){return function(t){return a((function(t){return new o.Tuple(e(t),(function(e){return n(t)(e)}))}))(t)}}},n["lens'"]=a}(c),function(e){"use strict";e["Data.Lens.Record"]=e["Data.Lens.Record"]||{};var n=e["Data.Lens.Record"],t=e["Data.Function"],r=e["Data.Lens.Lens"],o=e.Record;n.prop=function(e){return function(){return function(){return function(n){return function(a){return r.lens(o.get(e)()(n))(t.flip(o.set(e)()()(n)))(a)}}}}}}(c),function(e){"use strict";e["Data.Set"]=e["Data.Set"]||{};var n=e["Data.Set"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Rec.Class"],a=e["Control.Monad.ST.Internal"],u=e["Data.Array"],i=e["Data.Array.ST"],c=e["Data.Eq"],l=e["Data.Foldable"],s=e["Data.Function"],f=e["Data.List"],d=e["Data.List.Types"],v=e["Data.Map.Internal"],m=e["Data.Maybe"],p=e["Data.Ord"],g=e["Data.Ordering"],y=e["Data.Show"],w=e["Data.Unfoldable"],h=e["Data.Unit"],b=function(e){return function(n){return function(t){return v.union(e)(n)(t)}}},C=function(e){return v.keys(e)},A=function(e){var n=f.toUnfoldable(e);return function(e){return n(C(e))}},S=function(e){return{append:b(e)}},I=function(e){return function(n){return function(t){return v.insert(e)(n)(h.unit)(t)}}},T={foldMap:function(e){return function(n){var t=l.foldMap(d.foldableList)(e)(n);return function(e){return t(C(e))}}},foldl:function(e){return function(n){var t=l.foldl(d.foldableList)(e)(n);return function(e){return t(C(e))}}},foldr:function(e){return function(n){var t=l.foldr(d.foldableList)(e)(n);return function(e){return t(C(e))}}}},D=v.empty,F=function(e){return function(n){return l.foldl(e)((function(e){return function(t){return I(n)(t)(e)}}))(D)}};n.fromFoldable=F,n.toUnfoldable=A,n.empty=D,n.isEmpty=function(e){return v.isEmpty(e)},n.singleton=function(e){return v.singleton(e)(h.unit)},n.insert=I,n.member=function(e){return function(n){return function(t){return v.member(e)(n)(t)}}},n.size=function(e){return v.size(e)},n.union=b,n.difference=function(e){return function(n){return function(t){return l.foldl(d.foldableList)(s.flip(function(e){return function(n){return function(t){return v.delete(e)(n)(t)}}}(e)))(n)(C(t))}}},n.intersection=function(e){return function(n){return function(c){var s,f=(s=u.fromFoldable(d.foldableList),function(e){return s(C(e))}),v=f(c),m=u.length(v),y=f(n),w=u.length(y);return F(l.foldableArray)(e)(r.bind(a.bindST)(r.bind(a.bindST)(i.new)((function(n){return o.tailRecM2(a.monadRecST)((function(r){return function(u){if(r()=>n(e)}(c["Ctl.Internal.QueryM.UniqueId"]=c["Ctl.Internal.QueryM.UniqueId"]||{}),function(e){"use strict";e["Ctl.Internal.QueryM.UniqueId"]=e["Ctl.Internal.QueryM.UniqueId"]||{};var n=e["Ctl.Internal.QueryM.UniqueId"],t=e["Ctl.Internal.QueryM.UniqueId"];n.uniqueId=t.uniqueId}(c),function(e){"use strict";e["Ctl.Internal.QueryM.JsonWsp"]=e["Ctl.Internal.QueryM.JsonWsp"]||{};var n=e["Ctl.Internal.QueryM.JsonWsp"],t=e.Aeson,r=e["Ctl.Internal.QueryM.UniqueId"],o=e["Data.Argonaut.Decode.Error"],a=e["Data.Either"],u=e["Data.Function"],i=e.Record,c=t.caseAesonObject(new a.Left(new o.TypeMismatch("expected object")))(u.flip(t.getField(t.decodeAesonString))("reflection"));n.mkCallType=function(e){return function(n){return function(o){return function(a){return function(){var u=function(e){return function(n){return function(){var t=r.uniqueId(n.methodname+"-")();return i.merge()()({mirror:t})(i.merge()()(e)(n))}}}(n)({methodname:o.methodname,args:o.args(a)})();return{body:t.encodeAeson(e)(u),id:u.mirror}}}}}},n.buildRequest=function(e){return e},n.parseJsonWspResponseId=c}(c),function(e){"use strict";e["Ctl.Internal.QueryM.Dispatcher"]=e["Ctl.Internal.QueryM.Dispatcher"]||{};var n=e["Ctl.Internal.QueryM.Dispatcher"],t=e.Aeson,r=e["Control.Applicative"],o=e["Ctl.Internal.QueryM.JsonWsp"],a=e["Data.Argonaut.Decode.Error"],u=e["Data.Either"],i=e["Data.Map.Internal"],c=e["Data.Maybe"],l=e["Data.Ord"],s=e["Data.Show"],f=e.Effect,d=e["Effect.Exception"],v=e["Effect.Ref"],m=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),p=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),g=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),y=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),w={show:function(e){if(e instanceof m)return"(JsError (message "+s.show(s.showString)(d.message(e.value0))+"))";if(e instanceof p)return"(JsonError "+s.show(a.showJsonDecodeError)(e.value0)+")";if(e instanceof g)return"(FaultError "+s.show(t.showAeson)(e.value0)+")";if(e instanceof y)return"(ListenerCancelled "+s.show(s.showString)(e.value0)+")";throw new Error("Failed pattern match at Ctl.Internal.QueryM.Dispatcher (line 40, column 1 - line 45, column 52): "+[e.constructor.name])}},h=v.new(i.empty),b=v.new(i.empty);n.JsonError=p,n.FaultError=g,n.ListenerCancelled=y,n.dispatchErrorToError=function(e){if(e instanceof m)return e.value0;if(e instanceof p)return d.error(s.show(a.showJsonDecodeError)(e.value0));if(e instanceof g)return d.error("Server responded with `fault`: "+t.stringifyAeson(e.value0));if(e instanceof y)return d.error("Listener cancelled ("+e.value0+")");throw new Error("Failed pattern match at Ctl.Internal.QueryM.Dispatcher (line 47, column 1 - line 47, column 47): "+[e.constructor.name])},n.mkWebsocketDispatch=function(e){return function(n){var t=o.parseJsonWspResponseId(n);if(t instanceof u.Left)return r.pure(f.applicativeEffect)(new u.Left(new p(t.value0)));if(t instanceof u.Right)return function(){var r=v.read(e)(),o=i.lookup(l.ordString)(t.value0)(r);if(o instanceof c.Nothing)return new u.Left(new y(t.value0));if(o instanceof c.Just)return new u.Right(o.value0(n));throw new Error("Failed pattern match at Ctl.Internal.QueryM.Dispatcher (line 76, column 7 - line 78, column 51): "+[o.constructor.name])};throw new Error("Failed pattern match at Ctl.Internal.QueryM.Dispatcher (line 67, column 3 - line 78, column 51): "+[t.constructor.name])}},n.newDispatcher=b,n.newPendingRequests=h,n.showDispatchError=w}(c),function(e){"use strict";e["Ctl.Internal.Service.Helpers"]=e["Ctl.Internal.Service.Helpers"]||{};var n=e["Ctl.Internal.Service.Helpers"],t=e.Aeson,r=e["Control.Apply"],o=e["Control.Bind"],a=e["Ctl.Internal.Cardano.Types.Value"],u=e["Ctl.Internal.Types.ByteArray"],i=e["Ctl.Internal.Types.TokenName"],c=e["Data.Argonaut.Decode.Error"],l=e["Data.Either"],s=e["Data.Maybe"],f=e["Data.Tuple"],d=t.caseAesonString(new l.Left(new c.TypeMismatch("String"))),v=t.caseAesonObject(new l.Left(new c.TypeMismatch("Object"))),m=t.caseAesonArray(new l.Left(new c.TypeMismatch("Array")));n.aesonArray=m,n.aesonString=d,n.aesonObject=v,n.decodeAssetClass=function(e){return function(n){return function(t){var d=function(n){return function(t){return new c.TypeMismatch("In "+e+": Expected hex-encoded "+n+", got: "+t)}};return r.lift2(l.applyEither)(f.Tuple.create)(l.note(d("CurrencySymbol")(n))(o.bindFlipped(s.bindMaybe)(a.mkCurrencySymbol)(u.hexToByteArray(n))))(l.note(d("TokenName")(t))(o.bindFlipped(s.bindMaybe)(i.mkTokenName)(u.hexToByteArray(t))))}}}}(c),function(e){"use strict";e["Ctl.Internal.Types.Epoch"]=e["Ctl.Internal.Types.Epoch"]||{};var n=e["Ctl.Internal.Types.Epoch"],t=e.Aeson.decodeAesonBigInt;n.decodeAesonEpoch=t}(c),function(e){"use strict";e["Ctl.Internal.Types.EraSummaries"]=e["Ctl.Internal.Types.EraSummaries"]||{};var n=e["Ctl.Internal.Types.EraSummaries"],t=e.Aeson,r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Serialization.Address"],u=e["Ctl.Internal.Service.Helpers"],i=e["Ctl.Internal.Types.Epoch"],c=e["Data.BigInt"],l=e["Data.Either"],s=e["Data.Newtype"],f=c.semiringBigInt,d=t.decodeAesonBigInt,v=t.decodeAesonNumber,m={decodeAeson:u.aesonObject((function(e){return o.bind(l.bindEither)(t.getField(v)(e)("time"))((function(n){return o.bind(l.bindEither)(t.getField(a.decodeAesonSlot)(e)("slot"))((function(a){return o.bind(l.bindEither)(t.getField(i.decodeAesonEpoch)(e)("epoch"))((function(e){return r.pure(l.applicativeEither)(s.wrap()({time:n,slot:a,epoch:e}))}))}))}))}))},p=t.decodeAesonBigInt;n.decodeAesonEraSummaryTime=m,n.decodeAesonEpochLength=p,n.semiringSafeZone=f,n.decodeAesonSafeZone=d}(c),function(e){"use strict";e["Ctl.Internal.Types.Natural"]=e["Ctl.Internal.Types.Natural"]||{};var n=e["Ctl.Internal.Types.Natural"],t=e.Aeson,r=e["Control.Bind"],o=e["Control.Category"],a=e["Data.Argonaut.Decode.Error"],u=e["Data.BigInt"],i=e["Data.Boolean"],c=e["Data.Either"],l=e["Data.Function"],s=e["Data.Maybe"],f=e["Data.Ord"],d=e["Data.Ring"],v=e["Data.Semiring"],m=e["Data.Show"],p={show:function(e){return"(fromBigInt' (BigInt."+m.show(u.showBigInt)(e)+"))"}},g=u.semiringBigInt,y=u.ordBigInt,w=u.eqBigInt,h=function(e){return e},b=function(e){return function(n){return function(t){return function(r){if(f.greaterThanOrEq(n)(r)(v.zero(e)))return t(r);if(i.otherwise)return d.negate(u.ringBigInt)(t(r));throw new Error("Failed pattern match at Ctl.Internal.Types.Natural (line 67, column 1 - line 68, column 78): "+[t.constructor.name,r.constructor.name])}}}},C=function(e){return function(n){return function(t){return function(r){if(f.greaterThanOrEq(n)(r)(v.zero(e)))return new s.Just(t(r));if(i.otherwise)return s.Nothing.value;throw new Error("Failed pattern match at Ctl.Internal.Types.Natural (line 59, column 1 - line 60, column 79): "+[t.constructor.name,r.constructor.name])}}}},A=b(v.semiringInt)(f.ordInt)(u.fromInt),S=(C(v.semiringInt)(f.ordInt)(u.fromInt),b(u.semiringBigInt)(u.ordBigInt)(o.identity(o.categoryFn))),I=C(u.semiringBigInt)(u.ordBigInt)(o.identity(o.categoryFn)),T=r.composeKleisliFlipped(s.bindMaybe)(I)(u.fromString),D={decodeAeson:t.caseAesonBigInt(new c.Left(new a.TypeMismatch("Expected BigInt from Aeson decoding")))((function(e){return c.note(new a.TypeMismatch("Invalid Natural number: "+m.show(u.showBigInt)(e)))(I(e))}))};n["fromBigInt'"]=S,n["fromInt'"]=A,n.fromString=T,n.minus=function(e){var n,t=s.fromMaybe(v.zero(g)),r=(n=d.sub(u.ringBigInt),function(e){var t=l.on(n)(h)(e);return function(e){return I(t(e))}})(e);return function(e){return t(r(e))}},n.toBigInt=h,n.eqNatural=w,n.ordNatural=y,n.semiringNatural=g,n.showNatural=p,n.decodeAesonNatural=D}(c),function(e){"use strict";e["Heterogeneous.Folding"]=e["Heterogeneous.Folding"]||{};var n=e["Heterogeneous.Folding"],t=e.Record,r=e["Type.Proxy"],o=function(e){return e.foldlRecordRowList};n.hfoldl=function(e){return e.hfoldl},n.functionFolding={folding:function(e){return e}},n.constFolding=function(e){return{foldingWithIndex:function(n){return function(t){return e.folding(n)}}}},n.hfoldlRecord=function(){return function(e){return{hfoldl:function(n){return function(t){return o(e)(n)(t)(r.Proxy.value)}}}}},n.foldlRecordCons=function(e){return function(){return function(n){return function(a){return{foldlRecordRowList:function(u){return function(i){return function(c){return function(c){return o(a)(u)(n.foldingWithIndex(u)(r.Proxy.value)(i)(t.get(e)()(r.Proxy.value)(c)))(r.Proxy.value)(c)}}}}}}}}},n.foldlRecordNil={foldlRecordRowList:function(e){return function(e){return function(n){return function(n){return e}}}}}}(c),function(e){"use strict";e["Ctl.Internal.Types.ProtocolParameters"]=e["Ctl.Internal.Types.ProtocolParameters"]||{};var n=e["Ctl.Internal.Types.ProtocolParameters"],t=e["Data.Array"],r=e["Data.List"],o=e["Data.List.Types"],a=e["Data.Monoid"],u=e["Data.Newtype"],i=e["Data.Unfoldable"],c=e["Heterogeneous.Folding"],l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f=function(e){return function(n){return u.wrap()(t.reverse(r.toUnfoldable(i.unfoldableArray)(c.hfoldl(e)((function(e){return function(n){return new o.Cons(n,e)}}))(a.mempty(o.monoidList))(n))))}},d=f(c.hfoldlRecord()(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"bData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"bData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"blake2b_256-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"blake2b_256-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"blake2b_256-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekApplyCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekApplyCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekBuiltinCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekBuiltinCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekConstCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekConstCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekDelayCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekDelayCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekForceCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekForceCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekLamCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekLamCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekStartupCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekStartupCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekVarCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekVarCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseUnit-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseUnit-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"constrData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"constrData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsData-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsData-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsInteger-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"fstPair-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"fstPair-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"headList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"headList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"iData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"iData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"ifThenElse-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"ifThenElse-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"indexByteString-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"indexByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lengthOfByteString-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lengthOfByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsInteger-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanInteger-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"listData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"listData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mapData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mapData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkCons-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkCons-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilPairData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilPairData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkPairData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkPairData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"nullList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"nullList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha2_256-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha2_256-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha2_256-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha3_256-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha3_256-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha3_256-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sndPair-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sndPair-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"tailList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"tailList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"trace-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"trace-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unBData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unBData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unConstrData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unConstrData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unIData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unIData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unListData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unListData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unMapData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unMapData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEd25519Signature-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordNil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))),v=f(c.hfoldlRecord()(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"bData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"bData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"blake2b_256-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"blake2b_256-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"blake2b_256-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekApplyCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekApplyCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekBuiltinCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekBuiltinCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekConstCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekConstCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekDelayCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekDelayCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekForceCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekForceCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekLamCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekLamCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekStartupCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekStartupCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekVarCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekVarCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseUnit-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseUnit-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"constrData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"constrData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsData-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsData-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsInteger-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"fstPair-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"fstPair-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"headList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"headList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"iData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"iData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"ifThenElse-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"ifThenElse-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"indexByteString-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"indexByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lengthOfByteString-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lengthOfByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsInteger-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanInteger-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"listData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"listData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mapData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mapData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkCons-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkCons-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilPairData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilPairData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkPairData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkPairData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"nullList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"nullList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"serialiseData-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"serialiseData-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"serialiseData-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"serialiseData-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha2_256-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha2_256-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha2_256-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha3_256-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha3_256-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha3_256-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sndPair-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sndPair-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"tailList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"tailList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"trace-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"trace-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unBData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unBData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unConstrData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unConstrData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unIData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unIData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unListData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unListData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unMapData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unMapData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEcdsaSecp256k1Signature-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEcdsaSecp256k1Signature-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEd25519Signature-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordNil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))));n.CoinsPerUtxoByte=l,n.CoinsPerUtxoWord=s,n.convertPlutusV1CostModel=d,n.convertPlutusV2CostModel=v}(c),function(e){"use strict";e["Data.Ratio"]=e["Data.Ratio"]||{};var n=e["Data.Ratio"],t=e["Data.EuclideanRing"],r=e["Data.Ord"],o=e["Data.Semiring"],a=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),u=function(e){return function(n){return function(u){return function(i){var c=t.gcd(e.Eq0())(n)(u)(i),l=t.div(n)(i)(c);return new a(o.mul(n.CommutativeRing0().Ring0().Semiring0())(t.div(n)(u)(c))(r.signum(e)(n.CommutativeRing0().Ring0())(l)),r.abs(e)(n.CommutativeRing0().Ring0())(l))}}}};n.reduce=u,n.numerator=function(e){return e.value0},n.denominator=function(e){return e.value1},n.semiringRatio=function(e){return function(n){return{one:new a(o.one(n.CommutativeRing0().Ring0().Semiring0()),o.one(n.CommutativeRing0().Ring0().Semiring0())),mul:function(t){return function(r){return u(e)(n)(o.mul(n.CommutativeRing0().Ring0().Semiring0())(t.value0)(r.value0))(o.mul(n.CommutativeRing0().Ring0().Semiring0())(t.value1)(r.value1))}},zero:new a(o.zero(n.CommutativeRing0().Ring0().Semiring0()),o.one(n.CommutativeRing0().Ring0().Semiring0())),add:function(t){return function(r){return u(e)(n)(o.add(n.CommutativeRing0().Ring0().Semiring0())(o.mul(n.CommutativeRing0().Ring0().Semiring0())(t.value0)(r.value1))(o.mul(n.CommutativeRing0().Ring0().Semiring0())(t.value1)(r.value0)))(o.mul(n.CommutativeRing0().Ring0().Semiring0())(t.value1)(r.value1))}}}}}}(c),function(e){"use strict";e["Ctl.Internal.Types.Rational"]=e["Ctl.Internal.Types.Rational"]||{};var n=e["Ctl.Internal.Types.Rational"],t=e["Data.BigInt"],r=e["Data.Boolean"],o=e["Data.Eq"],a=e["Data.Maybe"],u=e["Data.Ratio"],i=e["Data.Semiring"],c=u.semiringRatio(t.ordBigInt)(t.euclideanRingBigInt),l={reduce:function(e){return function(n){if(o.eq(t.eqBigInt)(n)(i.zero(t.semiringBigInt)))return a.Nothing.value;if(r.otherwise)return new a.Just(u.reduce(t.ordBigInt)(t.euclideanRingBigInt)(e)(n));throw new Error("Failed pattern match at Ctl.Internal.Types.Rational (line 128, column 1 - line 131, column 48): "+[e.constructor.name,n.constructor.name])}}};n.reduce=function(e){return e.reduce},n.numerator=function(e){return u.numerator(e)},n.denominator=function(e){return u.denominator(e)},n.semiringRational=c,n.rationalComponentBigInt=l}(c),function(e){"use strict";e.fromDateTimeImpl=function(e,n,t,r,o,a,u){return function(e,n,t,r,o,a,u){var i=new Date(Date.UTC(e,n,t,r,o,a,u));return e>=0&&e<100&&i.setUTCFullYear(e),i}(e,n-1,t,r,o,a,u).getTime()},e.toDateTimeImpl=function(e){return function(n){var t=new Date(n);return e(t.getUTCFullYear())(t.getUTCMonth()+1)(t.getUTCDate())(t.getUTCHours())(t.getUTCMinutes())(t.getUTCSeconds())(t.getUTCMilliseconds())}}}(c["Data.DateTime.Instant"]=c["Data.DateTime.Instant"]||{}),function(e){"use strict";e.canonicalDateImpl=function(e,n,t,r){var o=function(e,n,t){var r=new Date(Date.UTC(e,n,t));return e>=0&&e<100&&r.setUTCFullYear(e),r}(n,t-1,r);return e(o.getUTCFullYear())(o.getUTCMonth()+1)(o.getUTCDate())}}(c["Data.Date"]=c["Data.Date"]||{}),function(e){"use strict";e["Data.Date.Component"]=e["Data.Date.Component"]||{};var n,t,r,o,a,u,i,c,l,s,f,d,v,m,p,g,y=e["Data.Date.Component"],w=e["Data.Boolean"],h=e["Data.Enum"],b=e["Data.Maybe"],C=e["Data.Ord"],A=e["Data.Ordering"],S=function(){function e(){}return e.value=new e,e}(),I=function(){function e(){}return e.value=new e,e}(),T=function(){function e(){}return e.value=new e,e}(),D=function(){function e(){}return e.value=new e,e}(),F=function(){function e(){}return e.value=new e,e}(),E=function(){function e(){}return e.value=new e,e}(),x=function(){function e(){}return e.value=new e,e}(),M=function(){function e(){}return e.value=new e,e}(),R=function(){function e(){}return e.value=new e,e}(),P=function(){function e(){}return e.value=new e,e}(),B=function(){function e(){}return e.value=new e,e}(),k=function(){function e(){}return e.value=new e,e}(),N=function(){function e(){}return e.value=new e,e}(),L=function(){function e(){}return e.value=new e,e}(),_=function(){function e(){}return e.value=new e,e}(),U=function(){function e(){}return e.value=new e,e}(),H=function(){function e(){}return e.value=new e,e}(),q=function(){function e(){}return e.value=new e,e}(),O=function(){function e(){}return e.value=new e,e}(),W=C.ordInt,V=C.ordInt,K={eq:function(e){return function(n){return e instanceof S&&n instanceof S||e instanceof I&&n instanceof I||e instanceof T&&n instanceof T||e instanceof D&&n instanceof D||e instanceof F&&n instanceof F||e instanceof E&&n instanceof E||e instanceof x&&n instanceof x}}},z={compare:function(e){return function(n){if(e instanceof S&&n instanceof S)return A.EQ.value;if(e instanceof S)return A.LT.value;if(n instanceof S)return A.GT.value;if(e instanceof I&&n instanceof I)return A.EQ.value;if(e instanceof I)return A.LT.value;if(n instanceof I)return A.GT.value;if(e instanceof T&&n instanceof T)return A.EQ.value;if(e instanceof T)return A.LT.value;if(n instanceof T)return A.GT.value;if(e instanceof D&&n instanceof D)return A.EQ.value;if(e instanceof D)return A.LT.value;if(n instanceof D)return A.GT.value;if(e instanceof F&&n instanceof F)return A.EQ.value;if(e instanceof F)return A.LT.value;if(n instanceof F)return A.GT.value;if(e instanceof E&&n instanceof E)return A.EQ.value;if(e instanceof E)return A.LT.value;if(n instanceof E)return A.GT.value;if(e instanceof x&&n instanceof x)return A.EQ.value;throw new Error("Failed pattern match at Data.Date.Component (line 154, column 1 - line 154, column 42): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return K}},J={eq:function(e){return function(n){return e instanceof M&&n instanceof M||e instanceof R&&n instanceof R||e instanceof P&&n instanceof P||e instanceof B&&n instanceof B||e instanceof k&&n instanceof k||e instanceof N&&n instanceof N||e instanceof L&&n instanceof L||e instanceof _&&n instanceof _||e instanceof U&&n instanceof U||e instanceof H&&n instanceof H||e instanceof q&&n instanceof q||e instanceof O&&n instanceof O}}},j={compare:function(e){return function(n){if(e instanceof M&&n instanceof M)return A.EQ.value;if(e instanceof M)return A.LT.value;if(n instanceof M)return A.GT.value;if(e instanceof R&&n instanceof R)return A.EQ.value;if(e instanceof R)return A.LT.value;if(n instanceof R)return A.GT.value;if(e instanceof P&&n instanceof P)return A.EQ.value;if(e instanceof P)return A.LT.value;if(n instanceof P)return A.GT.value;if(e instanceof B&&n instanceof B)return A.EQ.value;if(e instanceof B)return A.LT.value;if(n instanceof B)return A.GT.value;if(e instanceof k&&n instanceof k)return A.EQ.value;if(e instanceof k)return A.LT.value;if(n instanceof k)return A.GT.value;if(e instanceof N&&n instanceof N)return A.EQ.value;if(e instanceof N)return A.LT.value;if(n instanceof N)return A.GT.value;if(e instanceof L&&n instanceof L)return A.EQ.value;if(e instanceof L)return A.LT.value;if(n instanceof L)return A.GT.value;if(e instanceof _&&n instanceof _)return A.EQ.value;if(e instanceof _)return A.LT.value;if(n instanceof _)return A.GT.value;if(e instanceof U&&n instanceof U)return A.EQ.value;if(e instanceof U)return A.LT.value;if(n instanceof U)return A.GT.value;if(e instanceof H&&n instanceof H)return A.EQ.value;if(e instanceof H)return A.LT.value;if(n instanceof H)return A.GT.value;if(e instanceof q&&n instanceof q)return A.EQ.value;if(e instanceof q)return A.LT.value;if(n instanceof q)return A.GT.value;if(e instanceof O&&n instanceof O)return A.EQ.value;throw new Error("Failed pattern match at Data.Date.Component (line 61, column 1 - line 61, column 38): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return J}},Q={bottom:-271820,top:275759,Ord0:function(){return W}},G={bottom:S.value,top:x.value,Ord0:function(){return z}},Z={bottom:M.value,top:O.value,Ord0:function(){return j}},X={cardinality:547580,toEnum:function(e){if(e>=-271820&&e<=275759)return new b.Just(e);if(w.otherwise)return b.Nothing.value;throw new Error("Failed pattern match at Data.Date.Component (line 35, column 1 - line 40, column 24): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return Q},Enum1:function(){return Y}},Y={succ:(r=h.toEnum(X),o=h.fromEnum(X),function(e){return r(o(e)+1|0)}),pred:(n=h.toEnum(X),t=h.fromEnum(X),function(e){return n(t(e)-1|0)}),Ord0:function(){return W}},$={cardinality:7,toEnum:function(e){return 1===e?new b.Just(S.value):2===e?new b.Just(I.value):3===e?new b.Just(T.value):4===e?new b.Just(D.value):5===e?new b.Just(F.value):6===e?new b.Just(E.value):7===e?new b.Just(x.value):b.Nothing.value},fromEnum:function(e){if(e instanceof S)return 1;if(e instanceof I)return 2;if(e instanceof T)return 3;if(e instanceof D)return 4;if(e instanceof F)return 5;if(e instanceof E)return 6;if(e instanceof x)return 7;throw new Error("Failed pattern match at Data.Date.Component (line 175, column 14 - line 182, column 16): "+[e.constructor.name])},Bounded0:function(){return G},Enum1:function(){return ee}},ee={succ:(i=h.toEnum($),c=h.fromEnum($),function(e){return i(c(e)+1|0)}),pred:(a=h.toEnum($),u=h.fromEnum($),function(e){return a(u(e)-1|0)}),Ord0:function(){return z}},ne={cardinality:12,toEnum:function(e){return 1===e?new b.Just(M.value):2===e?new b.Just(R.value):3===e?new b.Just(P.value):4===e?new b.Just(B.value):5===e?new b.Just(k.value):6===e?new b.Just(N.value):7===e?new b.Just(L.value):8===e?new b.Just(_.value):9===e?new b.Just(U.value):10===e?new b.Just(H.value):11===e?new b.Just(q.value):12===e?new b.Just(O.value):b.Nothing.value},fromEnum:function(e){if(e instanceof M)return 1;if(e instanceof R)return 2;if(e instanceof P)return 3;if(e instanceof B)return 4;if(e instanceof k)return 5;if(e instanceof N)return 6;if(e instanceof L)return 7;if(e instanceof _)return 8;if(e instanceof U)return 9;if(e instanceof H)return 10;if(e instanceof q)return 11;if(e instanceof O)return 12;throw new Error("Failed pattern match at Data.Date.Component (line 87, column 14 - line 99, column 19): "+[e.constructor.name])},Bounded0:function(){return Z},Enum1:function(){return te}},te={succ:(f=h.toEnum(ne),d=h.fromEnum(ne),function(e){return f(d(e)+1|0)}),pred:(l=h.toEnum(ne),s=h.fromEnum(ne),function(e){return l(s(e)-1|0)}),Ord0:function(){return j}},re={bottom:1,top:31,Ord0:function(){return V}},oe={cardinality:31,toEnum:function(e){if(e>=1&&e<=31)return new b.Just(e);if(w.otherwise)return b.Nothing.value;throw new Error("Failed pattern match at Data.Date.Component (line 133, column 1 - line 138, column 23): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return re},Enum1:function(){return ae}},ae={succ:(p=h.toEnum(oe),g=h.fromEnum(oe),function(e){return p(g(e)+1|0)}),pred:(v=h.toEnum(oe),m=h.fromEnum(oe),function(e){return v(m(e)-1|0)}),Ord0:function(){return V}};y.January=M,y.February=R,y.March=P,y.April=B,y.May=k,y.June=N,y.July=L,y.August=_,y.September=U,y.October=H,y.November=q,y.December=O,y.Monday=S,y.Tuesday=I,y.Wednesday=T,y.Thursday=D,y.Friday=F,y.Saturday=E,y.Sunday=x,y.boundedEnumYear=X,y.boundedEnumMonth=ne,y.boundedEnumDay=oe,y.boundedEnumWeekday=$}(c),function(e){"use strict";e["Data.Date"]=e["Data.Date"]||{};var n=e["Data.Date"],t=e["Data.Date"],r=e["Data.Date.Component"],o=e["Data.Enum"],a=e["Data.Maybe"],u=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}();n.canonicalDate=function(e){return function(n){return function(i){return t.canonicalDateImpl((function(e){return function(n){return function(t){return new u(e,a.fromJust()(o.toEnum(r.boundedEnumMonth)(n)),t)}}}),e,o.fromEnum(r.boundedEnumMonth)(n),i)}}},n.year=function(e){return e.value0},n.month=function(e){return e.value1},n.day=function(e){return e.value2}}(c),function(e){"use strict";e["Data.DateTime"]=e["Data.DateTime"]||{};var n=e["Data.DateTime"],t=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}();n.DateTime=t}(c),function(e){"use strict";e["Data.Time"]=e["Data.Time"]||{};var n=e["Data.Time"],t=function(){function e(e,n,t,r){this.value0=e,this.value1=n,this.value2=t,this.value3=r}return e.create=function(n){return function(t){return function(r){return function(o){return new e(n,t,r,o)}}}},e}();n.Time=t,n.hour=function(e){return e.value0},n.minute=function(e){return e.value1},n.second=function(e){return e.value2},n.millisecond=function(e){return e.value3}}(c),function(e){"use strict";e["Data.DateTime.Instant"]=e["Data.DateTime.Instant"]||{};var n=e["Data.DateTime.Instant"],t=e["Data.DateTime.Instant"],r=e["Data.Boolean"],o=e["Data.Date"],a=e["Data.Date.Component"],u=e["Data.DateTime"],i=e["Data.Enum"],c=e["Data.Maybe"],l=e["Data.Time"],s=t.toDateTimeImpl((function(e){return function(n){return function(t){return function(r){return function(s){return function(f){return function(d){return new u.DateTime(o.canonicalDate(e)(c.fromJust()(i.toEnum(a.boundedEnumMonth)(n)))(t),new l.Time(r,s,f,d))}}}}}}}));n.instant=function(e){if(e>=-86399778816e5&&e<=8639977881599999)return new c.Just(e);if(r.otherwise)return c.Nothing.value;throw new Error("Failed pattern match at Data.DateTime.Instant (line 44, column 1 - line 44, column 41): "+[e.constructor.name])},n.unInstant=function(e){return e},n.fromDateTime=function(e){return t.fromDateTimeImpl(o.year(e.value0),i.fromEnum(a.boundedEnumMonth)(o.month(e.value0)),o.day(e.value0),l.hour(e.value1),l.minute(e.value1),l.second(e.value1),l.millisecond(e.value1))},n.toDateTime=s}(c),function(e){"use strict";e["Control.Monad.State"]=e["Control.Monad.State"]||{};var n=e["Control.Monad.State"],t=e["Data.Newtype"];n.runState=function(e){var n=t.unwrap();return function(t){return n(e(t))}}}(c),function(e){"use strict";e["Data.Formatter.Internal"]=e["Data.Formatter.Internal"]||{};var n=e["Data.Formatter.Internal"],t=e["Data.Foldable"];n.foldDigits=function(e){return t.foldl(e)((function(e){return function(n){return(10*e|0)+n|0}}))(0)}}(c),function(e){"use strict";e["Text.Parsing.Parser.Pos"]=e["Text.Parsing.Parser.Pos"]||{},e["Text.Parsing.Parser.Pos"].initialPos={line:1,column:1}}(c),function(e){"use strict";e["Text.Parsing.Parser"]=e["Text.Parsing.Parser"]||{};var n,t=e["Text.Parsing.Parser"],r=e["Control.Applicative"],o=e["Control.Apply"],a=e["Control.Bind"],u=e["Control.Lazy"],i=e["Control.Monad.Error.Class"],c=e["Control.Monad.Except.Trans"],l=e["Control.Monad.State.Class"],s=e["Control.Monad.State.Trans"],f=e["Control.Monad.Trans.Class"],d=e["Data.Either"],v=e["Data.Identity"],m=e["Data.Monoid"],p=e["Data.Newtype"],g=e["Data.Semigroup"],y=e["Data.Tuple"],w=e["Text.Parsing.Parser.Pos"],h=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),b=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),C=function(e){return e},A={lift:function(e){var n=f.lift(c.monadTransExceptT)(s.monadStateT(e)),t=f.lift(s.monadTransStateT)(e);return function(e){return n(t(e))}}},S=function(e){return c.monadStateExceptT(s.monadStateStateT(e))},I=(n=p.over()()(C),function(e){return n(c.mapExceptT(s.mapStateT(e)))}),T={defer:function(e){return u.defer(s.lazyStateT)((n=p.unwrap(),function(t){return c.runExceptT(n(e(t)))}));var n}},D=function(e){return c.functorExceptT(s.functorStateT(e))},F=function(e){return c.bindExceptT(s.monadStateT(e))},E=function(e){return function(n){return a.bindFlipped(F(e))(function(e){return function(n){return function(t){return i.throwError(function(e){return c.monadThrowExceptT(s.monadStateT(e))}(e))(new b(n,t))}}}(e)(n))(function(e){return l.gets(S(e))((function(e){return e.value1}))}(e))}},x=function(e){return c.applyExceptT(s.monadStateT(e))},M=function(e){return c.applicativeExceptT(s.monadStateT(e))},R=function(e){return{alt:function(n){return function(t){return c.ExceptT(s.StateT((function(o){return a.bind(e.Bind1())(s.runStateT(c.runExceptT(p.unwrap()(n)))(new h(o.value0,o.value1,!1)))((function(n){return n.value0 instanceof d.Left&&!n.value1.value2?s.runStateT(c.runExceptT(p.unwrap()(t)))(o):r.pure(e.Applicative0())(new y.Tuple(n.value0,n.value1))}))})))}},Functor0:function(){return D(e.Bind1().Apply0().Functor0())}}},P=function(e){return{empty:E(e)("No alternative"),Alt0:function(){return R(e)}}};t.ParseError=b,t.parseErrorMessage=function(e){return e.value0},t.parseErrorPosition=function(e){return e.value1},t.ParseState=h,t.ParserT=C,t.runParser=function(e){var n,t=p.unwrap(),r=(n=v.monadIdentity,function(e){return function(t){var r=new h(e,w.initialPos,!1);return s.evalStateT(n.Bind1().Apply0().Functor0())(c.runExceptT(p.unwrap()(t)))(r)}})(e);return function(e){return t(r(e))}},t.mapParserT=I,t.fail=E,t.lazyParserT=T,t.monoidParserT=function(e){return function(n){return{mempty:r.pure(M(e))(m.mempty(n)),Semigroup0:function(){return function(e){return function(n){return{append:o.lift2(x(e))(g.append(n))}}}(e)(n.Semigroup0())}}}},t.functorParserT=D,t.applyParserT=x,t.applicativeParserT=M,t.bindParserT=F,t.monadStateParserT=S,t.altParserT=R,t.plusParserT=P,t.alternativeParserT=function(e){return{Applicative0:function(){return M(e)},Plus1:function(){return P(e)}}},t.monadTransParserT=A}(c),function(e){"use strict";e["Text.Parsing.Parser.Combinators"]=e["Text.Parsing.Parser.Combinators"]||{};var n=e["Text.Parsing.Parser.Combinators"],t=e["Control.Alt"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Control.Monad.Except.Trans"],u=e["Control.Monad.State.Trans"],i=e["Control.Plus"],c=e["Data.Either"],l=e["Data.Foldable"],s=e["Data.Functor"],f=e["Data.Maybe"],d=e["Data.Newtype"],v=e["Data.Tuple"],m=e["Text.Parsing.Parser"],p=function(e){return function(n){return function(o){return t.alt(m.altParserT(e))(o)(r.pure(m.applicativeParserT(e))(n))}}};n.withErrorMessage=function(e){return function(n){return function(r){return t.alt(m.altParserT(e))(n)(m.fail(e)("Expected "+r))}}},n.option=p,n.optionMaybe=function(e){return function(n){return p(e)(f.Nothing.value)(s.map(m.functorParserT(e.Bind1().Apply0().Functor0()))(f.Just.create)(n))}},n.try=function(e){return function(n){return m.ParserT(a.ExceptT(u.StateT((function(t){return o.bind(e.Bind1())(u.runStateT(a.runExceptT(d.unwrap()(n)))(t))((function(n){return n.value0 instanceof c.Left?r.pure(e.Applicative0())(new v.Tuple(n.value0,new m.ParseState(n.value1.value0,n.value1.value1,t.value2))):r.pure(e.Applicative0())(new v.Tuple(n.value0,n.value1))}))}))))}},n.tryRethrow=function(e){return function(n){return m.ParserT(a.ExceptT(u.StateT((function(t){return o.bind(e.Bind1())(u.runStateT(a.runExceptT(d.unwrap()(n)))(t))((function(n){return n.value0 instanceof c.Left?r.pure(e.Applicative0())(new v.Tuple(new c.Left(new m.ParseError(n.value0.value0.value0,t.value1)),new m.ParseState(n.value1.value0,n.value1.value1,t.value2))):r.pure(e.Applicative0())(new v.Tuple(n.value0,n.value1))}))}))))}},n.choice=function(e){return function(n){return l.foldl(e)(t.alt(m.altParserT(n)))(i.empty(m.plusParserT(n)))}}}(c),function(e){"use strict";var n="function"==typeof Array.from,t="undefined"!=typeof Symbol&&null!=Symbol&&void 0!==Symbol.iterator&&"function"==typeof String.prototype[Symbol.iterator],r="function"==typeof String.prototype.fromCodePoint,o="function"==typeof String.prototype.codePointAt;e._unsafeCodePointAt0=function(e){return o?function(e){return e.codePointAt(0)}:e},e._singleton=function(e){return r?String.fromCodePoint:e},e._take=function(e){return function(n){return t?function(e){for(var t="",r=e[Symbol.iterator](),o=0;o=0&&e1){var t=u.fromEnum(u.boundedEnumChar)(f.charAt(1)(e));return p(t)?m(n)(t):n}return n})),b=r._toCodePointArray((function(e){return v.unfoldr(v.unfoldableArray)(w)(e)}))(h),C=function(e){return o.length(b(e))},A=(n=u.toEnumWithDefaults(u.boundedEnumChar)(a.bottom(a.boundedChar))(a.top(a.boundedChar)),function(e){return s.singleton(n(e))}),S=r._singleton((function(e){if(e<=65535)return A(e);var n=i.div(i.euclideanRingInt)(e-65536|0)(1024)+55296|0,t=i.mod(i.euclideanRingInt)(e-65536|0)(1024)+56320|0;return A(n)+A(t)})),I=function(e){return function(n){if(e<1)return"";var t=y(n);return t instanceof l.Just?S(t.value0.head)+I(e-1|0)(t.value0.tail):n}},T=r._take(I);t.uncons=y,t.length=C,t.indexOf=function(e){return function(n){return c.map(l.functorMaybe)((function(e){return C(s.take(e)(n))}))(s.indexOf(e)(n))}},t.take=T,t.drop=function(e){return function(n){return s.drop(s.length(T(e)(n)))(n)}},t.splitAt=function(e){return function(n){var t=T(e)(n);return{before:t,after:s.drop(s.length(t))(n)}}}}(c),function(e){"use strict";e["Text.Parsing.Parser.String"]=e["Text.Parsing.Parser.String"]||{};var n=e["Text.Parsing.Parser.String"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.State.Class"],a=e["Data.Array"],u=e["Data.Char"],i=e["Data.Eq"],c=e["Data.EuclideanRing"],l=e["Data.Function"],s=e["Data.Functor"],f=e["Data.Maybe"],d=e["Data.Show"],v=e["Data.String.CodePoints"],m=e["Data.String.CodeUnits"],p=e["Data.String.Common"],g=e["Text.Parsing.Parser"],y=e["Text.Parsing.Parser.Combinators"],w=e["Unsafe.Coerce"].unsafeCoerce,h=function(e){return function(n){var t=w(n);return 10===t||13===t?{line:e.line+1|0,column:1}:9===t?{line:e.line,column:(e.column+8|0)-c.mod(c.euclideanRingInt)(e.column-1|0)(8)|0}:{line:e.line,column:e.column+1|0}}},b=function(e){return function(n){return y.tryRethrow(e)(r.bind(g.bindParserT(e))(function(e){return y.tryRethrow(e)(r.bind(g.bindParserT(e))(s.map(g.functorParserT(e.Bind1().Apply0().Functor0()))(w)(function(e){return r.bind(g.bindParserT(e))(o.get(g.monadStateParserT(e)))((function(n){var a=v.uncons(n.value0);if(a instanceof f.Nothing)return g.fail(e)("Unexpected EOF");if(a instanceof f.Just)return r.discard(r.discardUnit)(g.bindParserT(e))(o.put(g.monadStateParserT(e))(new g.ParseState(a.value0.tail,h(n.value1)(a.value0.head),!0)))((function(){return t.pure(g.applicativeParserT(e))(a.value0.head)}));throw new Error("Failed pattern match at Text.Parsing.Parser.String (line 84, column 3 - line 88, column 16): "+[a.constructor.name])}))}(e)))((function(n){if(n>65535)return g.fail(e)("Not a Char");var r=u.fromCharCode(n);if(r instanceof f.Nothing)return g.fail(e)("Not a Char");if(r instanceof f.Just)return t.pure(g.applicativeParserT(e))(r.value0);throw new Error("Failed pattern match at Text.Parsing.Parser.String (line 75, column 8 - line 77, column 21): "+[r.constructor.name])})))}(e))((function(r){return n(r)?t.pure(g.applicativeParserT(e))(r):g.fail(e)("Predicate unsatisfied")})))}};n.string=function(e){return function(n){return r.bind(g.bindParserT(e))(o.get(g.monadStateParserT(e)))((function(a){var u,i=m.stripPrefix(n)(a.value0);return i instanceof f.Just?r.discard(r.discardUnit)(g.bindParserT(e))(o.put(g.monadStateParserT(e))(new g.ParseState(i.value0,(u=a.value1,function(e){var n,t=u,r=!1;function o(n,o){var a=v.uncons(o);if(a instanceof f.Nothing)return r=!0,n;if(a instanceof f.Just)return t=h(n)(a.value0.head),void(e=a.value0.tail);throw new Error("Failed pattern match at Text.Parsing.Parser.String (line 129, column 27 - line 131, column 70): "+[a.constructor.name])}for(;!r;)n=o(t,e);return n})(n),!0)))((function(){return t.pure(g.applicativeParserT(e))(n)})):g.fail(e)("Expected "+d.show(d.showString)(n))}))}},n.eof=function(e){return r.bind(g.bindParserT(e))(o.get(g.monadStateParserT(e)))((function(n){return t.unless(g.applicativeParserT(e))(p.null(n.value0))(g.fail(e)("Expected EOF"))}))},n.char=function(e){return function(n){return y.withErrorMessage(e)(b(e)((function(e){return e===n})))(d.show(d.showChar)(n))}},n.noneOf=function(e){return function(n){return y.withErrorMessage(e)(b(e)(l.flip(a.notElem(i.eqChar))(n)))("none of "+d.show(d.showArray(d.showChar))(n))}}}(c),function(e){"use strict";e["Data.Formatter.Parser.Utils"]=e["Data.Formatter.Parser.Utils"]||{};var n=e["Data.Formatter.Parser.Utils"],t=e["Control.Apply"],r=e["Data.Bifunctor"],o=e["Data.Functor"],a=e["Data.Identity"],u=e["Data.Show"],i=e["Text.Parsing.Parser"],c=e["Text.Parsing.Parser.Combinators"],l=e["Text.Parsing.Parser.String"],s=function(e){return i.parseErrorMessage(e)+" "+(n=i.parseErrorPosition(e),"(line "+u.show(u.showInt)(n.line)+", col "+u.show(u.showInt)(n.column)+")");var n};n.oneOfAs=function(e){return function(n){return function(t){return function(r){return function(a){return c.choice(n)(t)(o.map(e)((function(e){return o.voidLeft(i.functorParserT(t.Bind1().Apply0().Functor0()))(r(e.value0))(e.value1)}))(a))}}}}},n.runP=function(e){return function(n){return r.lmap(r.bifunctorEither)(s)(i.runParser(n)(t.applyFirst(i.applyParserT(a.monadIdentity))(e)(l.eof(a.monadIdentity))))}}}(c),function(e){"use strict";e["Data.Formatter.Parser.Number"]=e["Data.Formatter.Parser.Number"]||{};var n=e["Data.Formatter.Parser.Number"],t=e["Data.Foldable"],r=e["Data.Formatter.Parser.Utils"],o=e["Data.Functor"],a=e["Data.Tuple"],u=e["Text.Parsing.Parser.Combinators"],i=e["Text.Parsing.Parser.String"];n.parseDigit=function(e){return u.try(e)(r.oneOfAs(o.functorArray)(t.foldableArray)(e)(i.char(e))([new a.Tuple("0",0),new a.Tuple("1",1),new a.Tuple("2",2),new a.Tuple("3",3),new a.Tuple("4",4),new a.Tuple("5",5),new a.Tuple("6",6),new a.Tuple("7",7),new a.Tuple("8",8),new a.Tuple("9",9)]))}}(c),function(e){"use strict";e["Data.Time.Component"]=e["Data.Time.Component"]||{};var n,t,r,o,a,u,i,c,l,s,f,d,v,m,p,g,y=e["Data.Time.Component"],w=e["Data.Boolean"],h=e["Data.Enum"],b=e["Data.Maybe"],C=e["Data.Ord"],A=C.ordInt,S=C.ordInt,I=C.ordInt,T=C.ordInt,D={bottom:0,top:59,Ord0:function(){return A}},F={bottom:0,top:59,Ord0:function(){return S}},E={bottom:0,top:999,Ord0:function(){return I}},x={bottom:0,top:23,Ord0:function(){return T}},M={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new b.Just(e);if(w.otherwise)return b.Nothing.value;throw new Error("Failed pattern match at Data.Time.Component (line 90, column 1 - line 95, column 26): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return D},Enum1:function(){return R}},R={succ:(r=h.toEnum(M),o=h.fromEnum(M),function(e){return r(o(e)+1|0)}),pred:(n=h.toEnum(M),t=h.fromEnum(M),function(e){return n(t(e)-1|0)}),Ord0:function(){return A}},P={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new b.Just(e);if(w.otherwise)return b.Nothing.value;throw new Error("Failed pattern match at Data.Time.Component (line 61, column 1 - line 66, column 26): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return F},Enum1:function(){return B}},B={succ:(i=h.toEnum(P),c=h.fromEnum(P),function(e){return i(c(e)+1|0)}),pred:(a=h.toEnum(P),u=h.fromEnum(P),function(e){return a(u(e)-1|0)}),Ord0:function(){return S}},k={cardinality:1e3,toEnum:function(e){if(e>=0&&e<=999)return new b.Just(e);if(w.otherwise)return b.Nothing.value;throw new Error("Failed pattern match at Data.Time.Component (line 120, column 1 - line 125, column 31): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return E},Enum1:function(){return N}},N={succ:(f=h.toEnum(k),d=h.fromEnum(k),function(e){return f(d(e)+1|0)}),pred:(l=h.toEnum(k),s=h.fromEnum(k),function(e){return l(s(e)-1|0)}),Ord0:function(){return I}},L={cardinality:24,toEnum:function(e){if(e>=0&&e<=23)return new b.Just(e);if(w.otherwise)return b.Nothing.value;throw new Error("Failed pattern match at Data.Time.Component (line 32, column 1 - line 37, column 24): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return x},Enum1:function(){return _}},_={succ:(p=h.toEnum(L),g=h.fromEnum(L),function(e){return p(g(e)+1|0)}),pred:(v=h.toEnum(L),m=h.fromEnum(L),function(e){return v(m(e)-1|0)}),Ord0:function(){return T}};y.boundedEnumHour=L,y.boundedEnumMinute=P,y.boundedEnumSecond=M,y.boundedEnumMillisecond=k}(c),function(e){"use strict";e["Data.Formatter.DateTime"]=e["Data.Formatter.DateTime"]||{};var n,t,r,o,a,u=e["Data.Formatter.DateTime"],i=e["Control.Alt"],c=e["Control.Applicative"],l=e["Control.Apply"],s=e["Control.Bind"],f=e["Control.Category"],d=e["Control.Lazy"],v=e["Control.Monad.Reader.Class"],m=e["Control.Monad.Reader.Trans"],p=e["Control.Monad.State"],g=e["Control.Monad.State.Class"],y=e["Control.Monad.State.Trans"],w=e["Control.Monad.Trans.Class"],h=e["Data.Array"],b=e["Data.Date"],C=e["Data.Date.Component"],A=e["Data.DateTime"],S=e["Data.DateTime.Instant"],I=e["Data.Either"],T=e["Data.Enum"],D=e["Data.Foldable"],F=e["Data.Formatter.Internal"],E=e["Data.Formatter.Parser.Number"],x=e["Data.Formatter.Parser.Utils"],M=e["Data.Function"],R=e["Data.Functor"],P=e["Data.Identity"],B=e["Data.Int"],k=e["Data.List"],N=e["Data.List.Types"],L=e["Data.Maybe"],_=e["Data.Monoid"],U=e["Data.Ring"],H=e["Data.Semigroup"],q=e["Data.Semiring"],O=e["Data.Show"],W=e["Data.String.CodeUnits"],V=e["Data.Time"],K=e["Data.Time.Component"],z=e["Data.Tuple"],J=e["Data.Unit"],j=e["Text.Parsing.Parser"],Q=e["Text.Parsing.Parser.Combinators"],G=e["Text.Parsing.Parser.String"],Z=function(){function e(){}return e.value=new e,e}(),X=function(){function e(){}return e.value=new e,e}(),Y=function(){function e(){}return e.value=new e,e}(),$=function(){function e(){}return e.value=new e,e}(),ee=function(){function e(){}return e.value=new e,e}(),ne=function(){function e(){}return e.value=new e,e}(),te=function(){function e(){}return e.value=new e,e}(),re=function(){function e(){}return e.value=new e,e}(),oe=function(){function e(){}return e.value=new e,e}(),ae=function(){function e(){}return e.value=new e,e}(),ue=function(){function e(){}return e.value=new e,e}(),ie=function(){function e(){}return e.value=new e,e}(),ce=function(){function e(){}return e.value=new e,e}(),le=function(){function e(){}return e.value=new e,e}(),se=function(){function e(){}return e.value=new e,e}(),fe=function(){function e(){}return e.value=new e,e}(),de=function(){function e(){}return e.value=new e,e}(),ve=function(){function e(){}return e.value=new e,e}(),me=function(){function e(){}return e.value=new e,e}(),pe=function(){function e(){}return e.value=new e,e}(),ge=function(){function e(){}return e.value=new e,e}(),ye=function(){function e(){}return e.value=new e,e}(),we=function(){function e(){}return e.value=new e,e}(),he=function(){function e(){}return e.value=new e,e}(),be=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ce=function(e){return function(n){return s.bind(m.bindReaderT(I.bindEither))(v.ask(m.monadAskReaderT(I.monadEither)))((function(t){return w.lift(m.monadTransReaderT)(I.monadEither)(t.numn?new I.Left("Number is out of range [ "+O.show(O.showInt)(e)+", "+O.show(O.showInt)(n)+" ]"):new I.Right(J.unit))}))}},Ae=function(e){return function(n){return function(t){return function(r){return 0===t?c.pure(e.Applicative0())(N.Nil.value):l.apply(e.Applicative0().Apply0())(R.map(e.Plus1().Alt0().Functor0())(N.Cons.create)(r))(d.defer(n)((function(o){return Se(e)(n)(t-1|0)(r)})))}}}},Se=function(e){return function(n){return function(t){return function(r){return 0===t?c.pure(e.Applicative0())(N.Nil.value):i.alt(e.Plus1().Alt0())(Ae(e)(n)(t)(r))(c.pure(e.Applicative0())(N.Nil.value))}}}},Ie=R.mapFlipped(j.functorParserT(P.functorIdentity))(h.some(j.alternativeParserT(P.monadIdentity))(j.lazyParserT)(G.noneOf(P.monadIdentity)(W.toCharArray("YMDEHhamsS"))))(W.fromCharArray),Te=function(e){return function(n){return function(t){return function(r){return s.bind(j.bindParserT(e))(Ae(j.alternativeParserT(e))(j.lazyParserT)(n)(E.parseDigit(e)))((function(o){var a=F.foldDigits(N.foldableList)(o),u=k.length(o),i=m.runReaderT(t)({length:u,num:a,maxLength:n});if(i instanceof I.Left)return j.fail(e)(r+"("+i.value0+")");if(i instanceof I.Right)return c.pure(j.applicativeParserT(e))(a);throw new Error("Failed pattern match at Data.Formatter.DateTime (line 336, column 3 - line 338, column 23): "+[i.constructor.name])}))}}}},De=function(e){return function(n){return function(t){return function(r){return s.bind(j.bindParserT(e))(R.map(j.functorParserT(e.Bind1().Apply0().Functor0()))(L.isJust)(Q.optionMaybe(e)(G.char(e)("-"))))((function(o){return R.map(j.functorParserT(e.Bind1().Apply0().Functor0()))(o?U.negate(U.ringInt):f.identity(f.categoryFn))(Te(e)(n)(t)(r))}))}}}},Fe={year:L.Nothing.value,month:L.Nothing.value,day:L.Nothing.value,hour:L.Nothing.value,minute:L.Nothing.value,second:L.Nothing.value,millisecond:L.Nothing.value,meridiem:L.Nothing.value},Ee=i.alt(j.altParserT(P.monadIdentity))(x.oneOfAs(R.functorArray)(D.foldableArray)(P.monadIdentity)((n=Q.try(P.monadIdentity),t=G.string(P.monadIdentity),function(e){return n(t(e))}))([new z.Tuple("YYYY",Y.value),new z.Tuple("YY",$.value),new z.Tuple("Y",ee.value),new z.Tuple("MMMM",ne.value),new z.Tuple("MMM",te.value),new z.Tuple("MM",re.value),new z.Tuple("DD",oe.value),new z.Tuple("D",ae.value),new z.Tuple("E",ie.value),new z.Tuple("X",ue.value),new z.Tuple("dddd",ce.value),new z.Tuple("ddd",le.value),new z.Tuple("HH",se.value),new z.Tuple("hh",fe.value),new z.Tuple("a",de.value),new z.Tuple("mm",me.value),new z.Tuple("m",ve.value),new z.Tuple("ss",ge.value),new z.Tuple("s",pe.value),new z.Tuple("SSS",ye.value),new z.Tuple("SS",he.value),new z.Tuple("S",we.value)]))(R.map(j.functorParserT(P.functorIdentity))(be.create)(Ie)),xe=k.some(j.alternativeParserT(P.monadIdentity))(j.lazyParserT)(Ee),Me=x.runP(xe),Re=s.bind(m.bindReaderT(I.bindEither))(v.ask(m.monadAskReaderT(I.monadEither)))((function(e){return w.lift(m.monadTransReaderT)(I.monadEither)(e.maxLength!==e.length?new I.Left("Expected "+O.show(O.showInt)(e.maxLength)+" digits but got "+O.show(O.showInt)(e.length)):new I.Right(J.unit))})),Pe=(r=function(e){return function(n){return s.bind(j.bindParserT(y.monadStateT(P.monadIdentity)))(n)((function(n){return w.lift(j.monadTransParserT)(y.monadStateT(P.monadIdentity))(g.modify_(y.monadStateStateT(P.monadIdentity))(M.flip(e)(new L.Just(n))))}))}},function(e){if(e instanceof Y)return r((function(e){return function(n){return{year:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second}}}))(De(y.monadStateT(P.monadIdentity))(4)(Re)("Incorrect full year"));if(e instanceof $)return r((function(e){return function(n){return{year:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second}}}))(De(y.monadStateT(P.monadIdentity))(2)(Re)("Incorrect 2-digit year"));if(e instanceof ee)return r((function(e){return function(n){return{year:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second}}}))(l.lift2(j.applyParserT(y.monadStateT(P.monadIdentity)))(q.mul(q.semiringInt))(Q.option(y.monadStateT(P.monadIdentity))(1)(Q.try(y.monadStateT(P.monadIdentity))(R.mapFlipped(j.functorParserT(y.functorStateT(P.functorIdentity)))(G.string(y.monadStateT(P.monadIdentity))("-"))(M.const(-1)))))(R.mapFlipped(j.functorParserT(y.functorStateT(P.functorIdentity)))(k.some(j.alternativeParserT(y.monadStateT(P.monadIdentity)))(j.lazyParserT)(E.parseDigit(y.monadStateT(P.monadIdentity))))(F.foldDigits(N.foldableList))));if(e instanceof ne)return r((function(e){return function(n){return{month:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,second:e.second,year:e.year}}}))(R.map(j.functorParserT(y.functorStateT(P.functorIdentity)))(T.fromEnum(C.boundedEnumMonth))((n=y.monadStateT(P.monadIdentity),x.oneOfAs(R.functorArray)(D.foldableArray)(n)((t=Q.try(n),o=G.string(n),function(e){return t(o(e))}))([new z.Tuple("January",C.January.value),new z.Tuple("February",C.February.value),new z.Tuple("March",C.March.value),new z.Tuple("April",C.April.value),new z.Tuple("May",C.May.value),new z.Tuple("June",C.June.value),new z.Tuple("July",C.July.value),new z.Tuple("August",C.August.value),new z.Tuple("September",C.September.value),new z.Tuple("October",C.October.value),new z.Tuple("November",C.November.value),new z.Tuple("December",C.December.value)]))));var n,t,o;if(e instanceof te)return r((function(e){return function(n){return{month:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,second:e.second,year:e.year}}}))(R.map(j.functorParserT(y.functorStateT(P.functorIdentity)))(T.fromEnum(C.boundedEnumMonth))(function(e){return x.oneOfAs(R.functorArray)(D.foldableArray)(e)((n=Q.try(e),t=G.string(e),function(e){return n(t(e))}))([new z.Tuple("Jan",C.January.value),new z.Tuple("Feb",C.February.value),new z.Tuple("Mar",C.March.value),new z.Tuple("Apr",C.April.value),new z.Tuple("May",C.May.value),new z.Tuple("Jun",C.June.value),new z.Tuple("Jul",C.July.value),new z.Tuple("Aug",C.August.value),new z.Tuple("Sep",C.September.value),new z.Tuple("Oct",C.October.value),new z.Tuple("Nov",C.November.value),new z.Tuple("Dec",C.December.value)]);var n,t}(y.monadStateT(P.monadIdentity))));if(e instanceof re)return r((function(e){return function(n){return{month:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(H.append(m.semigroupReaderT(I.applyEither)(H.semigroupUnit))(Ce(1)(12))(Re))("Incorrect 2-digit month"));if(e instanceof oe)return r((function(e){return function(n){return{day:n,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(H.append(m.semigroupReaderT(I.applyEither)(H.semigroupUnit))(Ce(1)(31))(Re))("Incorrect day of month"));if(e instanceof ae)return r((function(e){return function(n){return{day:n,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(Ce(1)(31))("Incorrect day of month"));if(e instanceof ue)return s.bind(j.bindParserT(y.monadStateT(P.monadIdentity)))(R.map(j.functorParserT(y.functorStateT(P.functorIdentity)))(F.foldDigits(N.foldableList))(k.some(j.alternativeParserT(y.monadStateT(P.monadIdentity)))(j.lazyParserT)(E.parseDigit(y.monadStateT(P.monadIdentity)))))((function(e){var n=R.map(L.functorMaybe)(S.toDateTime)(S.instant(1e3*B.toNumber(e)));if(n instanceof L.Nothing)return j.fail(y.monadStateT(P.monadIdentity))("Incorrect timestamp");if(n instanceof L.Just)return w.lift(j.monadTransParserT)(y.monadStateT(P.monadIdentity))(g.put(y.monadStateStateT(P.monadIdentity))({year:new L.Just(T.fromEnum(C.boundedEnumYear)(b.year(n.value0.value0))),month:new L.Just(T.fromEnum(C.boundedEnumMonth)(b.month(n.value0.value0))),day:new L.Just(T.fromEnum(C.boundedEnumDay)(b.day(n.value0.value0))),hour:new L.Just(T.fromEnum(K.boundedEnumHour)(V.hour(n.value0.value1))),minute:new L.Just(T.fromEnum(K.boundedEnumMinute)(V.minute(n.value0.value1))),second:new L.Just(T.fromEnum(K.boundedEnumSecond)(V.second(n.value0.value1))),millisecond:new L.Just(T.fromEnum(K.boundedEnumMillisecond)(V.millisecond(n.value0.value1))),meridiem:L.Nothing.value}));throw new Error("Failed pattern match at Data.Formatter.DateTime (line 362, column 5 - line 373, column 10): "+[n.constructor.name])}));if(e instanceof ie)return R.void(j.functorParserT(y.functorStateT(P.functorIdentity)))(Te(y.monadStateT(P.monadIdentity))(1)(Ce(1)(7))("Incorrect day of week"));if(e instanceof ce)return r((function(e){return function(n){return{day:n,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(R.map(j.functorParserT(y.functorStateT(P.functorIdentity)))(T.fromEnum(C.boundedEnumWeekday))(function(e){return x.oneOfAs(R.functorArray)(D.foldableArray)(e)((n=Q.try(e),t=G.string(e),function(e){return n(t(e))}))([new z.Tuple("Monday",C.Monday.value),new z.Tuple("Tuesday",C.Tuesday.value),new z.Tuple("Wednesday",C.Wednesday.value),new z.Tuple("Thursday",C.Thursday.value),new z.Tuple("Friday",C.Friday.value),new z.Tuple("Saturday",C.Saturday.value),new z.Tuple("Sunday",C.Sunday.value)]);var n,t}(y.monadStateT(P.monadIdentity))));if(e instanceof le)return r((function(e){return function(n){return{day:n,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(R.map(j.functorParserT(y.functorStateT(P.functorIdentity)))(T.fromEnum(C.boundedEnumWeekday))(function(e){return x.oneOfAs(R.functorArray)(D.foldableArray)(e)((n=Q.try(e),t=G.string(e),function(e){return n(t(e))}))([new z.Tuple("Mon",C.Monday.value),new z.Tuple("Tue",C.Tuesday.value),new z.Tuple("Wed",C.Wednesday.value),new z.Tuple("Thu",C.Thursday.value),new z.Tuple("Fri",C.Friday.value),new z.Tuple("Sat",C.Saturday.value),new z.Tuple("Sun",C.Sunday.value)]);var n,t}(y.monadStateT(P.monadIdentity))));if(e instanceof se)return r((function(e){return function(n){return{hour:n,day:e.day,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(H.append(m.semigroupReaderT(I.applyEither)(H.semigroupUnit))(Ce(0)(24))(Re))("Incorrect 24 hour"));if(e instanceof fe)return r((function(e){return function(n){return{hour:n,day:e.day,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(H.append(m.semigroupReaderT(I.applyEither)(H.semigroupUnit))(Ce(0)(12))(Re))("Incorrect 12 hour"));if(e instanceof de)return r((function(e){return function(n){return{meridiem:n,day:e.day,hour:e.hour,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(function(e){return x.oneOfAs(R.functorArray)(D.foldableArray)(e)((n=Q.try(e),t=G.string(e),function(e){return n(t(e))}))([new z.Tuple("am",Z.value),new z.Tuple("AM",Z.value),new z.Tuple("pm",X.value),new z.Tuple("PM",X.value)]);var n,t}(y.monadStateT(P.monadIdentity)));if(e instanceof me)return r((function(e){return function(n){return{minute:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(H.append(m.semigroupReaderT(I.applyEither)(H.semigroupUnit))(Ce(0)(59))(Re))("Incorrect 2-digit minute"));if(e instanceof ve)return r((function(e){return function(n){return{minute:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(Ce(0)(59))("Incorrect minute"));if(e instanceof ge)return r((function(e){return function(n){return{second:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(H.append(m.semigroupReaderT(I.applyEither)(H.semigroupUnit))(Ce(0)(59))(Re))("Incorrect 2-digit second"));if(e instanceof pe)return r((function(e){return function(n){return{second:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(Ce(0)(59))("Incorrect second"));if(e instanceof ye)return r((function(e){return function(n){return{millisecond:n,day:e.day,hour:e.hour,meridiem:e.meridiem,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(3)(Re)("Incorrect millisecond"));if(e instanceof be)return R.void(j.functorParserT(y.functorStateT(P.functorIdentity)))(G.string(y.monadStateT(P.monadIdentity))(e.value0));if(e instanceof we)return r((function(e){return function(n){return{millisecond:n,day:e.day,hour:e.hour,meridiem:e.meridiem,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(R.mapFlipped(j.functorParserT(y.functorStateT(P.functorIdentity)))(Te(y.monadStateT(P.monadIdentity))(1)(Re)("Incorrect 1-digit millisecond"))((function(e){return 100*e|0})));if(e instanceof he)return r((function(e){return function(n){return{millisecond:n,day:e.day,hour:e.hour,meridiem:e.meridiem,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(R.mapFlipped(j.functorParserT(y.functorStateT(P.functorIdentity)))(Te(y.monadStateT(P.monadIdentity))(2)(Re)("Incorrect 2-digit millisecond"))((function(e){return 10*e|0})));throw new Error("Failed pattern match at Data.Formatter.DateTime (line 341, column 25 - line 399, column 74): "+[e.constructor.name])}),Be=(o=P.monadIdentity,a=function(e){var n;return s.bind(j.bindParserT(o))(j.mapParserT((n=o,function(e){var t=p.runState(e)(Fe);return c.pure(n.Applicative0())(new z.Tuple(R.voidLeft(I.functorEither)(t.value0.value0)(t.value1),t.value0.value1))}))(D.foldMap(N.foldableList)(j.monoidParserT(y.monadStateT(P.monadIdentity))(_.monoidUnit))(Pe)(e)))((function(e){return I.either(j.fail(o))(c.pure(j.applicativeParserT(o)))((n=e,l.applySecond(I.applyEither)((t=n).hour instanceof L.Just&&24===t.hour.value0?D.for_(I.applicativeEither)(D.foldableArray)([t.minute,t.second,t.millisecond])((function(e){return c.when(I.applicativeEither)(L.fromMaybe(0)(e)>0)(new I.Left("When hour is 24, other time components must be 0"))})):c.pure(I.applicativeEither)(J.unit))(l.apply(I.applyEither)(R.map(I.functorEither)(A.DateTime.create)(l.apply(I.applyEither)(l.apply(I.applyEither)(R.map(I.functorEither)(b.canonicalDate)(L.maybe(new I.Left("Incorrect year"))(c.pure(I.applicativeEither))(T.toEnum(C.boundedEnumYear)(L.fromMaybe(0)(n.year)))))(L.maybe(new I.Left("Incorrect month"))(c.pure(I.applicativeEither))(T.toEnum(C.boundedEnumMonth)(L.fromMaybe(1)(n.month)))))(L.maybe(new I.Left("Incorrect day"))(c.pure(I.applicativeEither))(T.toEnum(C.boundedEnumDay)(function(e){return function(n){return e instanceof L.Just&&24===e.value0?n+1|0:n}}(n.hour)(L.fromMaybe(1)(n.day)))))))(l.apply(I.applyEither)(l.apply(I.applyEither)(l.apply(I.applyEither)(R.map(I.functorEither)(V.Time.create)(L.maybe(new I.Left("Incorrect hour"))(c.pure(I.applicativeEither))(T.toEnum(K.boundedEnumHour)(L.fromMaybe(0)(R.map(L.functorMaybe)(function(e){return function(n){if(e instanceof L.Just&&e.value0 instanceof Z&&12===n)return 0;if(e instanceof L.Just&&e.value0 instanceof X&&12===n)return 12;if(e instanceof L.Just&&e.value0 instanceof X)return n+12|0;if(e instanceof L.Just&&e.value0 instanceof Z)return n;if(e instanceof L.Nothing&&24===n)return 0;if(e instanceof L.Nothing)return n;throw new Error("Failed pattern match at Data.Formatter.DateTime (line 279, column 1 - line 279, column 44): "+[e.constructor.name,n.constructor.name])}}(n.meridiem))(n.hour))))))(L.maybe(new I.Left("Incorrect minute"))(c.pure(I.applicativeEither))(T.toEnum(K.boundedEnumMinute)(L.fromMaybe(0)(n.minute)))))(L.maybe(new I.Left("Incorrect second"))(c.pure(I.applicativeEither))(T.toEnum(K.boundedEnumSecond)(L.fromMaybe(0)(n.second)))))(L.maybe(new I.Left("Incorrect millisecond"))(c.pure(I.applicativeEither))(T.toEnum(K.boundedEnumMillisecond)(L.fromMaybe(0)(n.millisecond))))))));var n,t}))},function(e){return x.runP(a(e))});u.parseFormatString=Me,u.unformat=Be}(c),function(e){"use strict";e["Ctl.Internal.Types.SystemStart"]=e["Ctl.Internal.Types.SystemStart"]||{};var n,t=e["Ctl.Internal.Types.SystemStart"],r=e["Control.Alt"],o=e["Data.BigInt"],a=e["Data.DateTime.Instant"],u=e["Data.Either"],i=e["Data.Formatter.DateTime"],c=e["Data.Functor"],l=e["Data.Maybe"],s=e["Data.Newtype"],f=e["Data.String.CodePoints"],d="YYYY-MM-DDTHH:mm:ss",v="YYYY-MM-DDTHH:mm:ss.SSS",m=(n=l.fromJust(),function(e){return n(u.hush(i.parseFormatString(e)))});t.sysStartFromOgmiosTimestamp=function(e){var n=i.unformat(m(d))(f.take(f.length(d))(e)),t=i.unformat(m(v))(f.take(f.length(v))(e));return c.map(u.functorEither)(s.wrap())(r.alt(u.altEither)(t)(n))},t.sysStartUnixTime=function(e){return o.fromNumber(s.unwrap()(a.unInstant(a.fromDateTime(e))))}}(c),function(e){"use strict";e.lengthImpl=function(e){return Array.from(e).length},e.padEndPrimeImpl=function(e,n){return n.padEnd(e)},e.padStartPrimeImpl=function(e,n){return n.padStart(e)}}(c["Data.String.Utils"]=c["Data.String.Utils"]||{}),function(e){"use strict";e["Data.String.Utils"]=e["Data.String.Utils"]||{};var n=e["Data.String.Utils"],t=e["Data.String.Utils"],r=e["Data.String.CodePoints"],o=e["Data.String.CodeUnits"];n.padEnd=function(e){return function(n){var a=o.length(n),u=r.length(n);return function(e){return function(n){return t.padEndPrimeImpl(e,n)}}((e+a|0)-u|0)(n)}},n.padStart=function(e){return function(n){var a=o.length(n),u=r.length(n);return function(e){return function(n){return t.padStartPrimeImpl(e,n)}}((e+a|0)-u|0)(n)}}}(c),function(e){"use strict";e["Ctl.Internal.QueryM.Ogmios"]=e["Ctl.Internal.QueryM.Ogmios"]||{};var n,t,r,o,a,u,i,c,l,s,f,d,v,m,p,g,y,w,h,b,C,A,S=e["Ctl.Internal.QueryM.Ogmios"],I=e.Aeson,T=e["Control.Alt"],D=e["Control.Alternative"],F=e["Control.Applicative"],E=e["Control.Apply"],x=e["Control.Bind"],M=e["Control.Monad.Reader.Trans"],R=e["Ctl.Internal.Cardano.Types.NativeScript"],P=e["Ctl.Internal.Cardano.Types.ScriptRef"],B=e["Ctl.Internal.Cardano.Types.Transaction"],k=e["Ctl.Internal.Cardano.Types.Value"],N=e["Ctl.Internal.Deserialization.FromBytes"],L=e["Ctl.Internal.Helpers"],_=e["Ctl.Internal.QueryM.JsonWsp"],U=e["Ctl.Internal.Serialization.Address"],H=e["Ctl.Internal.Serialization.Hash"],q=e["Ctl.Internal.Types.BigNum"],O=e["Ctl.Internal.Types.ByteArray"],W=e["Ctl.Internal.Types.CborBytes"],V=e["Ctl.Internal.Types.EraSummaries"],K=e["Ctl.Internal.Types.Int"],z=e["Ctl.Internal.Types.Natural"],J=e["Ctl.Internal.Types.ProtocolParameters"],j=e["Ctl.Internal.Types.Rational"],Q=e["Ctl.Internal.Types.RedeemerTag"],G=e["Ctl.Internal.Types.RewardAddress"],Z=e["Ctl.Internal.Types.Scripts"],X=e["Ctl.Internal.Types.SystemStart"],Y=e["Ctl.Internal.Types.TokenName"],$=e["Ctl.Internal.Types.VRFKeyHash"],ee=e["Data.Argonaut.Decode.Error"],ne=e["Data.Array"],te=e["Data.Bifunctor"],re=e["Data.BigInt"],oe=e["Data.Either"],ae=e["Data.Eq"],ue=e["Data.Foldable"],ie=e["Data.Function"],ce=e["Data.Functor"],le=e["Data.Generic.Rep"],se=e["Data.Int"],fe=e["Data.List.Types"],de=e["Data.Map.Internal"],ve=e["Data.Maybe"],me=e["Data.Monoid"],pe=e["Data.Newtype"],ge=e["Data.Ord"],ye=e["Data.Semiring"],we=e["Data.Show"],he=e["Data.Show.Generic"],be=e["Data.String.Common"],Ce=e["Data.String.Utils"],Ae=e["Data.Traversable"],Se=e["Data.Tuple"],Ie=e["Data.Unfoldable"],Te=e["Foreign.Object"],De=e["Untagged.TypeCheck"],Fe=e["Untagged.Union"],Ee=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),xe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Me=function(e){return e},Re=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Pe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Be=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),ke=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ne=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Le=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),_e=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ue=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),He=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),qe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Oe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),We=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ve=De.hasRuntimeTypeString,Ke={to:function(e){if(e instanceof le.Inl)return new He(e.value0);if(e instanceof le.Inr)return new qe(e.value0);throw new Error("Failed pattern match at Ctl.Internal.QueryM.Ogmios (line 709, column 1 - line 709, column 46): "+[e.constructor.name])},from:function(e){if(e instanceof He)return new le.Inl(e.value0);if(e instanceof qe)return new le.Inr(e.value0);throw new Error("Failed pattern match at Ctl.Internal.QueryM.Ogmios (line 709, column 1 - line 709, column 46): "+[e.constructor.name])}},ze={to:function(e){if(e instanceof le.Inl)return new Re(e.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inl)return new Pe(e.value0.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inr&&e.value0.value0 instanceof le.Inl)return new Be(e.value0.value0.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inr&&e.value0.value0 instanceof le.Inr&&e.value0.value0.value0 instanceof le.Inl)return new ke(e.value0.value0.value0.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inr&&e.value0.value0 instanceof le.Inr&&e.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0 instanceof le.Inl)return new Ne(e.value0.value0.value0.value0.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inr&&e.value0.value0 instanceof le.Inr&&e.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0.value0 instanceof le.Inl)return new Le(e.value0.value0.value0.value0.value0.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inr&&e.value0.value0 instanceof le.Inr&&e.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof le.Inl)return new _e(e.value0.value0.value0.value0.value0.value0.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inr&&e.value0.value0 instanceof le.Inr&&e.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof le.Inr)return new Ue(e.value0.value0.value0.value0.value0.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.QueryM.Ogmios (line 695, column 1 - line 695, column 40): "+[e.constructor.name])},from:function(e){if(e instanceof Re)return new le.Inl(e.value0);if(e instanceof Pe)return new le.Inr(new le.Inl(e.value0));if(e instanceof Be)return new le.Inr(new le.Inr(new le.Inl(e.value0)));if(e instanceof ke)return new le.Inr(new le.Inr(new le.Inr(new le.Inl(e.value0))));if(e instanceof Ne)return new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inl(e.value0)))));if(e instanceof Le)return new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inl(e.value0))))));if(e instanceof _e)return new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inl(e.value0)))))));if(e instanceof Ue)return new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inr(e.value0)))))));throw new Error("Failed pattern match at Ctl.Internal.QueryM.Ogmios (line 695, column 1 - line 695, column 40): "+[e.constructor.name])}},Je={show:he.genericShow(ze)(he.genericShowSum(he.genericShowConstructor(he.genericShowArgsArgument(we.showArray(we.showRecord()(we.showRecordFieldsCons({reflectSymbol:function(){return"redeemerIndex"}})(we.showRecordFieldsCons({reflectSymbol:function(){return"redeemerTag"}})(we.showRecordFieldsNil)(Q.showRedeemerTag))(z.showNatural)))))({reflectSymbol:function(){return"ExtraRedeemers"}}))(he.genericShowSum(he.genericShowConstructor(he.genericShowArgsArgument(we.showRecord()(we.showRecordFieldsCons({reflectSymbol:function(){return"missing"}})(we.showRecordFieldsCons({reflectSymbol:function(){return"provided"}})(we.showRecordFieldsNil)(ve.showMaybe(we.showArray(we.showString))))(we.showArray(we.showString)))))({reflectSymbol:function(){return"MissingRequiredDatums"}}))(he.genericShowSum(he.genericShowConstructor(he.genericShowArgsArgument(we.showRecord()(we.showRecordFieldsCons({reflectSymbol:function(){return"missing"}})(we.showRecordFieldsCons({reflectSymbol:function(){return"resolved"}})(we.showRecordFieldsNil)(de.showMap(we.showRecord()(we.showRecordFieldsCons({reflectSymbol:function(){return"redeemerIndex"}})(we.showRecordFieldsCons({reflectSymbol:function(){return"redeemerTag"}})(we.showRecordFieldsNil)(Q.showRedeemerTag))(z.showNatural)))(we.showString)))(we.showArray(we.showString)))))({reflectSymbol:function(){return"MissingRequiredScripts"}}))(he.genericShowSum(he.genericShowConstructor(he.genericShowArgsArgument(we.showRecord()(we.showRecordFieldsCons({reflectSymbol:function(){return"error"}})(we.showRecordFieldsCons({reflectSymbol:function(){return"traces"}})(we.showRecordFieldsNil)(we.showArray(we.showString)))(we.showString))))({reflectSymbol:function(){return"ValidatorFailed"}}))(he.genericShowSum(he.genericShowConstructor(he.genericShowArgsArgument(we.showRecord()(we.showRecordFieldsCons({reflectSymbol:function(){return"index"}})(we.showRecordFieldsCons({reflectSymbol:function(){return"txId"}})(we.showRecordFieldsNil)(we.showString))(we.showInt))))({reflectSymbol:function(){return"UnknownInputReferencedByRedeemer"}}))(he.genericShowSum(he.genericShowConstructor(he.genericShowArgsArgument(we.showRecord()(we.showRecordFieldsCons({reflectSymbol:function(){return"index"}})(we.showRecordFieldsCons({reflectSymbol:function(){return"txId"}})(we.showRecordFieldsNil)(we.showString))(we.showInt))))({reflectSymbol:function(){return"NonScriptInputReferencedByRedeemer"}}))(he.genericShowSum(he.genericShowConstructor(he.genericShowArgsArgument(ve.showMaybe(we.showRecord()(we.showRecordFieldsCons({reflectSymbol:function(){return"memory"}})(we.showRecordFieldsCons({reflectSymbol:function(){return"steps"}})(we.showRecordFieldsNil)(z.showNatural))(z.showNatural)))))({reflectSymbol:function(){return"IllFormedExecutionBudget"}}))(he.genericShowConstructor(he.genericShowArgsArgument(we.showString))({reflectSymbol:function(){return"NoCostModelForLanguage"}})))))))))},je={show:he.genericShow(Ke)(he.genericShowSum(he.genericShowConstructor(he.genericShowArgsArgument(we.showString))({reflectSymbol:function(){return"UnparsedError"}}))(he.genericShowConstructor(he.genericShowArgsArgument(de.showMap(we.showRecord()(we.showRecordFieldsCons({reflectSymbol:function(){return"redeemerIndex"}})(we.showRecordFieldsCons({reflectSymbol:function(){return"redeemerTag"}})(we.showRecordFieldsNil)(Q.showRedeemerTag))(z.showNatural)))(we.showArray(Je))))({reflectSymbol:function(){return"ScriptFailures"}})))},Qe={encodeAeson:function(e){var n=de.toUnfoldable(Ie.unfoldableArray)(e),t=function(e){if(e instanceof R.ScriptPubkey)return I.encodeAeson(H.encodeAesonEd25519KeyHash)(e.value0);if(e instanceof R.ScriptAll)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonArray(I.encodeAesonAeson))(I.gEncodeAesonNil)({reflectSymbol:function(){return"all"}})())())({all:ce.map(ce.functorArray)(t)(e.value0)});if(e instanceof R.ScriptAny)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonArray(I.encodeAesonAeson))(I.gEncodeAesonNil)({reflectSymbol:function(){return"any"}})())())({any:ce.map(ce.functorArray)(t)(e.value0)});if(e instanceof R.ScriptNOfK)return I.encodeAeson(I.encodeAesonObject(I.encodeAesonArray(I.encodeAesonAeson)))(Te.singleton(re.toString(re.fromInt(e.value0)))(ce.map(ce.functorArray)(t)(e.value1)));if(e instanceof R.TimelockStart)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(q.encodeAesonBigNum)(I.gEncodeAesonNil)({reflectSymbol:function(){return"startsAt"}})())())({startsAt:e.value0});if(e instanceof R.TimelockExpiry)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(q.encodeAesonBigNum)(I.gEncodeAesonNil)({reflectSymbol:function(){return"expiresAt"}})())())({expiresAt:e.value0});throw new Error("Failed pattern match at Ctl.Internal.QueryM.Ogmios (line 1024, column 5 - line 1024, column 48): "+[e.constructor.name])},r=function(e){if(e instanceof P.NativeScriptRef)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonAeson)(I.gEncodeAesonNil)({reflectSymbol:function(){return"native"}})())())({native:t(e.value0)});if(e instanceof P.PlutusScriptRef&&e.value0.value1 instanceof Z.PlutusV1)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(O.encodeAesonByteArray)(I.gEncodeAesonNil)({reflectSymbol:function(){return"plutus:v1"}})())())({"plutus:v1":e.value0.value0});if(e instanceof P.PlutusScriptRef&&e.value0.value1 instanceof Z.PlutusV2)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(O.encodeAesonByteArray)(I.gEncodeAesonNil)({reflectSymbol:function(){return"plutus:v2"}})())())({"plutus:v2":e.value0.value0});throw new Error("Failed pattern match at Ctl.Internal.QueryM.Ogmios (line 1039, column 5 - line 1039, column 42): "+[e.constructor.name])};return I.encodeAeson(I.encodeAesonArray(I.encodeAesonAeson))(ce.map(ce.functorArray)((function(e){return I.encodeAeson(I.encodeAesonTuple(I.encodeTupleAuxTuple(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonUInt)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"txId"}})())({reflectSymbol:function(){return"index"}})())())(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonMaybe(I.encodeAesonString))(I.gEncodeAesonCons(I.encodeAesonMaybe(I.encodeAesonString))(I.gEncodeAesonCons(I.encodeAesonMaybe(I.encodeAesonAeson))(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonAeson)(I.gEncodeAesonCons(I.encodeAesonBigInt)(I.gEncodeAesonNil)({reflectSymbol:function(){return"coins"}})())({reflectSymbol:function(){return"assets"}})())())(I.gEncodeAesonNil)({reflectSymbol:function(){return"value"}})())({reflectSymbol:function(){return"script"}})())({reflectSymbol:function(){return"datumHash"}})())({reflectSymbol:function(){return"datum"}})())({reflectSymbol:function(){return"address"}})())())))(new Se.Tuple({txId:e.value0.txId,index:e.value0.index},{address:e.value1.address,datumHash:e.value1.datumHash,datum:e.value1.datum,script:ce.map(ve.functorMaybe)(r)(e.value1.script),value:{coins:k.getLovelace(k.valueToCoin(e.value1.value)),assets:(n=k.getNonAdaAsset(e.value1.value),L.encodeMap(I.encodeAesonString)(I.encodeAesonBigInt)(ue.foldl(fe.foldableList)((function(e){return function(n){return de.insert(ge.ordString)((t=n.value0,function(e){var n=Y.getTokenName(e),r=O.byteArrayToHex(n),o=k.getCurrencySymbol(t),a=O.byteArrayToHex(o);return ae.eq(O.eqByteArray)(n)(me.mempty(O.monoidByteArray))?a:a+"."+r})(n.value1.value0))(n.value1.value1)(e);var t}}))(de.empty)(k.flattenNonAdaValue(n))))}}));var n}))(n))}},Ge={decodeAeson:(n=new ee.TypeMismatch("PParamRaional"),I.caseAesonString(new oe.Left(n))((function(e){var t=be.split("/")(e);return 2===t.length?oe.note(n)(x.bind(ve.bindMaybe)(re.fromString(t[0]))((function(e){return x.bind(ve.bindMaybe)(re.fromString(t[1]))((function(n){return ce.map(ve.functorMaybe)(Me)(j.reduce(j.rationalComponentBigInt)(e)(n))}))}))):new oe.Left(n)})))},Ze={decodeAeson:I.caseAesonString(new oe.Left(new ee.TypeMismatch("Timestamp string")))((t=ce.map(oe.functorEither)(pe.wrap()),r=te.lmap(te.bifunctorEither)(ee.TypeMismatch.create),function(e){return t(r(X.sysStartFromOgmiosTimestamp(e)))}))},Xe=I.decodeAesonString,Ye={decodeAeson:function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonObject(I.decodeAesonObject(I.decodeAesonAeson)))(e))((function(e){return x.bind(oe.bindEither)(Ae.for(oe.applicativeEither)(Ae.traversableArray)(Te.toUnfoldable(Ie.unfoldableArray)(e))((function(e){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(ce.map(ve.functorMaybe)(k.Coin))(I["getFieldOptional'"](I.decodeAesonBigInt)(e.value1)("rewards")))((function(n){return x.bind(oe.bindEither)(I["getFieldOptional'"](B.decodeAesonPoolPubKeyHash)(e.value1)("delegate"))((function(t){return F.pure(oe.applicativeEither)(new Se.Tuple(e.value0,{rewards:n,delegate:t}))}))}))})))((function(e){return F.pure(oe.applicativeEither)(de.fromFoldable(ge.ordString)(ue.foldableArray)(e))}))}))}},$e=I.decodeAesonBigInt,en=I.decodeAesonString,nn={decodeAeson:function(e){return x.bind(oe.bindEither)(I.decodeAeson(I["decodeAeson|+|"]()(en)(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(Xe))(I.gDecodeAesonCons(I.decodeAesonField1(U.decodeAesonSlot))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"slot"}})()())({reflectSymbol:function(){return"hash"}})()())()))(e))((function(e){return F.pure(oe.applicativeEither)(oe.either(Oe.create)(We.create)(Fe.toEither1(Ve)(e)))}))}},tn=new ee.TypeMismatch("Expected redeemer pointer to be encoded as: ^(spend|mint|certificate|withdrawal):[0-9]+$"),rn=function(e){return x.bind(ve.bindMaybe)(q.fromBigInt(j.numerator(e)))((function(n){return x.bind(ve.bindMaybe)(q.fromBigInt(j.denominator(e)))((function(e){return F.pure(ve.applicativeMaybe)({numerator:n,denominator:e})}))}))},on={decodeAeson:function(e){var n=function(e){return{mem:e.memory,steps:e.steps}};return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonFieldMaybe(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonFieldMaybe(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"verifyEd25519Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"unMapData-memory-arguments"}})()())({reflectSymbol:function(){return"unMapData-cpu-arguments"}})()())({reflectSymbol:function(){return"unListData-memory-arguments"}})()())({reflectSymbol:function(){return"unListData-cpu-arguments"}})()())({reflectSymbol:function(){return"unIData-memory-arguments"}})()())({reflectSymbol:function(){return"unIData-cpu-arguments"}})()())({reflectSymbol:function(){return"unConstrData-memory-arguments"}})()())({reflectSymbol:function(){return"unConstrData-cpu-arguments"}})()())({reflectSymbol:function(){return"unBData-memory-arguments"}})()())({reflectSymbol:function(){return"unBData-cpu-arguments"}})()())({reflectSymbol:function(){return"trace-memory-arguments"}})()())({reflectSymbol:function(){return"trace-cpu-arguments"}})()())({reflectSymbol:function(){return"tailList-memory-arguments"}})()())({reflectSymbol:function(){return"tailList-cpu-arguments"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sndPair-memory-arguments"}})()())({reflectSymbol:function(){return"sndPair-cpu-arguments"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha3_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha2_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"nullList-memory-arguments"}})()())({reflectSymbol:function(){return"nullList-cpu-arguments"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"mkPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkCons-memory-arguments"}})()())({reflectSymbol:function(){return"mkCons-cpu-arguments"}})()())({reflectSymbol:function(){return"mapData-memory-arguments"}})()())({reflectSymbol:function(){return"mapData-cpu-arguments"}})()())({reflectSymbol:function(){return"listData-memory-arguments"}})()())({reflectSymbol:function(){return"listData-cpu-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lengthOfByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lengthOfByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"indexByteString-memory-arguments"}})()())({reflectSymbol:function(){return"indexByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-memory-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-cpu-arguments"}})()())({reflectSymbol:function(){return"iData-memory-arguments"}})()())({reflectSymbol:function(){return"iData-cpu-arguments"}})()())({reflectSymbol:function(){return"headList-memory-arguments"}})()())({reflectSymbol:function(){return"headList-cpu-arguments"}})()())({reflectSymbol:function(){return"fstPair-memory-arguments"}})()())({reflectSymbol:function(){return"fstPair-cpu-arguments"}})()())({reflectSymbol:function(){return"equalsString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"equalsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsData-memory-arguments"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"constrData-memory-arguments"}})()())({reflectSymbol:function(){return"constrData-cpu-arguments"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"chooseUnit-memory-arguments"}})()())({reflectSymbol:function(){return"chooseUnit-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseList-memory-arguments"}})()())({reflectSymbol:function(){return"chooseList-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseData-memory-arguments"}})()())({reflectSymbol:function(){return"chooseData-cpu-arguments"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"blake2b_256-memory-arguments"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"bData-memory-arguments"}})()())({reflectSymbol:function(){return"bData-cpu-arguments"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-intercept"}})()())()))(I.gDecodeAesonCons(I.decodeAesonFieldMaybe(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"verifyEcdsaSecp256k1Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifyEcdsaSecp256k1Signature-cpu-arguments"}})()())({reflectSymbol:function(){return"unMapData-memory-arguments"}})()())({reflectSymbol:function(){return"unMapData-cpu-arguments"}})()())({reflectSymbol:function(){return"unListData-memory-arguments"}})()())({reflectSymbol:function(){return"unListData-cpu-arguments"}})()())({reflectSymbol:function(){return"unIData-memory-arguments"}})()())({reflectSymbol:function(){return"unIData-cpu-arguments"}})()())({reflectSymbol:function(){return"unConstrData-memory-arguments"}})()())({reflectSymbol:function(){return"unConstrData-cpu-arguments"}})()())({reflectSymbol:function(){return"unBData-memory-arguments"}})()())({reflectSymbol:function(){return"unBData-cpu-arguments"}})()())({reflectSymbol:function(){return"trace-memory-arguments"}})()())({reflectSymbol:function(){return"trace-cpu-arguments"}})()())({reflectSymbol:function(){return"tailList-memory-arguments"}})()())({reflectSymbol:function(){return"tailList-cpu-arguments"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sndPair-memory-arguments"}})()())({reflectSymbol:function(){return"sndPair-cpu-arguments"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha3_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha2_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"serialiseData-memory-arguments-slope"}})()())({reflectSymbol:function(){return"serialiseData-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"serialiseData-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"serialiseData-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"nullList-memory-arguments"}})()())({reflectSymbol:function(){return"nullList-cpu-arguments"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"mkPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkCons-memory-arguments"}})()())({reflectSymbol:function(){return"mkCons-cpu-arguments"}})()())({reflectSymbol:function(){return"mapData-memory-arguments"}})()())({reflectSymbol:function(){return"mapData-cpu-arguments"}})()())({reflectSymbol:function(){return"listData-memory-arguments"}})()())({reflectSymbol:function(){return"listData-cpu-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lengthOfByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lengthOfByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"indexByteString-memory-arguments"}})()())({reflectSymbol:function(){return"indexByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-memory-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-cpu-arguments"}})()())({reflectSymbol:function(){return"iData-memory-arguments"}})()())({reflectSymbol:function(){return"iData-cpu-arguments"}})()())({reflectSymbol:function(){return"headList-memory-arguments"}})()())({reflectSymbol:function(){return"headList-cpu-arguments"}})()())({reflectSymbol:function(){return"fstPair-memory-arguments"}})()())({reflectSymbol:function(){return"fstPair-cpu-arguments"}})()())({reflectSymbol:function(){return"equalsString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"equalsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsData-memory-arguments"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"constrData-memory-arguments"}})()())({reflectSymbol:function(){return"constrData-cpu-arguments"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"chooseUnit-memory-arguments"}})()())({reflectSymbol:function(){return"chooseUnit-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseList-memory-arguments"}})()())({reflectSymbol:function(){return"chooseList-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseData-memory-arguments"}})()())({reflectSymbol:function(){return"chooseData-cpu-arguments"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"blake2b_256-memory-arguments"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"bData-memory-arguments"}})()())({reflectSymbol:function(){return"bData-cpu-arguments"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-intercept"}})()())()))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"plutus:v2"}})()())({reflectSymbol:function(){return"plutus:v1"}})()())()))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"steps"}})()())({reflectSymbol:function(){return"memory"}})()())()))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"steps"}})()())({reflectSymbol:function(){return"memory"}})()())()))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(Ge))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(Ge))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(Ge))(I.gDecodeAesonCons(I.decodeAesonField1(Ge))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"steps"}})()())({reflectSymbol:function(){return"memory"}})()())()))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"minor"}})()())({reflectSymbol:function(){return"major"}})()())()))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(Ge))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"treasuryExpansion"}})()())({reflectSymbol:function(){return"stakeKeyDeposit"}})()())({reflectSymbol:function(){return"protocolVersion"}})()())({reflectSymbol:function(){return"prices"}})()())({reflectSymbol:function(){return"poolRetirementEpochBound"}})()())({reflectSymbol:function(){return"poolInfluence"}})()())({reflectSymbol:function(){return"poolDeposit"}})()())({reflectSymbol:function(){return"monetaryExpansion"}})()())({reflectSymbol:function(){return"minPoolCost"}})()())({reflectSymbol:function(){return"minFeeConstant"}})()())({reflectSymbol:function(){return"minFeeCoefficient"}})()())({reflectSymbol:function(){return"maxValueSize"}})()())({reflectSymbol:function(){return"maxTxSize"}})()())({reflectSymbol:function(){return"maxExecutionUnitsPerTransaction"}})()())({reflectSymbol:function(){return"maxExecutionUnitsPerBlock"}})()())({reflectSymbol:function(){return"maxCollateralInputs"}})()())({reflectSymbol:function(){return"maxBlockHeaderSize"}})()())({reflectSymbol:function(){return"maxBlockBodySize"}})()())({reflectSymbol:function(){return"desiredNumberOfPools"}})()())({reflectSymbol:function(){return"costModels"}})()())({reflectSymbol:function(){return"collateralPercentage"}})()())({reflectSymbol:function(){return"coinsPerUtxoWord"}})()())({reflectSymbol:function(){return"coinsPerUtxoByte"}})()())())(e))((function(e){return x.bind(oe.bindEither)((t=e,oe.note(new ee.TypeMismatch("ExUnitPrices"))(x.bind(ve.bindMaybe)(rn(t.prices.memory))((function(e){return x.bind(ve.bindMaybe)(rn(t.prices.steps))((function(n){return F.pure(ve.applicativeMaybe)({memPrice:e,stepPrice:n})}))})))))((function(t){return x.bind(oe.bindEither)(ve.maybe(new oe.Left(new ee.AtKey("coinsPerUtxoByte or coinsPerUtxoWord",ee.MissingValue.value)))(F.pure(oe.applicativeEither))(T.alt(ve.altMaybe)(ce.map(ve.functorMaybe)((function(e){return J.CoinsPerUtxoByte.create(k.Coin(e))}))(e.coinsPerUtxoByte))(ce.map(ve.functorMaybe)((function(e){return J.CoinsPerUtxoWord.create(k.Coin(e))}))(e.coinsPerUtxoWord))))((function(r){return F.pure(oe.applicativeEither)({protocolVersion:new Se.Tuple(e.protocolVersion.major,e.protocolVersion.minor),decentralization:ye.zero(j.semiringRational),extraPraosEntropy:ve.Nothing.value,maxBlockHeaderSize:e.maxBlockHeaderSize,maxBlockBodySize:e.maxBlockBodySize,maxTxSize:e.maxTxSize,txFeeFixed:e.minFeeConstant,txFeePerByte:e.minFeeCoefficient,stakeAddressDeposit:e.stakeKeyDeposit,stakePoolDeposit:e.poolDeposit,minPoolCost:e.minPoolCost,poolRetireMaxEpoch:e.poolRetirementEpochBound,stakePoolTargetNum:e.desiredNumberOfPools,poolPledgeInfluence:pe.unwrap()(e.poolInfluence),monetaryExpansion:pe.unwrap()(e.monetaryExpansion),treasuryCut:pe.unwrap()(e.treasuryExpansion),coinsPerUtxoUnit:r,costModels:de.fromFoldable(Z.ordLanguage)(ue.foldableArray)(ne.catMaybes([F.pure(ve.applicativeMaybe)(new Se.Tuple(Z.PlutusV1.value,J.convertPlutusV1CostModel(e.costModels["plutus:v1"]))),ce.map(ve.functorMaybe)((function(e){return n=J.convertPlutusV2CostModel(e),new Se.Tuple(Z.PlutusV2.value,n);var n}))(e.costModels["plutus:v2"])])),prices:t,maxTxExUnits:n(e.maxExecutionUnitsPerTransaction),maxBlockExUnits:n(e.maxExecutionUnitsPerBlock),maxValueSize:e.maxValueSize,collateralPercent:e.collateralPercentage,maxCollateralInputs:e.maxCollateralInputs})}))}));var t}))}},an=function(e){return _.mkCallType(e)({type:"jsonwsp/request",version:"1.0",servicename:"ogmios"})},un=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:ie.const({query:"chainTip"})}),cn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:ie.const({query:"currentEpoch"})}),ln=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonArray(I.encodeAesonString))(I.gEncodeAesonNil)({reflectSymbol:function(){return"delegationsAndRewards"}})())())(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:function(e){return{query:{delegationsAndRewards:e}}}}),sn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:ie.const({query:"eraSummaries"})}),fn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:ie.const({query:"poolIds"})}),dn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:ie.const({query:"currentProtocolParameters"})}),vn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:ie.const({query:"systemStart"})}),mn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"submit"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"SubmitTx",args:function(e){return{submit:W.cborBytesToHex(Se.snd(e))}}}),pn=function(e){return function(n){return function(t){return x.composeKleisli(oe.bindEither)(ie.flip(I.getField(e))(n))(t)}}},gn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(Qe)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"evaluate"}})())({reflectSymbol:function(){return"additionalUtxoSet"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"EvaluateTx",args:function(e){return{evaluate:W.cborBytesToHex(e.value0),additionalUtxoSet:e.value1}}}),yn=function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonString)(e))((function(e){var n=be.split("/")(e);return 2===n.length?x.bind(oe.bindEither)(oe.note(new ee.TypeMismatch("BigNum"))(q.fromString(n[0])))((function(e){return x.bind(oe.bindEither)(oe.note(new ee.TypeMismatch("BigNum"))(q.fromString(n[1])))((function(n){return F.pure(oe.applicativeEither)({numerator:e,denominator:n})}))})):new oe.Left(new ee.TypeMismatch("UnitInterval"))}))},wn=function(e){return oe.note(tn)(2===(n=be.split(":")(e)).length?E.apply(ve.applyMaybe)(ce.map(ve.functorMaybe)((function(e){return function(n){return{redeemerTag:e,redeemerIndex:n}}}))(Q.fromString(n[0])))(z.fromString(n[1])):ve.Nothing.value);var n},hn=function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonObject(I.decodeAesonAeson))(e))((function(e){return x.bind(oe.bindEither)(x.bind(oe.bindEither)(I.getField(I.decodeAesonString)(e)("hash"))((n=oe.note(new ee.TypeMismatch("PoolMetadataHash")),t=ce.map(ve.functorMaybe)(B.PoolMetadataHash),function(e){return n(t(O.hexToByteArray(e)))})))((function(n){return x.bind(oe.bindEither)(ce.mapFlipped(oe.functorEither)(I.getField(I.decodeAesonString)(e)("url"))(B.URL))((function(e){return F.pure(oe.applicativeEither)({hash:n,url:e})}))}));var n,t}))},bn=function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonString)(e))((n=oe.note(new ee.TypeMismatch("Ipv6")),function(e){return n((t=e,r=be.split(":")(t),o=ne.length(r)<8?x.bind(x.bindArray)(r)((function(e){return""===e?ne.replicate(1+(8-ne.length(r)|0)|0)(""):F.pure(F.applicativeArray)(e)})):r,x.discard(x.discardUnit)(ve.bindMaybe)(D.guard(ve.alternativeMaybe)(8===ne.length(o)))((function(){var e=be.replaceAll(" ")("0")(ue.fold(ue.foldableArray)(me.monoidString)(ce.mapFlipped(ce.functorArray)(o)(Ce.padStart(4))));return ce.map(ve.functorMaybe)(B.Ipv6)(O.hexToByteArray(e))}))));var t,r,o}));var n},Cn=function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonString)(e))((function(e){var n,t=be.split(".")(e);return 4===t.length?x.bind(oe.bindEither)(Ae.for(oe.applicativeEither)(Ae.traversableArray)(t)((n=oe.note(new ee.TypeMismatch("Ipv4")),function(e){return n(se.fromString(e))})))((function(e){return ce.map(oe.functorEither)(B.Ipv4)(oe.note(new ee.TypeMismatch("Ipv4"))(O.byteArrayFromIntArray(e)))})):new oe.Left(new ee.TypeMismatch("Ipv4"))}))},An=function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonObject(I.decodeAesonAeson))(e))((function(e){var n=x.bind(oe.bindEither)(I.getField(I.decodeAesonMaybe(I.decodeAesonInt))(e)("port"))((function(n){return x.bind(oe.bindEither)(I.getField(I.decodeAesonString)(e)("hostname"))((function(e){return F.pure(oe.applicativeEither)(new B.SingleHostName({port:n,dnsName:e}))}))})),t=x.bind(oe.bindEither)(I["getFieldOptional'"](I.decodeAesonInt)(e)("port"))((function(n){return x.bind(oe.bindEither)(x.bind(oe.bindEither)(I["getFieldOptional'"](I.decodeAesonAeson)(e)("ipv4"))(Ae.traverse(Ae.traversableMaybe)(oe.applicativeEither)(Cn)))((function(t){return x.bind(oe.bindEither)(x.bind(oe.bindEither)(I["getFieldOptional'"](I.decodeAesonAeson)(e)("ipv6"))(Ae.traverse(Ae.traversableMaybe)(oe.applicativeEither)(bn)))((function(e){return F.pure(oe.applicativeEither)(new B.SingleHostAddr({port:n,ipv4:t,ipv6:e}))}))}))})),r=x.bind(oe.bindEither)(I.getField(I.decodeAesonString)(e)("hostname"))((function(e){return F.pure(oe.applicativeEither)(new B.MultiHostName({dnsName:e}))}));return T.alt(oe.altEither)(T.alt(oe.altEither)(n)(t))(r)}))},Sn={decodeAeson:function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonObject(I.decodeAesonObject(I.decodeAesonAeson)))(e))((function(e){return x.bind(oe.bindEither)(Ae.for(oe.applicativeEither)(Ae.traversableArray)(Te.toUnfoldable(Ie.unfoldableArray)(e))((function(e){return x.bind(oe.bindEither)(I.getField(I.decodeAesonString)(e.value1)("vrf"))((function(n){return x.bind(oe.bindEither)(oe.note(new ee.TypeMismatch("VRFKeyHash"))(O.hexToByteArray(n)))((function(n){return x.bind(oe.bindEither)(oe.note(new ee.TypeMismatch("VRFKeyHash"))(ce.map(ve.functorMaybe)($.VRFKeyHash)(N.fromBytes(N.fromBytesVRFKeyHash)(pe.wrap()(n)))))((function(n){return x.bind(oe.bindEither)(I.getField(q.decodeAesonBigNum)(e.value1)("pledge"))((function(t){return x.bind(oe.bindEither)(I.getField(q.decodeAesonBigNum)(e.value1)("cost"))((function(r){return x.bind(oe.bindEither)(x.bindFlipped(oe.bindEither)(yn)(I.getField(I.decodeAesonAeson)(e.value1)("margin")))((function(o){return x.bind(oe.bindEither)(I.getField(G.decodeAesonRewardAddress)(e.value1)("rewardAccount"))((function(a){return x.bind(oe.bindEither)(I.getField(I.decodeAesonArray(H.decodeAesonEd25519KeyHash))(e.value1)("owners"))((function(u){return x.bind(oe.bindEither)(I.getField(I.decodeAesonArray(I.decodeAesonAeson))(e.value1)("relays"))((function(i){return x.bind(oe.bindEither)(Ae.for(oe.applicativeEither)(Ae.traversableArray)(i)(An))((function(i){return x.bind(oe.bindEither)(x.bind(oe.bindEither)(I["getFieldOptional'"](I.decodeAesonAeson)(e.value1)("metadata"))(Ae.traverse(Ae.traversableMaybe)(oe.applicativeEither)(hn)))((function(c){return F.pure(oe.applicativeEither)(new Se.Tuple(e.value0,{vrfKeyhash:n,pledge:t,cost:r,margin:o,rewardAccount:a,poolOwners:u,relays:i,poolMetadata:c}))}))}))}))}))}))}))}))}))}))}))}))})))((function(e){return F.pure(oe.applicativeEither)(de.fromFoldable(ge.ordString)(ue.foldableArray)(e))}))}))}},In=I.caseAesonObject(new oe.Left(new ee.TypeMismatch("Expected Object"))),Tn={decodeAeson:(o=ce.map(oe.functorEither)((function(e){return e})),a=In(x.composeKleisli(oe.bindEither)(ie.flip(I.getField(I.decodeAesonObject(I.decodeAesonAeson)))("AwaitAcquired"))(ie.flip(I.getField(U.decodeAesonSlot))("slot"))),function(e){return o(a(e))})},Dn={decodeAeson:(u=ie.const(new oe.Left(new ee.TypeMismatch("Expected ScriptFailure"))),i=pn(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonString))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonArray(I.decodeAesonString)))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"traces"}})()())({reflectSymbol:function(){return"error"}})()())())("validatorFailed")((function(e){return F.pure(oe.applicativeEither)(new ke(e))})),c=pn(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonString))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"txId"}})()())({reflectSymbol:function(){return"index"}})()())())("unknownInputReferencedByRedeemer")((function(e){return F.pure(oe.applicativeEither)(new Ne(e))})),l=pn(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonString))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"txId"}})()())({reflectSymbol:function(){return"index"}})()())())("nonScriptInputReferencedByRedeemer")((function(e){return F.pure(oe.applicativeEither)(new Le(e))})),s=pn(I.decodeAesonString)("noCostModelForLanguage")((function(e){return F.pure(oe.applicativeEither)(new Ue(e))})),f=pn(I.decodeAesonObject(I.decodeAesonAeson))("missingRequiredScripts")((function(e){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(Te.toUnfoldable(Ie.unfoldableArray))(I.getField(I.decodeAesonObject(I.decodeAesonString))(e)("resolved")))((function(n){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(de.fromFoldable(ge.ordRecord()(ge.ordRecordCons(ge.ordRecordCons(ge.ordRecordNil)()({reflectSymbol:function(){return"redeemerTag"}})(Q.ordRedeemerTag))()({reflectSymbol:function(){return"redeemerIndex"}})(z.ordNatural)))(ue.foldableArray))(Ae.for(oe.applicativeEither)(Ae.traversableArray)(n)((function(e){return ce.map(oe.functorEither)((function(n){return new Se.Tuple(n,e.value1)}))(wn(e.value0))}))))((function(n){return x.bind(oe.bindEither)(I.getField(I.decodeAesonArray(I.decodeAesonString))(e)("missing"))((function(e){return F.pure(oe.applicativeEither)(new Be({resolved:n,missing:e}))}))}))}))})),d=pn(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonArray(I.decodeAesonString)))(I.gDecodeAesonCons(I.decodeAesonFieldMaybe(I.decodeAesonArray(I.decodeAesonString)))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"provided"}})()())({reflectSymbol:function(){return"missing"}})()())())("missingRequiredDatums")((function(e){return F.pure(oe.applicativeEither)(new Pe(e))})),v=pn(I.decodeAesonMaybe(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(z.decodeAesonNatural))(I.gDecodeAesonCons(I.decodeAesonField1(z.decodeAesonNatural))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"steps"}})()())({reflectSymbol:function(){return"memory"}})()())()))("illFormedExecutionBudget")((function(e){return F.pure(oe.applicativeEither)(new _e(e))})),m=ce.map(M.functorReaderT(oe.functorEither))(Re.create)(pn(I.decodeAesonArray(I.decodeAesonString))("extraRedeemers")(Ae.traverse(Ae.traversableArray)(oe.applicativeEither)(wn))),p=T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(m)(d))(f))(i))(c))(l))(v))(s))(u),In(M.runReaderT(p)))},Fn={decodeAeson:In((function(e){return T.alt(oe.altEither)(x.bind(oe.bindEither)(x.bind(oe.bindEither)(I.getField(I.decodeAesonObject(I.decodeAesonAeson))(e)("SubmitSuccess"))(ie.flip(I.getField(I.decodeAesonString))("txId")))((t=ve.maybe(new oe.Left(new ee.TypeMismatch("Expected hexstring")))((n=F.pure(oe.applicativeEither),function(e){return n(Ee.create(e))})),function(e){return t(O.hexToByteArray(e))})))(ce.map(oe.functorEither)(xe.create)(I.getField(I.decodeAesonArray(I.decodeAesonAeson))(e)("SubmitFail")));var n,t}))},En={decodeAeson:function(){var e=T.alt(M.altReaderT(oe.altEither))((function(e){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(Te.toUnfoldable(Ie.unfoldableArray))(x.bind(oe.bindEither)(I.getField(I.decodeAesonObject(I.decodeAesonAeson))(e)("EvaluationFailure"))(ie.flip(I.getField(I.decodeAesonObject(I.decodeAesonAeson)))("ScriptFailures"))))((function(e){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(de.fromFoldable(ge.ordRecord()(ge.ordRecordCons(ge.ordRecordCons(ge.ordRecordNil)()({reflectSymbol:function(){return"redeemerTag"}})(Q.ordRedeemerTag))()({reflectSymbol:function(){return"redeemerIndex"}})(z.ordNatural)))(ue.foldableArray))(Ae.for(oe.applicativeEither)(Ae.traversableArray)(e)((function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonArray(Dn))(e.value1))((function(n){return ce.map(oe.functorEither)((function(e){return new Se.Tuple(e,n)}))(wn(e.value0))}))}))))((function(e){return F.pure(oe.applicativeEither)(new qe(e))}))}))}))((function(e){return F.pure(oe.applicativeEither)(new He(I.stringifyAeson(I.encodeAeson(I.encodeAesonObject(I.encodeAesonAeson))(e))))}));return In(M.runReaderT(e))}()},xn={decodeAeson:(g=function(e){return x.bind(oe.bindEither)(wn(e.value0))((function(n){return ie.flip(In)(e.value1)((function(e){return x.bind(oe.bindEither)(I.getField(z.decodeAesonNatural)(e)("memory"))((function(t){return x.bind(oe.bindEither)(I.getField(z.decodeAesonNatural)(e)("steps"))((function(e){return F.pure(oe.applicativeEither)(new Se.Tuple(n,{memory:t,steps:e}))}))}))}))}))},In((function(e){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(Te.toUnfoldable(Ie.unfoldableArray))(I.getField(I.decodeAesonObject(I.decodeAesonAeson))(e)("EvaluationResult")))((function(e){return ce.map(oe.functorEither)((n=de.fromFoldable(ge.ordRecord()(ge.ordRecordCons(ge.ordRecordCons(ge.ordRecordNil)()({reflectSymbol:function(){return"redeemerTag"}})(Q.ordRedeemerTag))()({reflectSymbol:function(){return"redeemerIndex"}})(z.ordNatural)))(ue.foldableArray),function(e){return n(e)}))(Ae.traverse(Ae.traversableArray)(oe.applicativeEither)(g)(e));var n}))})))},Mn={decodeAeson:function(e){return T.alt(oe.altEither)(ce.map(oe.functorEither)((t=pe.wrap(),function(e){return t(oe.Right.create(e))}))(I.decodeAeson(xn)(e)))(ce.map(oe.functorEither)((n=pe.wrap(),function(e){return n(oe.Left.create(e))}))(I.decodeAeson(En)(e)));var n,t}},Rn=I.caseAesonArray(new oe.Left(new ee.TypeMismatch("Expected Array"))),Pn={decodeAeson:(C=function(e){return x.bind(oe.bindEither)(I.getField(V.decodeAesonEpochLength)(e)("epochLength"))((function(n){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(pe.wrap())(ce.map(oe.functorEither)(ye.mul(ye.semiringNumber)(1e3))(I.getField(I.decodeAesonNumber)(e)("slotLength"))))((function(t){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(ve.fromMaybe(ye.zero(V.semiringSafeZone)))(I.getField(I.decodeAesonMaybe(V.decodeAesonSafeZone))(e)("safeZone")))((function(e){return F.pure(oe.applicativeEither)(pe.wrap()({epochLength:n,slotLength:t,safeZone:e}))}))}))}))},A=In((function(e){return x.bind(oe.bindEither)(I.getField(V.decodeAesonEraSummaryTime)(e)("start"))((function(n){return x.bind(oe.bindEither)(I.getField(I.decodeAesonAeson)(e)("end"))((function(t){return x.bind(oe.bindEither)(I.isNull(t)?F.pure(oe.applicativeEither)(ve.Nothing.value):ce.map(oe.functorEither)(ve.Just.create)(I.decodeAeson(V.decodeAesonEraSummaryTime)(t)))((function(t){return x.bind(oe.bindEither)(x.bindFlipped(oe.bindEither)(C)(I.getField(I.decodeAesonObject(I.decodeAesonAeson))(e)("parameters")))((function(e){return F.pure(oe.applicativeEither)(pe.wrap()({start:n,end:t,parameters:e}))}))}))}))}))})),Rn((h=ce.map(oe.functorEither)((y=pe.wrap(),w=pe.wrap(),function(e){return y(w(e))})),b=Ae.traverse(Ae.traversableArray)(oe.applicativeEither)(A),function(e){return h(b(e))})))},Bn=("AwaitAcquire",an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonNil)())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"AwaitAcquire",args:ie.const({})}));S.CtChainOrigin=Oe,S.CtChainPoint=We,S.ExtraRedeemers=Re,S.MissingRequiredDatums=Pe,S.MissingRequiredScripts=Be,S.ValidatorFailed=ke,S.UnknownInputReferencedByRedeemer=Ne,S.NonScriptInputReferencedByRedeemer=Le,S.IllFormedExecutionBudget=_e,S.NoCostModelForLanguage=Ue,S.SubmitTxSuccess=Ee,S.SubmitFail=xe,S.UnparsedError=He,S.ScriptFailures=qe,S.acquireMempoolSnapshotCall=Bn,S.aesonObject=In,S.evaluateTxCall=gn,S.queryPoolIdsCall=fn,S.mempoolSnapshotHasTxCall=function(e){return an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(O.encodeAesonByteArray)(I.gEncodeAesonNil)({reflectSymbol:function(){return"id"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"HasTx",args:function(e){return{id:e}}})},S.queryChainTipCall=un,S.queryCurrentEpochCall=cn,S.queryEraSummariesCall=sn,S.queryProtocolParametersCall=dn,S.querySystemStartCall=vn,S.queryDelegationsAndRewards=ln,S.submitTxCall=mn,S.slotLengthFactor=1e3,S.decodeAesonMempoolSnapsho=Tn,S.decodeAesonSubmitTxR=Fn,S.decodeAesonOgmiosSystemSt=Ze,S.decodeAesonCurrentEpoch=$e,S.decodeAesonOgmiosEraSumma=Pn,S.decodeAesonDelegationsAnd=Ye,S.decodeAesonPoolParameters=Sn,S.decodeAesonTxEvaluationR=Mn,S.showTxEvaluationFailure=je,S.decodeAesonOgmiosProtocol=on,S.decodeAesonChainTipQR=nn}(c),function(e){"use strict";e["Ctl.Internal.ServerConfig"]=e["Ctl.Internal.ServerConfig"]||{};var n=e["Ctl.Internal.ServerConfig"],t=e["Ctl.Internal.Helpers"],r=e["Data.Maybe"],o=e["Data.UInt"],a=function(e){return function(n){return(n.secure?e+"s":e)+"://"+n.host+":"+t.concatPaths(o.toString(n.port))(r.fromMaybe("")(n.path))}},u=a("ws"),i=a("http"),c={port:o.fromInt(1337),host:"localhost",secure:!1,path:r.Nothing.value},l={port:o.fromInt(4008),host:"localhost",secure:!1,path:new r.Just("kupo")};n.defaultKupoServerConfig=l,n.defaultOgmiosWsConfig=c,n.mkHttpUrl=i,n.mkWsUrl=u}(c),function(e){"use strict";e["Ctl.Internal.Service.Error"]=e["Ctl.Internal.Service.Error"]||{};var n=e["Ctl.Internal.Service.Error"],t=e.Aeson,r=e.Affjax,o=e["Affjax.StatusCode"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.Service.Helpers"],c=e["Data.Argonaut.Decode.Error"],l=e["Data.Either"],s=e["Data.Generic.Rep"],f=e["Data.Show"],d=e["Data.Show.Generic"],v=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),m=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),p=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),g=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),y=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),w=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),h=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),b={to:function(e){if(e instanceof s.Inl)return new v(e.value0);if(e instanceof s.Inr)return new m(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Service.Error (line 87, column 1 - line 87, column 39): "+[e.constructor.name])},from:function(e){if(e instanceof v)return new s.Inl(e.value0);if(e instanceof m)return new s.Inr(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Service.Error (line 87, column 1 - line 87, column 39): "+[e.constructor.name])}},C={show:d.genericShow({to:function(e){return e},from:function(e){return e}})(d.genericShowConstructor(d.genericShowArgsArgument(f.showRecord()(f.showRecordFieldsCons({reflectSymbol:function(){return"error"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"message"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"statusCode"}})(f.showRecordFieldsNil)(f.showInt))(f.showString))(f.showString))))({reflectSymbol:function(){return"BlockfrostError"}}))},A={show:d.genericShow(b)(d.genericShowSum(d.genericShowConstructor(d.genericShowArgsArgument(C))({reflectSymbol:function(){return"ServiceBlockfrostError"}}))(d.genericShowConstructor(d.genericShowArgsArgument(f.showString))({reflectSymbol:function(){return"ServiceOtherError"}})))},S={show:function(e){if(e instanceof p)return"(ClientHttpError "+r.printError(e.value0)+")";if(e instanceof g)return"(ClientHttpResponseError "+f.show(o.showStatusCode)(e.value0)+" "+f.show(A)(e.value1)+")";if(e instanceof y)return"(ClientDecodeJsonError ("+f.show(f.showString)(e.value0)+") "+f.show(c.showJsonDecodeError)(e.value1)+")";if(e instanceof w)return"(ClientEncodingError "+e.value0+")";if(e instanceof h)return"(ClientOtherError "+e.value0+")";throw new Error("Failed pattern match at Ctl.Internal.Service.Error (line 54, column 1 - line 76, column 13): "+[e.constructor.name])}},I={decodeAeson:i.aesonObject((function(e){return u.bind(l.bindEither)(t.getField(t.decodeAesonInt)(e)("status_code"))((function(n){return u.bind(l.bindEither)(t.getField(t.decodeAesonString)(e)("error"))((function(r){return u.bind(l.bindEither)(t.getField(t.decodeAesonString)(e)("message"))((function(e){return a.pure(l.applicativeEither)({statusCode:n,error:r,message:e})}))}))}))}))};n.ClientHttpError=p,n.ClientHttpResponseError=g,n.ClientDecodeJsonError=y,n.ClientOtherError=h,n.ServiceBlockfrostError=v,n.ServiceOtherError=m,n.showClientError=S,n.decodeAesonBlockfrostErro=I}(c),function(e){"use strict";e["Ctl.Internal.Types.Chain"]=e["Ctl.Internal.Types.Chain"]||{};var n=e["Ctl.Internal.Types.Chain"],t=function(){function e(){}return e.value=new e,e}(),r=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}();n.TipAtGenesis=t,n.Tip=r}(c),function(e){"use strict";e["Ctl.Internal.QueryM"]=e["Ctl.Internal.QueryM"]||{};var n,t,r,o,a,u,i=e["Ctl.Internal.QueryM"],c=e.Aeson,l=e["Control.Applicative"],s=e["Control.Bind"],f=e["Control.Category"],d=e["Control.Monad.Error.Class"],v=e["Control.Monad.Reader.Class"],m=e["Control.Monad.Reader.Trans"],p=e["Control.Parallel.Class"],g=e["Ctl.Internal.Cardano.Types.Transaction"],y=e["Ctl.Internal.Helpers"],w=e["Ctl.Internal.JsWebSocket"],h=e["Ctl.Internal.Logging"],b=e["Ctl.Internal.QueryM.Dispatcher"],C=e["Ctl.Internal.QueryM.JsonWsp"],A=e["Ctl.Internal.QueryM.Ogmios"],S=e["Ctl.Internal.ServerConfig"],I=e["Ctl.Internal.Service.Error"],T=e["Ctl.Internal.Types.ByteArray"],D=e["Ctl.Internal.Types.Chain"],F=e["Data.Argonaut.Decode.Error"],E=e["Data.Bifunctor"],x=e["Data.Boolean"],M=e["Data.Either"],R=e["Data.Eq"],P=e["Data.Foldable"],B=e["Data.Function"],k=e["Data.Functor"],N=e["Data.Log.Level"],L=e["Data.Map.Internal"],_=e["Data.Maybe"],U=e["Data.Newtype"],H=e["Data.Ord"],q=e["Data.Show"],O=e["Data.Tuple"],W=e["Data.Unfoldable"],V=e["Data.Unit"],K=e.Effect,z=e["Effect.Aff"],J=e["Effect.Aff.Class"],j=e["Effect.Class"],Q=e["Effect.Exception"],G=e["Effect.Ref"],Z=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),X=m.monadReaderT(z.monadAff),Y=m.monadEffectReader(z.monadEffectAff),$=m.monadAskReaderT(z.monadAff),ee=J.monadAffReader(J.monadAffAff),ne=function(e){return m.functorReaderT(e)},te=function(e){return m.bindReaderT(e)},re={log:function(e){return s.bind(te(z.bindAff))(v.asks($)((function(e){return e.config})))((function(n){var t=_.fromMaybe(y.logWithLevel(z.monadEffectAff))(n.customLogger);return J.liftAff(ee)(t(n.logLevel)(e))}))},MonadEffect0:function(){return Y}},oe=function(e){return m.applicativeReaderT(e)},ae={parallel:(o=U.wrap(),a=p.parallel(p.monadParReaderT(z.parallelAff)),u=U.unwrap(),function(e){return o(a(u(e)))}),sequential:(n=U.wrap(),t=p.sequential(p.monadParReaderT(z.parallelAff)),r=U.unwrap(),function(e){return n(t(r(e)))}),Monad0:function(){return X},Applicative1:function(){return oe(z.applicativeParAff)}},ue=function(e){return e.value0},ie=function(e){return function(n){return function(t){return function(r){return function(o){return function(a){return s.bind(z.bindAff)(j.liftEffect(z.monadEffectAff)(C.buildRequest(r)(a)))((function(r){var u=c.stringifyAeson(r.body),i=o(e);return z.makeAff((function(e){return function(){return i.addMessageListener(r.id)((function(n){return function(){return i.removeMessageListener(r.id)(),n instanceof M.Left&&n.value0 instanceof b.ListenerCancelled?V.unit:e(E.lmap(E.bifunctorEither)(b.dispatchErrorToError)(n))()}}))(),i.addRequest(r.id)(new O.Tuple(u,a))(),w._wsSend(n)(t(N.Debug.value))(u)(),function(e){return s.discard(s.discardUnit)(z.bindAff)(j.liftEffect(z.monadEffectAff)(i.removeMessageListener(r.id)))((function(){return j.liftEffect(z.monadEffectAff)(d.throwError(d.monadThrowEffect)(e))}))}}}))}))}}}}}},ce=function(e){return function(n){return function(t){return function(){return G.modify_(L.delete(H.ordString)(t))(e)(),G.modify_(L.delete(H.ordString)(t))(n)()}}}},le=function(e){return function(n){return function(t){return function(r){return B.flip(G.modify_)(n)(L.insert(H.ordString)(t)((function(n){return r(function(){var t=A.aesonObject(B.flip(c.getFieldOptional(e))("result"))(n);if(t instanceof M.Left)return new M.Left(new b.JsonError(t.value0));if(t instanceof M.Right&&t.value0 instanceof _.Just)return new M.Right(t.value0.value0);if(t instanceof M.Right&&t.value0 instanceof _.Nothing)return new M.Left(new b.FaultError(n));throw new Error("Failed pattern match at Ctl.Internal.QueryM (line 667, column 9 - line 670, column 51): "+[t.constructor.name])}())})))}}}},se=function(e){return function(n){return function(t){return{addMessageListener:le(e)(n),removeMessageListener:ce(n)(t),addRequest:function(e){return function(n){return G.modify_(L.insert(H.ordString)(e)(n.value0))(t)}}}}}},fe=function(e){return function(n){return{addMessageListener:le(A.decodeAesonSubmitTxR)(e),removeMessageListener:ce(e)(n),addRequest:function(e){return function(t){return G.modify_(L.insert(H.ordString)(e)(new O.Tuple(t.value0,t.value1.value0)))(n)}}}}},de=function(e){return e.value1},ve=function(e){return ie(de(e))(ue(e))},me=s.bind(te(z.bindAff))(v.asks($)((function(e){return e.config.logLevel})))((function(e){return s.bind(te(z.bindAff))(v.asks($)((function(e){return e.config.customLogger})))((function(n){return l.pure(oe(z.applicativeAff))(h.mkLogger(e)(n))}))})),pe=function(e){return function(n){return function(t){return s.bind(te(z.bindAff))(v.asks($)((function(e){return de(e.runtime.ogmiosWs)})))((function(r){return s.bind(te(z.bindAff))(v.asks($)((function(e){return ue(e.runtime.ogmiosWs)})))((function(o){return function(e){return function(n){return function(t){return function(r){return function(o){return s.bind(te(z.bindAff))(me)((function(a){return J.liftAff(ee)(ie(e)(n)(a)(t)(r)(o))}))}}}}}(r)(o)(e)(n)(t)}))}))}}},ge=k.map(ne(z.functorAff))((function(e){if(e instanceof A.CtChainOrigin)return D.TipAtGenesis.value;if(e instanceof A.CtChainPoint)return new D.Tip(U.wrap()({slot:e.value0.slot,blockHeaderHash:U.wrap()(U.unwrap()(e.value0.hash))}));throw new Error("Failed pattern match at Ctl.Internal.QueryM (line 292, column 25 - line 295, column 52): "+[e.constructor.name])}))(pe(A.queryChainTipCall)((function(e){return e.chainTip}))(V.unit)),ye=new F.TypeMismatch("default error"),we=function(e){return function(n){return function(t){return function(r){return function(o){return function(a){var u=function(e){return function(n){return function(r){return j.liftEffect(z.monadEffectAff)(t(N.Debug.value)(e+": "+q.show(q.showBoolean)(n)+" TxHash: "+q.show(T.showByteArray)(r)))}}};return function(){var i=G.read(a)();return l.unless(K.applicativeEffect)(L.isEmpty(i))(function(e){return function(n){return function(t){return B.flip(z.runAff_)(function(e){return function(n){return ve(e)(n)(A.acquireMempoolSnapshotCall)((function(e){return e.acquireMempool}))(V.unit)}}(e)(n))((function(e){if(e instanceof M.Left)return function(){return n(N.Error.value)("Failed to acquire a mempool snapshot: Error: "+q.show(Q.showError)(e.value0))(),z.launchAff_(t(_.Nothing.value))()};if(e instanceof M.Right)return z.launchAff_(t(new _.Just(e.value0)));throw new Error("Failed pattern match at Ctl.Internal.QueryM (line 339, column 62 - line 345, column 47): "+[e.constructor.name])}))}}}(e)(t)((function(f){if(f instanceof _.Nothing)return j.liftEffect(z.monadEffectAff)(P.traverse_(K.applicativeEffect)(L.foldableMap)((function(e){return r(O.fst(e))}))(i));if(f instanceof _.Just)return s.discard(s.discardUnit)(z.bindAff)(z.delay(U.wrap()(5e3)))((function(){var d=L.toUnfoldable(W.unfoldableArray)(i);return P.for_(z.applicativeAff)(P.foldableArray)(d)((function(i){return(d=f.value0,function(i){return function(f){return function(v){var m=c.encodeAeson(c.encodeAesonRecord(c.gEncodeAesonCons(c.encodeAesonRecord(c.gEncodeAesonCons(c.encodeAesonRecord(c.gEncodeAesonCons(T.encodeAesonByteArray)(c.gEncodeAesonNil)({reflectSymbol:function(){return"txId"}})())())(c.gEncodeAesonNil)({reflectSymbol:function(){return"SubmitSuccess"}})())())(c.gEncodeAesonNil)({reflectSymbol:function(){return"result"}})())())({result:{SubmitSuccess:{txId:v}}});return s.bind(z.bindAff)(function(e){return function(n){return function(t){return ve(e)(n)(A.mempoolSnapshotHasTxCall(t))((function(e){return e.mempoolHasTx}))}}}(e)(t)(d)(v))((function(e){return s.discard(s.discardUnit)(z.bindAff)(u("Tx in the mempool")(e)(v))((function(){return s.bind(z.bindAff)(e?l.pure(z.applicativeAff)(!1):s.bind(z.bindAff)(n(v))((function(e){return s.discard(s.discardUnit)(z.bindAff)(u("Tx confirmed")(e)(v))((function(){return s.discard(s.discardUnit)(z.bindAff)(l.unless(z.applicativeAff)(e)(j.liftEffect(z.monadEffectAff)(r(f))))((function(){return l.pure(z.applicativeAff)(!e)}))}))})))((function(e){return l.unless(z.applicativeAff)(e)(j.liftEffect(z.monadEffectAff)((function(){G.modify_(L.delete(H.ordString)(i))(a)();var e=G.read(o)();return G.modify_(L.delete(H.ordString)(i))(o)(),_.maybe(l.pure(K.applicativeEffect)(V.unit))((function(e){return e(m)}))(L.lookup(H.ordString)(i)(e))()})))}))}))}))}}})(i.value0)(i.value1.value0)(i.value1.value1);var d}))}));throw new Error("Failed pattern match at Ctl.Internal.QueryM (line 505, column 41 - line 514, column 70): "+[f.constructor.name])})))()}}}}}}};i.evaluateTxOgmios=function(e){return function(n){return s.bind(te(z.bindAff))(v.asks($)((function(e){return ue(e.runtime.ogmiosWs)})))((function(t){return s.bind(te(z.bindAff))(v.asks($)((function(e){return de(e.runtime.ogmiosWs)})))((function(r){return s.bind(te(z.bindAff))(v.asks($)((function(e){return e.config})))((function(o){return J.liftAff(ee)(ie(r)(t)(h.mkLogger(o.logLevel)(o.customLogger))(A.evaluateTxCall)((function(e){return e.evaluate}))(new O.Tuple(e,n)))}))}))}))}},i.getChainTip=ge,i.getProtocolParametersAff=function(e){return function(n){return ve(e)(n)(A.queryProtocolParametersCall)((function(e){return e.getProtocolParameters}))(V.unit)}},i.getSystemStartAff=function(e){return function(n){return k.map(z.functorAff)(U.unwrap())(ve(e)(n)(A.querySystemStartCall)((function(e){return e.systemStart}))(V.unit))}},i.handleAffjaxResponse=function(e){return function(n){if(n instanceof M.Left)return new M.Left(new I.ClientHttpError(n.value0));if(n instanceof M.Right){if(n.value0.status<200||n.value0.status>299)return new M.Left(new I.ClientHttpResponseError(U.wrap()(n.value0.status),new I.ServiceOtherError(n.value0.body)));if(x.otherwise)return E.lmap(E.bifunctorEither)(I.ClientDecodeJsonError.create(n.value0.body))(s.composeKleisliFlipped(M.bindEither)(c.decodeAeson(e))(c.parseJsonStringToAeson)(n.value0.body))}throw new Error("Failed pattern match at Ctl.Internal.QueryM (line 366, column 1 - line 370, column 31): "+[n.constructor.name])}},i.mkOgmiosRequest=pe,i.mkOgmiosWebSocketAff=function(e){return function(n){return function(t){return s.bind(z.bindAff)(j.liftEffect(z.monadEffectAff)(function(e){return function(n){return function(){var t=b.newDispatcher(),r=b.newPendingRequests(),o=b.newPendingRequests(),a=function(e){return new Z(e,{chainTip:se(A.decodeAesonChainTipQR)(t)(r),evaluate:se(A.decodeAesonTxEvaluationR)(t)(r),getProtocolParameters:se(A.decodeAesonOgmiosProtocol)(t)(r),eraSummaries:se(A.decodeAesonOgmiosEraSumma)(t)(r),currentEpoch:se(A.decodeAesonCurrentEpoch)(t)(r),systemStart:se(A.decodeAesonOgmiosSystemSt)(t)(r),acquireMempool:se(A.decodeAesonMempoolSnapsho)(t)(r),mempoolHasTx:se(c.decodeAesonBoolean)(t)(r),submit:fe(t)(o),poolIds:se(c.decodeAesonArray(g.decodeAesonPoolPubKeyHash))(t)(r),poolParameters:se(A.decodeAesonPoolParameters)(t)(r),delegationsAndRewards:se(A.decodeAesonDelegationsAnd)(t)(r)})};return{serviceName:"ogmios",dispatcher:t,logger:e,typedWebSocket:a,resendPendingRequests:function(u){var i=w._wsSend(u)(e(N.Debug.value));return function(){return s.bind(K.bindEffect)(G.read(r))(P.traverse_(K.applicativeEffect)(L.foldableMap)(i))(),we(a(u))(n)(e)(i)(t)(o)()}}}}}}(n)(e)))((function(e){return z.makeAff(function(e){return function(n){return function(t){return function(){var r=w._mkWebSocket(e.logger(N.Debug.value))(n)(),o=b.mkWebsocketDispatch(e.dispatcher),a=w._onWsError(r)((function(n){return function(){return w._wsFinalize(r)(),w._wsClose(r)(),e.logger(N.Error.value)("First connection to "+e.serviceName+" WebSocket failed. Terminating. Error: "+n)(),t(new M.Left(Q.error(n)))()}}))(),u=G.new(!1)();return w._onWsConnect(r)((function(){var n=G.read(u)();if(n)return e.logger(N.Debug.value)(e.serviceName+" WebSocket connection re-established, resending pending requests...")(),e.resendPendingRequests(r)();if(!n)return e.logger(N.Debug.value)("Connection to "+e.serviceName+" established")(),G.write(!0)(u)(),w._removeOnWsError(r)(a)(),w._onWsMessage(r)(e.logger(N.Debug.value))(function(e){return function(n){return function(t){return function(){var r=d.liftEither(d.monadThrowEffect)(E.lmap(E.bifunctorEither)(B.const(Q.error("Unable to parse response")))(c.parseJsonStringToAeson(t)))(),o=P.foldl(P.foldableArray)(function(e){return function(n){return function(t){return function(){var r=n();return M.isRight(r)?n():t(e)()}}}}(r))(l.pure(K.applicativeEffect)(new M.Left(new b.JsonError(ye))))(n)();return M.either((function(n){return l.unless(K.applicativeEffect)(n instanceof b.JsonError&&R.eq(F.eqJsonDecodeError)(n.value0)(ye))(e(N.Error.value)("unexpected error on input: "+t+" Error:"+q.show(b.showDispatchError)(n)))}))(f.identity(f.categoryFn))(o)()}}}}(e.logger)([o]))(),k.void(K.functorEffect)(w._onWsError(r)((function(n){return e.logger(N.Debug.value)(e.serviceName+" WebSocket error ("+n+"). Reconnecting...")})))(),t(new M.Right(e.typedWebSocket(r)))();throw new Error("Failed pattern match at Ctl.Internal.QueryM (line 456, column 54 - line 473, column 48): "+[n.constructor.name])}))(),function(e){return j.liftEffect(z.monadEffectAff)((function(){return w._wsFinalize(r)(),w._wsClose(r)(),t(new M.Left(e))()}))}}}}}(e)(S.mkWsUrl(t)))}))}}},i.submitTxOgmios=function(e){return function(n){return s.bind(te(z.bindAff))(v.asks($)((function(e){return ue(e.runtime.ogmiosWs)})))((function(t){return s.bind(te(z.bindAff))(v.asks($)((function(e){return de(e.runtime.ogmiosWs)})))((function(r){return s.bind(te(z.bindAff))(v.asks($)((function(e){return e.config})))((function(o){return J.liftAff(ee)(ie(r)(t)(h.mkLogger(o.logLevel)(o.customLogger))(A.submitTxCall)((function(e){return e.submit}))(new O.Tuple(e,n)))}))}))}))}},i.underlyingWebSocket=ue,i.functorQueryMT=ne,i.applicativeQueryMT=oe,i.bindQueryMT=te,i.monadQueryMTAff=X,i.monadEffectQueryMTAff=Y,i.monadAffQueryMTAff=ee,i.monadAskQueryEnvQueryMTAf=$,i.monadLoggerQueryMTAff=re,i.parallelQueryMTParAffQuer=ae}(c),function(e){"use strict";e["Ctl.Internal.Contract.QueryHandle.Error"]=e["Ctl.Internal.Contract.QueryHandle.Error"]||{};var n=e["Ctl.Internal.Contract.QueryHandle.Error"],t=function(){function e(){}return e.value=new e,e}(),r=function(){function e(){}return e.value=new e,e}(),o=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}();n.GetTxMetadataTxNotFoundError=t,n.GetTxMetadataMetadataEmptyOrMissingError=r,n.GetTxMetadataClientError=o}(c),function(e){let n;n=t(1164),n=t(6359)(n),e._convertNativeScript=e=>t=>{switch(t.kind()){case n.NativeScriptKind.ScriptPubkey:return e.scriptPubkey(t.as_script_pubkey());case n.NativeScriptKind.ScriptAll:return e.scriptAll(t.as_script_all());case n.NativeScriptKind.ScriptAny:return e.scriptAny(t.as_script_any());case n.NativeScriptKind.ScriptNOfK:return e.scriptNOfK(t.as_script_n_of_k());case n.NativeScriptKind.TimelockStart:return e.timelockStart(t.as_timelock_start());case n.NativeScriptKind.TimelockExpiry:return e.timelockExpiry(t.as_timelock_expiry());default:throw"Impossible native script kind: "+t.kind()}};const r=e=>n=>n[e]();e.scriptPubkey_addr_keyhash=r("addr_keyhash"),e.scriptAllScripts=e=>e.unpackFromProperty("native_scripts"),e.scriptAnyScripts=e=>e.unpackFromProperty("native_scripts"),e.scriptNOfKScripts=e=>e.unpackFromProperty("native_scripts"),e.scriptNOfK_n=r("n"),e.timelockStart_slot=r("slot_bignum"),e.timelockExpiry_slot=r("slot_bignum")}(c["Ctl.Internal.Deserialization.NativeScript"]=c["Ctl.Internal.Deserialization.NativeScript"]||{}),function(e){"use strict";e["Ctl.Internal.Deserialization.NativeScript"]=e["Ctl.Internal.Deserialization.NativeScript"]||{};var n=e["Ctl.Internal.Deserialization.NativeScript"],t=e["Ctl.Internal.Deserialization.NativeScript"],r=e["Control.Applicative"],o=e["Control.Apply"],a=e["Control.Bind"],u=e["Ctl.Internal.Cardano.Types.NativeScript"],i=e["Ctl.Internal.Deserialization.FromBytes"],c=e["Ctl.Internal.FfiHelpers"],l=e["Ctl.Internal.Serialization.Address"],s=e["Data.Argonaut.Decode.Error"],f=e["Data.Either"],d=e["Data.Function"],v=e["Data.Functor"],m=e["Data.Newtype"],p=function(e){return t._convertNativeScript({scriptPubkey:function(e){return u.ScriptPubkey.create(t.scriptPubkey_addr_keyhash(e))},scriptAll:(s=v.map(v.functorArray)(p),f=t.scriptAllScripts(c.containerHelper),function(e){return u.ScriptAll.create(s(f(e)))}),scriptAny:(a=v.map(v.functorArray)(p),i=t.scriptAnyScripts(c.containerHelper),function(e){return u.ScriptAny.create(a(i(e)))}),scriptNOfK:o.apply(o.applyFn)(v.map(v.functorFn)(u.ScriptNOfK.create)(t.scriptNOfK_n))((n=v.map(v.functorArray)(p),r=t.scriptNOfKScripts(c.containerHelper),function(e){return n(r(e))})),timelockStart:function(e){return u.TimelockStart.create(l.Slot(t.timelockStart_slot(e)))},timelockExpiry:function(e){return u.TimelockExpiry.create(l.Slot(t.timelockExpiry_slot(e)))}})(e);var n,r,a,i,s,f};n.convertNativeScript=p,n.decodeNativeScript=function(e){return a.bind(f.bindEither)(d.flip(f.note)(i.fromBytes(i.fromBytesNativeScript)(m.wrap()(e)))(new s.TypeMismatch("decodeNativeScript: from_bytes() call failed")))((function(e){return r.pure(f.applicativeEither)(p(e))}))}}(c),function(e){let n;n=t(1164),n=t(6359)(n),e._convertPlutusData=e=>t=>{switch(t.kind()){case n.PlutusDataKind.ConstrPlutusData:return e.constr(t.as_constr_plutus_data());case n.PlutusDataKind.Map:return e.map(t.as_map());case n.PlutusDataKind.List:return e.list(t.as_list());case n.PlutusDataKind.Integer:return e.integer(t.as_integer());case n.PlutusDataKind.Bytes:return e.bytes(t.as_bytes());default:throw"Impossible PlutusData kind: "+t.kind()}},e._unpackPlutusList=e=>e.unpack,e._ConstrPlutusData_alternative=e=>e.alternative(),e._ConstrPlutusData_data=e=>e.data(),e._unpackPlutusMap=e=>n=>t=>{const r=e.unpack(t.keys()),o=[];for(let e of r)o.push(n(e)(t.get(e)));return o}}(c["Ctl.Internal.Deserialization.PlutusData"]=c["Ctl.Internal.Deserialization.PlutusData"]||{}),function(e){e._BigInt_to_str=e=>e.to_str()}(c["Ctl.Internal.Deserialization.BigInt"]=c["Ctl.Internal.Deserialization.BigInt"]||{}),function(e){"use strict";e["Ctl.Internal.Deserialization.BigInt"]=e["Ctl.Internal.Deserialization.BigInt"]||{};var n=e["Ctl.Internal.Deserialization.BigInt"],t=e["Ctl.Internal.Deserialization.BigInt"],r=e["Data.BigInt"];n.convertBigInt=function(e){return r.fromString(t._BigInt_to_str(e))}}(c),function(e){"use strict";e["Ctl.Internal.Deserialization.PlutusData"]=e["Ctl.Internal.Deserialization.PlutusData"]||{};var n,t,r,o,a=e["Ctl.Internal.Deserialization.PlutusData"],u=e["Ctl.Internal.Deserialization.PlutusData"],i=e["Control.Bind"],c=e["Ctl.Internal.Deserialization.BigInt"],l=e["Ctl.Internal.Deserialization.FromBytes"],s=e["Ctl.Internal.FfiHelpers"],f=e["Ctl.Internal.FromData"],d=e["Ctl.Internal.Types.PlutusData"],v=e["Data.Functor"],m=e["Data.Maybe"],p=e["Data.Tuple"],g=function(e){return new d.Integer(m.fromJust()(c.convertBigInt(e)))},y=d.Bytes.create,w=(n=v.map(v.functorArray)((function(e){return new p.Tuple(b(e.value0),b(e.value1))})),t=u._unpackPlutusMap(s.containerHelper)(p.Tuple.create),function(e){return d.Map.create(n(t(e)))}),h=(r=v.map(v.functorArray)((function(e){return b(e)})),o=u._unpackPlutusList(s.containerHelper),function(e){return d.List.create(r(o(e)))}),b=function(e){return u._convertPlutusData({constr:C,map:w,list:h,integer:g,bytes:y})(e)},C=function(e){var n=v.map(v.functorArray)(b)(u._unpackPlutusList(s.containerHelper)(u._ConstrPlutusData_data(e))),t=u._ConstrPlutusData_alternative(e);return new d.Constr(t,n)};a.convertPlutusData=b,a.deserializeData=function(e){return i.composeKleisliFlipped(m.bindMaybe)((n=f.fromData(e),function(e){return n(b(e))}))(l.fromBytes(l.fromBytesPlutusData));var n}}(c),function(e){let n;n=t(1164),n=t(6359)(n),e._txBody=e=>e.body();e._unpackMetadatums=e=>e.unpackKeyIndexed,e._unpackMetadataMap=e=>e.unpackKeyIndexed,e._unpackMetadataList=e=>e.unpack,e._convertMetadatum=e=>t=>{switch(t.kind()){case n.TransactionMetadatumKind.MetadataMap:return e.from_map(t.as_map());case n.TransactionMetadatumKind.MetadataList:return e.from_list(t.as_list());case n.TransactionMetadatumKind.Int:return e.from_int(t.as_int());case n.TransactionMetadatumKind.Bytes:return e.from_bytes(t.as_bytes());case n.TransactionMetadatumKind.Text:return e.from_text(t.as_text());default:throw"Could not convert to known types."}}}(c["Ctl.Internal.Deserialization.Transaction"]=c["Ctl.Internal.Deserialization.Transaction"]||{}),function(e){"use strict";e["Ctl.Internal.Deserialization.Transaction"]=e["Ctl.Internal.Deserialization.Transaction"]||{};var n=e["Ctl.Internal.Deserialization.Transaction"],t=e["Ctl.Internal.Deserialization.Transaction"],r=e["Ctl.Internal.FfiHelpers"],o=e["Ctl.Internal.Types.BigNum"],a=e["Ctl.Internal.Types.TransactionMetadata"],u=e["Data.Bifunctor"],i=e["Data.Foldable"],c=e["Data.Functor"],l=e["Data.Map.Internal"],s=e["Data.Newtype"],f=function(e){return t._convertMetadatum({from_bytes:a.Bytes.create,from_int:a.Int.create,from_text:a.Text.create,from_map:d,from_list:v})(e)},d=function(e){return new a.MetadataMap(l.fromFoldable(a.ordTransactionMetadatum)(i.foldableArray)(c.map(c.functorArray)(u.bimap(u.bifunctorTuple)(f)(f))(t._unpackMetadataMap(r.containerHelper)(e))))},v=function(e){return new a.MetadataList(c.map(c.functorArray)(f)(t._unpackMetadataList(r.containerHelper)(e)))};n.convertGeneralTransactionMetadata=function(e){return s.wrap()(l.fromFoldable(a.ordTransactionMetadatumLa)(i.foldableArray)(c.map(c.functorArray)(u.bimap(u.bifunctorTuple)((function(e){return a.TransactionMetadatumLabel(o.toBigInt(e))}))(f))(t._unpackMetadatums(r.containerHelper)(e))))},n._txBody=t._txBody}(c),function(e){"use strict";e["Ctl.Internal.QueryM.Kupo"]=e["Ctl.Internal.QueryM.Kupo"]||{};var n,t,r,o,a,u,i,c,l,s,f,d=e["Ctl.Internal.QueryM.Kupo"],v=e.Aeson,m=e.Affjax,p=e["Affjax.ResponseFormat"],g=e["Control.Alt"],y=e["Control.Applicative"],w=e["Control.Apply"],h=e["Control.Bind"],b=e["Control.Monad.Error.Class"],C=e["Control.Monad.Except.Trans"],A=e["Control.Monad.Reader.Class"],S=e["Control.Parallel"],I=e["Control.Parallel.Class"],T=e["Ctl.Internal.Cardano.Types.ScriptRef"],D=e["Ctl.Internal.Cardano.Types.Value"],F=e["Ctl.Internal.Contract.QueryHandle.Error"],E=e["Ctl.Internal.Deserialization.FromBytes"],x=e["Ctl.Internal.Deserialization.NativeScript"],M=e["Ctl.Internal.Deserialization.PlutusData"],R=e["Ctl.Internal.Deserialization.Transaction"],P=e["Ctl.Internal.QueryM"],B=e["Ctl.Internal.Serialization.Address"],k=e["Ctl.Internal.Serialization.Hash"],N=e["Ctl.Internal.ServerConfig"],L=e["Ctl.Internal.Service.Error"],_=e["Ctl.Internal.Service.Helpers"],U=e["Ctl.Internal.Types.BigNum"],H=e["Ctl.Internal.Types.ByteArray"],q=e["Ctl.Internal.Types.CborBytes"],O=e["Ctl.Internal.Types.Datum"],W=e["Ctl.Internal.Types.OutputDatum"],V=e["Ctl.Internal.Types.RawBytes"],K=e["Ctl.Internal.Types.Scripts"],z=e["Ctl.Internal.Types.TokenName"],J=e["Ctl.Internal.Types.Transaction"],j=e["Data.Argonaut.Decode.Error"],Q=e["Data.Array"],G=e["Data.Bifunctor"],Z=e["Data.Boolean"],X=e["Data.Either"],Y=e["Data.Foldable"],$=e["Data.Function"],ee=e["Data.Functor"],ne=e["Data.HTTP.Method"],te=e["Data.Map.Internal"],re=e["Data.Maybe"],oe=e["Data.Monoid"],ae=e["Data.Newtype"],ue=e["Data.String.CodePoints"],ie=e["Data.Traversable"],ce=e["Data.Tuple"],le=e["Data.UInt"],se=e["Data.Unfoldable"],fe=e["Effect.Aff"],de=e["Effect.Aff.Class"],ve=e["Foreign.Object"],me=function(){function e(){}return e.value=new e,e}(),pe=function(){function e(){}return e.value=new e,e}(),ge=function(){function e(){}return e.value=new e,e}(),ye=function(){function e(){}return e.value=new e,e}(),we=function(){function e(){}return e.value=new e,e}(),he={decodeAeson:(n=ee.map(X.functorEither)((function(e){return e.created_at.slot_no})),t=v.decodeAeson(v.decodeAesonRecord(v.gDecodeAesonCons(v.decodeAesonField1(v.decodeAesonRecord(v.gDecodeAesonCons(v.decodeAesonField1(B.decodeAesonSlot))(v.gDecodeAesonRowNil)({reflectSymbol:function(){return"slot_no"}})()())()))(v.gDecodeAesonRowNil)({reflectSymbol:function(){return"created_at"}})()())()),function(e){return n(t(e))})},be={decodeAeson:_.aesonString((function(e){return"native"===e?y.pure(X.applicativeEither)(me.value):"plutus:v1"===e?y.pure(X.applicativeEither)(pe.value):"plutus:v2"===e?y.pure(X.applicativeEither)(ge.value):new X.Left(new j.TypeMismatch("language: expected 'native' or 'plutus:v{1|2}', got: "+e))}))},Ce={decodeAeson:function(e){if(v.isNull(e))return y.pure(X.applicativeEither)(re.Nothing.value);if(Z.otherwise)return _.aesonObject((function(e){return h.bind(X.bindEither)(v.getField(be)(e)("language"))((function(n){return h.bind(X.bindEither)(v.getField(H.decodeAesonByteArray)(e)("script"))((function(e){return ee.map(X.functorEither)((function(e){return re.Just.create(e)}))(function(){if(n instanceof me)return ee.map(X.functorEither)(T.NativeScriptRef.create)(x.decodeNativeScript(e));if(n instanceof pe)return y.pure(X.applicativeEither)(new T.PlutusScriptRef(K.plutusV1Script(e)));if(n instanceof ge)return y.pure(X.applicativeEither)(new T.PlutusScriptRef(K.plutusV2Script(e)));throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 396, column 13 - line 402, column 68): "+[n.constructor.name])}())}))}))}))(e);throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 388, column 1 - line 402, column 68): "+[e.constructor.name])}},Ae={decodeAeson:h.composeKleisli(X.bindEither)(v.decodeAeson(v.decodeAesonArray(v.decodeAesonRecord(v.gDecodeAesonCons(v.decodeAesonField1(q.decodeAesonCborBytes))(v.gDecodeAesonRowNil)({reflectSymbol:function(){return"raw"}})()())())))((function(e){return 1===e.length?h.bind(X.bindEither)($.flip(X.note)(E.fromBytes(E.fromBytesGeneralTransacti)(e[0].raw))(new j.TypeMismatch("Hexadecimal encoded Metadata")))((function(e){return y.pure(X.applicativeEither)(new re.Just(R.convertGeneralTransactionMetadata(e)))})):0===e.length?new X.Right(re.Nothing.value):new X.Left(new j.TypeMismatch("Singleton or Empty Array"))}))},Se={decodeAeson:_.aesonString((function(e){return"hash"===e?y.pure(X.applicativeEither)(ye.value):"inline"===e?y.pure(X.applicativeEither)(we.value):new X.Left(new j.TypeMismatch("datum_type: expected 'hash' or 'inline', got: "+e))}))},Ie={decodeAeson:(r=function(e){var n=function(n){return function(t){return new j.TypeMismatch("In "+e.value0+": Expected hex-encoded "+n+", got: "+t)}},t=function(){var n,t=ue.indexOf(".")(e.value0);if(t instanceof re.Nothing)return new ce.Tuple(e.value0,oe.mempty(oe.monoidString));if(t instanceof re.Just)return n=ue.splitAt(t.value0)(e.value0),new ce.Tuple(n.before,ue.drop(1)(n.after));throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 255, column 13 - line 260, column 72): "+[t.constructor.name])}();return w.apply(X.applyEither)(w.apply(X.applyEither)(ee.map(X.functorEither)(D.mkSingletonNonAdaAsset)(X.note(n("CurrencySymbol")(t.value0))(h.bindFlipped(re.bindMaybe)(D.mkCurrencySymbol)(H.hexToByteArray(t.value0)))))(X.note(n("TokenName")(t.value1))(h.bindFlipped(re.bindMaybe)(z.mkTokenName)(H.hexToByteArray(t.value1)))))(y.pure(X.applicativeEither)(e.value1))},o=h.composeKleisli(X.bindEither)($.flip(v.getField(v.decodeAesonAeson))("value"))(_.aesonObject((function(e){return h.bind(X.bindEither)(v.getField(D.decodeAesonCoin)(e)("coins"))((function(n){return h.bind(X.bindEither)(ee.mapFlipped(X.functorEither)(v.getFieldOptional(v.decodeAesonObject(v.decodeAesonBigInt))(e)("assets"))((t=re.fromMaybe(oe.mempty(oe.monoidArray)),o=ee.map(re.functorMaybe)(ve.toUnfoldable(se.unfoldableArray)),function(e){return t(o(e))})))((function(e){return ee.map(X.functorEither)((t=D.mkValue(n),o=Y.fold(Y.foldableArray)(D.monoidNonAdaAsset),function(e){return t(o(e))}))(ie.traverse(ie.traversableArray)(X.applicativeEither)(r)(e));var t,o}));var t,o}))}))),_.aesonObject((function(e){return h.bind(X.bindEither)(function(e){return h.bind(X.bindEither)(v.getField(v.decodeAesonString)(e)("address"))((function(e){return X.note(new j.TypeMismatch("Expected bech32 or base16 encoded Shelley address"))(g.alt(re.altMaybe)(B.addressFromBech32(e))(h.bindFlipped(re.bindMaybe)(E.fromBytes(E.fromBytesAddress))(q.hexToCborBytes(e))))}))}(e))((function(n){return h.bind(X.bindEither)(o(e))((function(t){return h.bind(X.bindEither)(function(e){return h.bind(X.bindEither)(v["getFieldOptional'"](J.decodeAesonDataHash)(e)("datum_hash"))(ie.traverse(ie.traversableMaybe)(X.applicativeEither)((function(n){return ee.map(X.functorEither)(ce.Tuple.create(n))(v.getField(Se)(e)("datum_type"))})))}(e))((function(r){return h.bind(X.bindEither)(v["getFieldOptional'"](k.decodeAesonScriptHash)(e)("script_hash"))((function(e){return y.pure(X.applicativeEither)(ae.wrap()({address:n,amount:t,datumHash:r,scriptHash:e}))}))}))}))}))})))},Te={decodeAeson:(l=h.composeKleisli(X.bindEither)($.flip(v.getField(v.decodeAesonString))("transaction_id"))((function(e){return function(e){if(e instanceof re.Nothing)return new X.Left(new j.TypeMismatch("Expected hexstring"));if(e instanceof re.Just)return y.pure(X.applicativeEither)(e.value0);throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 305, column 61 - line 307, column 63): "+[e.constructor.name])}(H.hexToByteArray(e))})),s=_.aesonObject((function(e){return h.bind(X.bindEither)(l(e))((function(n){return h.bind(X.bindEither)(v.getField(v.decodeAesonUInt)(e)("output_index"))((function(e){return y.pure(X.applicativeEither)({transactionId:n,index:e})}))}))})),f=function(e){return w.apply(X.applyEither)(ee.map(X.functorEither)(ce.Tuple.create)(s(e)))(v.decodeAeson(Ie)(e))},_.aesonArray((i=ee.map(X.functorEither)((a=ae.wrap(),u=te.fromFoldable(J.ordTransactionInput)(Y.foldableArray),function(e){return a(u(e))})),c=ie.traverse(ie.traversableArray)(X.applicativeEither)(f),function(e){return i(c(e))})))},De={decodeAeson:function(e){if(v.isNull(e))return y.pure(X.applicativeEither)(re.Nothing.value);if(Z.otherwise)return h.bind(X.bindEither)(_.aesonObject($.flip(v.getFieldOptional(q.decodeAesonCborBytes))("datum"))(e))((n=y.pure(X.applicativeEither),t=h.bindFlipped(re.bindMaybe)(M.deserializeData(O.fromDataDatum)),function(e){return n(t(e))}));var n,t;throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 354, column 1 - line 359, column 65): "+[e.constructor.name])}},Fe=ae.unwrap(),Ee=ae.unwrap(),xe=function(e){return function(n){return m.request({method:new X.Left(ne.GET.value),url:N.mkHttpUrl(e)+n,headers:m.defaultRequest.headers,content:m.defaultRequest.content,username:m.defaultRequest.username,password:m.defaultRequest.password,withCredentials:m.defaultRequest.withCredentials,responseFormat:p.string,timeout:m.defaultRequest.timeout})}},Me=function(e){return h.bind(P.bindQueryMT(fe.bindAff))(A.asks(P.monadAskQueryEnvQueryMTAf)((function(e){return e.config.kupoConfig})))((function(n){return de.liftAff(P.monadAffQueryMTAff)(xe(n)(e))}))},Re=function(e){return function(n){return C.runExceptT((t="/matches/*@"+H.byteArrayToHex(n),h.bind(C.bindExceptT(fe.monadAff))(ee.map(fe.functorAff)(P.handleAffjaxResponse(v.decodeAesonArray(he)))(xe(e)(t)))((function(e){return y.pure(C.applicativeExceptT(fe.monadAff))(ee.mapFlipped(re.functorMaybe)(Q.uncons(e))((function(e){return e.head})))}))));var t}},Pe=function(e){return h.bind(P.bindQueryMT(fe.bindAff))(A.asks(P.monadAskQueryEnvQueryMTAf)((function(e){return e.config.kupoConfig})))((function(n){return de.liftAff(P.monadAffQueryMTAff)(Re(n)(e))}))},Be=function(e){var n,t,r="/scripts/"+V.rawBytesToHex(k.scriptHashToBytes(e));return ee.mapFlipped(P.functorQueryMT(fe.functorAff))(Me(r))((n=ee.map(X.functorEither)(Fe),t=P.handleAffjaxResponse(Ce),function(e){return n(t(e))}))},ke=function(e){var n,t,r="/datums/"+H.byteArrayToHex(e);return ee.mapFlipped(P.functorQueryMT(fe.functorAff))(Me(r))((n=ee.map(X.functorEither)(Ee),t=P.handleAffjaxResponse(De),function(e){return n(t(e))}))},Ne=function(e){return C.runExceptT(S.parTraverse(I.monadParExceptT(P.parallelQueryMTParAffQuer))(te.traversableMap)((function(e){return C.ExceptT(function(e){var n=function(){if(e.scriptHash instanceof re.Nothing)return y.pure(P.applicativeQueryMT(fe.applicativeAff))(new X.Right(re.Nothing.value));if(e.scriptHash instanceof re.Just)return C.runExceptT(h.bind(C.bindExceptT(P.monadQueryMTAff))(Be(e.scriptHash.value0))((function(e){return C.except(P.applicativeQueryMT(fe.applicativeAff))(ee.map(X.functorEither)(re.Just.create)($.flip(X.note)(e)(new L.ClientOtherError("Kupo: Failed to resolve reference script"))))})));throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 336, column 5 - line 341, column 72): "+[e.scriptHash.constructor.name])}(),t=function(){if(e.datumHash instanceof re.Nothing)return y.pure(P.applicativeQueryMT(fe.applicativeAff))(new X.Right(W.NoOutputDatum.value));if(e.datumHash instanceof re.Just&&e.datumHash.value0.value1 instanceof ye)return y.pure(P.applicativeQueryMT(fe.applicativeAff))(new X.Right(new W.OutputDatumHash(e.datumHash.value0.value0)));if(e.datumHash instanceof re.Just&&e.datumHash.value0.value1 instanceof we)return C.runExceptT(h.bind(C.bindExceptT(P.monadQueryMTAff))(ke(e.datumHash.value0.value0))((function(e){return C.except(P.applicativeQueryMT(fe.applicativeAff))(ee.map(X.functorEither)(W.OutputDatum.create)($.flip(X.note)(e)(new L.ClientOtherError("Kupo: Failed to resolve inline datum"))))})));throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 325, column 5 - line 332, column 68): "+[e.datumHash.constructor.name])}();return C.runExceptT(w.apply(C.applyExceptT(P.monadQueryMTAff))(ee.map(C.functorExceptT(P.functorQueryMT(fe.functorAff)))((function(n){return function(t){return{address:e.address,amount:e.amount,datum:n,scriptRef:t}}}))(t))(n))}(e))}))(e))};d.getDatumByHash=ke,d.getScriptByHash=Be,d.getTxMetadata=function(e){return C.runExceptT(h.bind(C.bindExceptT(P.monadQueryMTAff))(ee.map(P.functorQueryMT(fe.functorAff))(G.lmap(G.bifunctorEither)(F.GetTxMetadataClientError.create))(Pe(e)))((function(n){if(n instanceof re.Nothing)return b.throwError(C.monadThrowExceptT(P.monadQueryMTAff))(F.GetTxMetadataTxNotFoundError.value);if(n instanceof re.Just){var t="/metadata/"+U.toString(ae.unwrap()(n.value0))+"?transaction_id="+H.byteArrayToHex(ae.unwrap()(e));return h.bind(C.bindExceptT(P.monadQueryMTAff))(ee.map(P.functorQueryMT(fe.functorAff))((r=G.lmap(G.bifunctorEither)(F.GetTxMetadataClientError.create),o=P.handleAffjaxResponse(Ae),function(e){return r(o(e))}))(Me(t)))((function(e){var n=e;if(n instanceof re.Nothing)return b.throwError(C.monadThrowExceptT(P.monadQueryMTAff))(F.GetTxMetadataMetadataEmptyOrMissingError.value);if(n instanceof re.Just){if(te.isEmpty(ae.unwrap()(n.value0)))return b.throwError(C.monadThrowExceptT(P.monadQueryMTAff))(F.GetTxMetadataMetadataEmptyOrMissingError.value);if(Z.otherwise)return y.pure(C.applicativeExceptT(P.monadQueryMTAff))(n.value0)}throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 178, column 7 - line 183, column 39): "+[n.constructor.name])}))}var r,o;throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 167, column 72 - line 183, column 39): "+[n.constructor.name])})))},d.getUtxoByOref=function(e){var n,t=(n=H.byteArrayToHex(ae.unwrap()(e.transactionId)),"/matches/"+le.toString(e.index)+"@"+n+"?unspent");return C.runExceptT(h.bind(C.bindExceptT(P.monadQueryMTAff))(ee.map(P.functorQueryMT(fe.functorAff))(P.handleAffjaxResponse(Te))(Me(t)))((function(n){return h.bind(C.bindExceptT(P.monadQueryMTAff))(Ne(n))((function(n){return y.pure(C.applicativeExceptT(P.monadQueryMTAff))(te.lookup(J.ordTransactionInput)(e)(n))}))})))},d.isTxConfirmed=Pe,d.isTxConfirmedAff=Re,d.utxosAt=function(e){return C.runExceptT((n="/matches/"+B.addressBech32(e)+"?unspent",h.bind(C.bindExceptT(P.monadQueryMTAff))(ee.map(P.functorQueryMT(fe.functorAff))(P.handleAffjaxResponse(Te))(Me(n)))((function(e){return Ne(e)}))));var n}}(c),function(e){"use strict";e["Control.Monad.Logger.Class"]=e["Control.Monad.Logger.Class"]||{};var n=e["Control.Monad.Logger.Class"],t=e["Control.Bind"],r=e["Control.Monad.Except.Trans"],o=e["Control.Monad.Reader.Trans"],a=e["Control.Monad.Trans.Class"],u=e["Data.JSDate"],i=e["Data.Log.Level"],c=e["Effect.Class"],l=function(e){return e.log},s=function(e){return function(n){return function(r){return function(o){return t.bind(e.MonadEffect0().Monad0().Bind1())(c.liftEffect(e.MonadEffect0())(u.now))((a=l(e),function(e){return a({level:n,message:o,tags:r,timestamp:e})}));var a}}}};n.log=l,n.trace=function(e){return s(e)(i.Trace.value)},n.debug=function(e){return s(e)(i.Debug.value)},n.info=function(e){return s(e)(i.Info.value)},n.warn=function(e){return s(e)(i.Warn.value)},n.error=function(e){return s(e)(i.Error.value)},n.monadLoggerExceptT=function(e){return{log:(n=a.lift(r.monadTransExceptT)(e.MonadEffect0().Monad0()),t=l(e),function(e){return n(t(e))}),MonadEffect0:function(){return r.monadEffectExceptT(e.MonadEffect0())}};var n,t},n.monadLoggerReaderT=function(e){return{log:(n=a.lift(o.monadTransReaderT)(e.MonadEffect0().Monad0()),t=l(e),function(e){return n(t(e))}),MonadEffect0:function(){return o.monadEffectReader(e.MonadEffect0())}};var n,t}}(c),function(e){"use strict";e["Control.Monad.Maybe.Trans"]=e["Control.Monad.Maybe.Trans"]||{};var n=e["Control.Monad.Maybe.Trans"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad"],a=e["Data.Functor"],u=e["Data.Maybe"],i=function(e){return{map:function(n){return function(t){return a.map(e)(a.map(u.functorMaybe)(n))(t)}}}},c=function(e){return{Applicative0:function(){return f(e)},Bind1:function(){return l(e)}}},l=function(e){return{bind:function(n){return function(o){return r.bind(e.Bind1())(n)((function(n){if(n instanceof u.Nothing)return t.pure(e.Applicative0())(u.Nothing.value);if(n instanceof u.Just)return o(n.value0);throw new Error("Failed pattern match at Control.Monad.Maybe.Trans (line 55, column 11 - line 57, column 42): "+[n.constructor.name])}))}},Apply0:function(){return s(e)}}},s=function(e){return{apply:o.ap(c(e)),Functor0:function(){return i(e.Bind1().Apply0().Functor0())}}},f=function(e){return{pure:(n=t.pure(e.Applicative0()),function(e){return n(u.Just.create(e))}),Apply0:function(){return s(e)}};var n};n.runMaybeT=function(e){return e},n.functorMaybeT=i,n.bindMaybeT=l}(c),function(e){let n;n=t(1164),n=t(6359)(n);const r=e=>n=>t=>()=>n["set_"+e](t);e.hashTransaction=e=>()=>n.hash_transaction(e),e.newValueFromAssets=e=>()=>n.Value.new_from_assets(e),e.valueSetCoin=r("coin"),e.newTransactionInput=e=>t=>()=>n.TransactionInput.new(e,t),e.newTransactionInputs=()=>n.TransactionInputs.new(),e.addTransactionInput=e=>n=>()=>e.add(n),e.newTransactionOutput=e=>t=>()=>n.TransactionOutput.new(e,t),e.newTransactionOutputs=()=>n.TransactionOutputs.new(),e.addTransactionOutput=e=>n=>()=>e.add(n),e.newTransactionBody=e=>t=>r=>()=>n.TransactionBody.new_tx_body(e,t,r),e.setTxIsValid=e=>n=>()=>e.set_is_valid(n),e.newTransaction=e=>t=>r=>()=>n.Transaction.new(e,t,r),e.newTransaction_=e=>t=>()=>n.Transaction.new(e,t),e.newMultiAsset=()=>n.MultiAsset.new(),e.insertMultiAsset=e=>n=>t=>()=>e.insert(n,t),e.newAssets=()=>n.Assets.new(),e.insertAssets=e=>n=>t=>()=>e.insert(n,t),e.newAssetName=e=>()=>n.AssetName.new(e),e.transactionOutputSetDataHash=r("data_hash"),e.transactionOutputSetPlutusData=r("plutus_data"),e.transactionOutputSetScriptRef=r("script_ref"),e.scriptRefNewNativeScript=e=>n.ScriptRef.new_native_script(e),e.scriptRefNewPlutusScript=e=>n.ScriptRef.new_plutus_script(e),e.makeVkeywitness=e=>t=>()=>n.make_vkey_witness(e,t),e.publicKeyHash=e=>e.hash(),e.newCostmdls=()=>n.Costmdls.new(),e.costmdlsSetCostModel=e=>n=>t=>()=>e.insert(n,t),e.newCostModel=()=>n.CostModel.new(),e.costModelSetCost=e=>n=>t=>()=>e.set(n,t),e.newPlutusV1=()=>n.Language.new_plutus_v1(),e.newPlutusV2=()=>n.Language.new_plutus_v2(),e._hashScriptData=e=>t=>r=>()=>{const o=n.PlutusList.new();return r.forEach((e=>o.add(e))),n.hash_script_data(e,t,o)},e._hashScriptDataNoDatums=e=>t=>()=>n.hash_script_data(e,t),e.newRedeemers=()=>n.Redeemers.new(),e.addRedeemer=e=>n=>()=>e.add(n),e.setTxBodyReferenceInputs=e=>n=>()=>e.set_reference_inputs(n),e.setTxBodyScriptDataHash=r("script_data_hash"),e.setTxBodyMint=r("mint"),e.newMint=()=>n.Mint.new(),e._bigIntToInt=e=>t=>{try{const r=t.to_str();return"-"==r[0]?e.just(n.Int.new_negative(n.BigNum.from_str(r.slice(1)))):e.just(n.Int.new(n.BigNum.from_str(r)))}catch(n){return e.nothing}},e.newMintAssets=n.MintAssets.new,e.insertMintAssets=e=>n=>t=>()=>e.insert(n,t),e.insertMintAsset=e=>n=>t=>()=>e.insert(n,t),e.networkIdTestnet=()=>n.NetworkId.testnet(),e.networkIdMainnet=()=>n.NetworkId.mainnet(),e.setTxBodyCollateralReturn=e=>n=>()=>e.set_collateral_return(n),e.setTxBodyTotalCollateral=e=>n=>()=>e.set_total_collateral(n),e.setTxBodyTtl=r("ttl"),e.setTxBodyCerts=r("certs"),e.newCertificates=()=>n.Certificates.new(),e.newStakeRegistrationCertificate=e=>()=>n.Certificate.new_stake_registration(n.StakeRegistration.new(e)),e.newStakeDeregistrationCertificate=e=>()=>n.Certificate.new_stake_deregistration(n.StakeDeregistration.new(e)),e.newStakeDelegationCertificate=e=>t=>()=>n.Certificate.new_stake_delegation(n.StakeDelegation.new(e,t)),e.newPoolRegistrationCertificate=e=>t=>r=>o=>a=>u=>i=>c=>l=>()=>n.Certificate.new_pool_registration(n.PoolRegistration.new(n.PoolParams.new(e,t,r,o,a,u,i,c,l))),e.newUnitInterval=e=>t=>()=>n.UnitInterval.new(e,t),e.newPoolRetirementCertificate=e=>t=>()=>n.Certificate.new_pool_retirement(n.PoolRetirement.new(e,t)),e.newGenesisKeyDelegationCertificate=e=>t=>r=>()=>n.Certificate.new_genesis_key_delegation(n.GenesisKeyDelegation.new(e,t,r)),e.addCert=e=>n=>()=>e.add(n),e.setTxBodyCollateral=r("collateral"),e.setTxBodyNetworkId=r("network_id"),e.transactionBodySetRequiredSigners=e=>t=>r=>()=>t.set_required_signers(e.pack(n.Ed25519KeyHashes,r)),e.transactionBodySetValidityStartInterval=r("validity_start_interval_bignum"),e.transactionBodySetAuxiliaryDataHash=e=>n=>()=>e.set_auxiliary_data_hash(n),e.convertPoolOwners=e=>t=>()=>e.pack(n.Ed25519KeyHashes,t),e.packRelays=e=>t=>e.pack(n.Relays,t),e.newIpv4=e=>()=>n.Ipv4.new(e),e.newIpv6=e=>()=>n.Ipv6.new(e),e.newSingleHostAddr=e=>t=>r=>()=>n.Relay.new_single_host_addr(n.SingleHostAddr.new(e,t,r)),e.newSingleHostName=e=>t=>()=>n.Relay.new_single_host_name(n.SingleHostName.new(e,n.DNSRecordAorAAAA.new(t))),e.newMultiHostName=e=>()=>n.Relay.new_multi_host_name(n.MultiHostName.new(n.DNSRecordSRV.new(e))),e.newPoolMetadata=e=>t=>()=>n.PoolMetadata.new(n.URL.new(e),t),e.newMoveInstantaneousRewardToOtherPot=e=>t=>()=>n.MoveInstantaneousReward.new_to_other_pot(e,t),e.newMoveInstantaneousRewardToStakeCreds=e=>t=>()=>n.MoveInstantaneousReward.new_to_stake_creds(e,t),e.newMIRToStakeCredentials=e=>t=>()=>e.packMap(n.MIRToStakeCredentials,t),e.newMoveInstantaneousRewardsCertificate=e=>()=>n.Certificate.new_move_instantaneous_rewards_cert(n.MoveInstantaneousRewardsCert.new(e)),e.newWithdrawals=e=>t=>()=>e.packMap(n.Withdrawals,t),e.setTxBodyWithdrawals=r("withdrawals"),e.setTxBodyUpdate=r("update"),e.newUpdate=e=>t=>()=>n.Update.new(e,t),e.ppuSetMinfeeA=r("minfee_a"),e.ppuSetMinfeeB=r("minfee_b"),e.ppuSetMaxBlockBodySize=r("max_block_body_size"),e.ppuSetMaxTxSize=r("max_tx_size"),e.ppuSetMaxBlockHeaderSize=r("max_block_header_size"),e.ppuSetKeyDeposit=r("key_deposit"),e.ppuSetPoolDeposit=r("pool_deposit"),e.ppuSetMaxEpoch=r("max_epoch"),e.ppuSetNOpt=r("n_opt"),e.ppuSetPoolPledgeInfluence=r("pool_pledge_influence"),e.ppuSetExpansionRate=r("expansion_rate"),e.ppuSetTreasuryGrowthRate=r("treasury_growth_rate"),e.newProtocolVersion=e=>t=>()=>n.ProtocolVersion.new(e,t),e.ppuSetProtocolVersion=e=>n=>()=>e.set_protocol_version(n),e.ppuSetMinPoolCost=r("min_pool_cost"),e.ppuSetAdaPerUtxoByte=r("ada_per_utxo_byte"),e.ppuSetCostModels=r("cost_models"),e.newExUnitPrices=e=>t=>()=>n.ExUnitPrices.new(e,t),e.ppuSetExecutionCosts=r("execution_costs"),e.ppuSetMaxTxExUnits=r("max_tx_ex_units"),e.ppuSetMaxBlockExUnits=r("max_block_ex_units"),e.ppuSetMaxValueSize=r("max_value_size"),e.ppuSetCollateralPercentage=r("collateral_percentage"),e.ppuSetMaxCollateralInputs=r("max_collateral_inputs"),e.newProtocolParamUpdate=()=>n.ProtocolParamUpdate.new(),e.newProposedProtocolParameterUpdates=e=>t=>()=>e.packMap(n.ProposedProtocolParameterUpdates,t)}(c["Ctl.Internal.Serialization"]=c["Ctl.Internal.Serialization"]||{}),function(e){let n;n=t(1164),n=t(6359)(n);const r=e=>n=>t=>()=>n["set_"+e](t);e.newAuxiliaryData=()=>n.AuxiliaryData.new(),e.setAuxiliaryDataNativeScripts=r("native_scripts"),e.setAuxiliaryDataPlutusScripts=r("plutus_scripts"),e.setAuxiliaryDataGeneralTransactionMetadata=r("metadata"),e.newGeneralTransactionMetadata=e=>t=>()=>e.packMap(n.GeneralTransactionMetadata,t),e.newMetadataMap=e=>t=>()=>n.TransactionMetadatum.new_map(e.packMap(n.MetadataMap,t)),e.newMetadataList=e=>t=>()=>n.TransactionMetadatum.new_list(e.pack(n.MetadataList,t)),e.newMetadataInt=e=>()=>n.TransactionMetadatum.new_int(e),e.newMetadataBytes=e=>()=>n.TransactionMetadatum.new_bytes(e),e.newMetadataText=e=>()=>n.TransactionMetadatum.new_text(e)}(c["Ctl.Internal.Serialization.AuxiliaryData"]=c["Ctl.Internal.Serialization.AuxiliaryData"]||{}),function(e){let n;n=t(1164),n=t(6359)(n);const r=e=>t=>n.NativeScript[e](t);e.mkScriptPubkey=e=>n.ScriptPubkey.new(e),e.nativeScript_new_script_pubkey=r("new_script_pubkey"),e.nativeScript_new_script_all=r("new_script_all"),e.nativeScript_new_script_any=r("new_script_any"),e.nativeScript_new_script_n_of_k=r("new_script_n_of_k"),e.nativeScript_new_timelock_start=r("new_timelock_start"),e.nativeScript_new_timelock_expiry=r("new_timelock_expiry"),e._packNativeScripts=e=>t=>e.pack(n.NativeScripts,t),e.mkScriptAll=e=>n.ScriptAll.new(e),e.mkScriptAny=e=>n.ScriptAny.new(e),e.mkScriptNOfK=e=>t=>n.ScriptNOfK.new(e,t),e.mkTimelockExpiry=e=>n.TimelockExpiry.new_timelockexpiry(e),e.mkTimelockStart=e=>n.TimelockStart.new_timelockstart(e)}(c["Ctl.Internal.Serialization.NativeScript"]=c["Ctl.Internal.Serialization.NativeScript"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.NativeScript"]=e["Ctl.Internal.Serialization.NativeScript"]||{};var n,t=e["Ctl.Internal.Serialization.NativeScript"],r=e["Ctl.Internal.Serialization.NativeScript"],o=e["Ctl.Internal.Cardano.Types.NativeScript"],a=e["Ctl.Internal.FfiHelpers"],u=e["Data.Functor"],i=r._packNativeScripts(a.containerHelper),c=function(e){if(e instanceof o.ScriptPubkey)return n=e.value0,r.nativeScript_new_script_pubkey(r.mkScriptPubkey(n));var n,t,a;if(e instanceof o.ScriptAll)return t=e.value0,r.nativeScript_new_script_all(r.mkScriptAll(i(u.map(u.functorArray)(c)(t))));if(e instanceof o.ScriptAny)return function(e){return r.nativeScript_new_script_any(r.mkScriptAny(i(u.map(u.functorArray)(c)(e))))}(e.value0);if(e instanceof o.ScriptNOfK)return(a=e.value0,function(e){return r.nativeScript_new_script_n_of_k(r.mkScriptNOfK(a)(i(u.map(u.functorArray)(c)(e))))})(e.value1);if(e instanceof o.TimelockStart)return function(e){return r.nativeScript_new_timelock_start(r.mkTimelockStart(e))}(e.value0);if(e instanceof o.TimelockExpiry)return function(e){return r.nativeScript_new_timelock_expiry(r.mkTimelockExpiry(e))}(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Serialization.NativeScript (line 38, column 23 - line 44, column 54): "+[e.constructor.name])},l=(n=u.map(u.functorArray)(c),function(e){return i(n(e))});t.convertNativeScript=c,t.convertNativeScripts=l}(c),function(e){let n;n=t(1164),n=t(6359)(n),e.newPlutusV1Script=e=>n.PlutusScript.new(e),e.newPlutusV2Script=e=>n.PlutusScript.new_v2(e)}(c["Ctl.Internal.Serialization.PlutusScript"]=c["Ctl.Internal.Serialization.PlutusScript"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.PlutusScript"]=e["Ctl.Internal.Serialization.PlutusScript"]||{};var n=e["Ctl.Internal.Serialization.PlutusScript"],t=e["Ctl.Internal.Serialization.PlutusScript"],r=e["Ctl.Internal.Types.Scripts"];n.convertPlutusScript=function(e){return function(){if(e.value1 instanceof r.PlutusV1)return t.newPlutusV1Script;if(e.value1 instanceof r.PlutusV2)return t.newPlutusV2Script;throw new Error("Failed pattern match at Ctl.Internal.Serialization.PlutusScript (line 24, column 11 - line 26, column 36): "+[e.value1.constructor.name])}()(e.value0)}}(c),function(e){let n;n=t(1164),n=t(6359)(n),e.newTransactionWitnessSet=()=>n.TransactionWitnessSet.new(),e.newVkeyFromPublicKey=e=>()=>n.Vkey.new(e),e.newVkeywitnesses=()=>n.Vkeywitnesses.new(),e.newVkeywitness=e=>t=>()=>n.Vkeywitness.new(e,t),e.addVkeywitness=e=>n=>()=>e.add(n),e.newPlutusScripts=()=>n.PlutusScripts.new(),e.addPlutusScript=e=>n=>()=>e.add(n),e.transactionWitnessSetSetVkeys=e=>n=>()=>e.set_vkeys(n),e.txWitnessSetSetPlutusScripts=e=>n=>()=>e.set_plutus_scripts(n),e.transactionWitnessSetSetNativeScripts=e=>n=>()=>e.set_native_scripts(n),e._wsSetBootstraps=e=>t=>r=>()=>t.set_bootstraps(e.pack(n.BootstrapWitnesses,r)),e.newBootstrapWitness=e=>t=>r=>o=>()=>{n.BootstrapWitness.new(e,t,r,o)},e._wsSetPlutusData=e=>t=>r=>()=>t.set_plutus_data(e.pack(n.PlutusList,r)),e.newRedeemer=e=>t=>r=>o=>()=>n.Redeemer.new(e,t,r,o),e._newRedeemerTag=e=>()=>n.RedeemerTag["new_"+e](),e.newExUnits=e=>t=>n.ExUnits.new(e,t),e._wsSetRedeemers=e=>t=>r=>()=>t.set_redeemers(e.pack(n.Redeemers,r)),e._wsSetPlutusScripts=e=>t=>r=>()=>t.set_plutus_scripts(e.pack(n.PlutusScripts,r))}(c["Ctl.Internal.Serialization.WitnessSet"]=c["Ctl.Internal.Serialization.WitnessSet"]||{}),function(e){let n;n=t(1164),n=t(6359)(n),e._mkPlutusData_bytes=e=>n.PlutusData.new_bytes(e),e._mkPlutusData_list=e=>n.PlutusData.new_list(e),e._mkPlutusData_map=e=>n.PlutusData.new_map(e),e._mkPlutusData_integer=e=>n.PlutusData.new_integer(e),e._mkPlutusData_constr=e=>n.PlutusData.new_constr_plutus_data(e),e._packPlutusList=e=>t=>e.pack(n.PlutusList,t),e._mkConstrPlutusData=e=>t=>n.ConstrPlutusData.new(e,t),e._bigIntFromString=e=>t=>{try{return e.just(n.BigInt.from_str(t))}catch(n){return e.nothing}},e._packMap=e=>t=>r=>{const o=n.PlutusMap.new();for(let n of r)o.insert(e(n),t(n));return o}}(c["Ctl.Internal.Serialization.PlutusData"]=c["Ctl.Internal.Serialization.PlutusData"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.PlutusData"]=e["Ctl.Internal.Serialization.PlutusData"]||{};var n=e["Ctl.Internal.Serialization.PlutusData"],t=e["Ctl.Internal.Serialization.PlutusData"],r=e["Ctl.Internal.FfiHelpers"],o=e["Ctl.Internal.Types.PlutusData"],a=e["Data.BigInt"],u=e["Data.Functor"],i=e["Data.Maybe"],c=e["Data.Tuple"],l=function(e){if(e instanceof o.Constr)return s(e.value0)(e.value1);if(e instanceof o.Map)return n=e.value0,f=u.mapFlipped(u.functorArray)(n)((function(e){return new c.Tuple(l(e.value0),l(e.value1))})),t._mkPlutusData_map(t._packMap(c.fst)(c.snd)(f));var n,f,d;if(e instanceof o.List)return function(e){return t._mkPlutusData_list(t._packPlutusList(r.containerHelper)(u.map(u.functorArray)(l)(e)))}(e.value0);if(e instanceof o.Integer)return d=e.value0,t._mkPlutusData_integer(function(e){return i.fromJust()(t._bigIntFromString(r.maybeFfiHelper)(a.toString(e)))}(d));if(e instanceof o.Bytes)return t._mkPlutusData_bytes(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Serialization.PlutusData (line 31, column 23 - line 36, column 37): "+[e.constructor.name])},s=function(e){return function(n){return t._mkPlutusData_constr(t._mkConstrPlutusData(e)(t._packPlutusList(r.containerHelper)(u.map(u.functorArray)(l)(n))))}};n.convertPlutusData=l}(c),function(e){"use strict";e["Ctl.Internal.Serialization.WitnessSet"]=e["Ctl.Internal.Serialization.WitnessSet"]||{};var n=e["Ctl.Internal.Serialization.WitnessSet"],t=e["Ctl.Internal.Serialization.WitnessSet"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Cardano.Types.Transaction"],u=e["Ctl.Internal.FfiHelpers"],i=e["Ctl.Internal.Serialization.NativeScript"],c=e["Ctl.Internal.Serialization.PlutusData"],l=e["Ctl.Internal.Serialization.PlutusScript"],s=e["Ctl.Internal.Types.BigNum"],f=e["Ctl.Internal.Types.RedeemerTag"],d=e["Data.Foldable"],v=e["Data.Functor"],m=e["Data.Maybe"],p=e["Data.Traversable"],g=e.Effect,y=e["Effect.Exception"],w=function(e){return function(n){return e(u.containerHelper)(n)}},h=function(e){return t.newVkeyFromPublicKey(a.convertPubKey(e))},b=function(e){return function(){var n=h(e.value0)(),r=a.convertEd25519Signature(e.value1);return t.newVkeywitness(n)(r)()}},C=function(e){return function(){var n=t.newVkeywitnesses();return d.traverse_(g.applicativeEffect)(d.foldableArray)(o.composeKleisli(g.bindEffect)(b)(t.addVkeywitness(n)))(e)(),n}},A=function(e){return m.maybe(y.throw("Failed to construct ExUnits"))(r.pure(g.applicativeEffect))(o.bind(m.bindMaybe)(s.fromBigInt(e.mem))((function(n){return o.bind(m.bindMaybe)(s.fromBigInt(e.steps))((function(e){return r.pure(m.applicativeMaybe)(t.newExUnits(n)(e))}))})))},S=function(e){return function(){var n,o=(n=e.tag,t._newRedeemerTag(function(e){if(e instanceof f.Spend)return"spend";if(e instanceof f.Mint)return"mint";if(e instanceof f.Cert)return"cert";if(e instanceof f.Reward)return"reward";throw new Error("Failed pattern match at Ctl.Internal.Serialization.WitnessSet (line 130, column 42 - line 134, column 25): "+[e.constructor.name])}(n)))(),a=m.maybe(y.throw("Failed to convert redeemer index"))(r.pure(g.applicativeEffect))(s.fromBigInt(e.index))(),u=c.convertPlutusData(e.data),i=A(e.exUnits)();return t.newRedeemer(o)(a)(u)(i)()}},I=function(e){return function(){var n=h(e.vkey)(),r=a.convertEd25519Signature(e.signature);return t.newBootstrapWitness(n)(r)(e.chainCode)(e.attributes)()}};n.setPlutusData=function(e){return function(n){return w(t._wsSetPlutusData)(n)(e)}},n.setRedeemers=function(e){return function(n){return w(t._wsSetRedeemers)(n)(e)}},n.setPlutusScripts=function(e){return function(n){return w(t._wsSetPlutusScripts)(n)(e)}},n.convertWitnessSet=function(e){return function(){var n,r,a,s=t.newTransactionWitnessSet();return d.for_(g.applicativeEffect)(d.foldableMaybe)(e.vkeys)(o.composeKleisli(g.bindEffect)(C)(t.transactionWitnessSetSetVkeys(s)))(),d.for_(g.applicativeEffect)(d.foldableMaybe)(e.nativeScripts)((n=t.transactionWitnessSetSetNativeScripts(s),function(e){return n(i.convertNativeScripts(e))}))(),d.for_(g.applicativeEffect)(d.foldableMaybe)(e.bootstraps)(o.composeKleisli(g.bindEffect)(p.traverse(p.traversableArray)(g.applicativeEffect)(I))(t._wsSetBootstraps(u.containerHelper)(s)))(),d.for_(g.applicativeEffect)(d.foldableMaybe)(e.plutusScripts)((function(e){return function(){var n,r=t.newPlutusScripts();return d.for_(g.applicativeEffect)(d.foldableArray)(e)((n=t.addPlutusScript(r),function(e){return n(l.convertPlutusScript(e))}))(),t.txWitnessSetSetPlutusScripts(s)(r)()}}))(),d.for_(g.applicativeEffect)(d.foldableMaybe)(e.plutusData)((r=t._wsSetPlutusData(u.containerHelper)(s),a=v.map(v.functorArray)(c.convertPlutusData),function(e){return r(a(e))}))(),d.for_(g.applicativeEffect)(d.foldableMaybe)(e.redeemers)(o.composeKleisli(g.bindEffect)(p.traverse(p.traversableArray)(g.applicativeEffect)(S))(t._wsSetRedeemers(u.containerHelper)(s)))(),s}},n.convertRedeemer=S,n.convertExUnits=A,n.newPlutusScripts=t.newPlutusScripts,n.addPlutusScript=t.addPlutusScript}(c),function(e){"use strict";e["Ctl.Internal.Serialization.AuxiliaryData"]=e["Ctl.Internal.Serialization.AuxiliaryData"]||{};var n=e["Ctl.Internal.Serialization.AuxiliaryData"],t=e["Ctl.Internal.Serialization.AuxiliaryData"],r=e["Control.Apply"],o=e["Control.Bind"],a=e["Ctl.Internal.FfiHelpers"],u=e["Ctl.Internal.Helpers"],i=e["Ctl.Internal.Serialization.NativeScript"],c=e["Ctl.Internal.Serialization.PlutusScript"],l=e["Ctl.Internal.Serialization.WitnessSet"],s=e["Ctl.Internal.Types.BigNum"],f=e["Ctl.Internal.Types.TransactionMetadata"],d=e["Data.Foldable"],v=e["Data.Functor"],m=e["Data.Map.Internal"],p=e["Data.Traversable"],g=e["Data.Tuple"],y=e["Data.Unfoldable"],w=e.Effect,h=function(e){if(e instanceof f.MetadataMap)return o.bindFlipped(w.bindEffect)(t.newMetadataMap(a.containerHelper))(p.for(w.applicativeEffect)(p.traversableArray)(m.toUnfoldable(y.unfoldableArray)(e.value0))((function(e){return r.apply(w.applyEffect)(v.map(w.functorEffect)(g.Tuple.create)(h(e.value0)))(h(e.value1))})));if(e instanceof f.MetadataList)return o.bindFlipped(w.bindEffect)(t.newMetadataList(a.containerHelper))(p.traverse(p.traversableArray)(w.applicativeEffect)(h)(e.value0));if(e instanceof f.Int)return t.newMetadataInt(e.value0);if(e instanceof f.Bytes)return t.newMetadataBytes(e.value0);if(e instanceof f.Text)return t.newMetadataText(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Serialization.AuxiliaryData (line 115, column 31 - line 124, column 38): "+[e.constructor.name])},b=function(e){return o.bindFlipped(w.bindEffect)(t.newGeneralTransactionMetadata(a.containerHelper))(p.for(w.applicativeEffect)(p.traversableArray)(m.toUnfoldable(y.unfoldableArray)(e))((function(e){return function(){var n=u.fromJustEff("convertGeneralTransactionMetadata: failing to convert MetadataumLabel")(s.fromBigInt(e.value0))(),t=h(e.value1)();return new g.Tuple(n,t)}})))};n.convertAuxiliaryData=function(e){return function(){var n,r=t.newAuxiliaryData();return d.for_(w.applicativeEffect)(d.foldableMaybe)(e.metadata)(o.composeKleisli(w.bindEffect)(b)(t.setAuxiliaryDataGeneralTransactionMetadata(r)))(),d.for_(w.applicativeEffect)(d.foldableMaybe)(e.nativeScripts)((n=t.setAuxiliaryDataNativeScripts(r),function(e){return n(i.convertNativeScripts(e))}))(),d.for_(w.applicativeEffect)(d.foldableMaybe)(e.plutusScripts)((function(e){return function(){var n,o=l.newPlutusScripts();return d.for_(w.applicativeEffect)(d.foldableArray)(e)((n=l.addPlutusScript(o),function(e){return n(c.convertPlutusScript(e))}))(),t.setAuxiliaryDataPlutusScripts(r)(o)()}}))(),r}}}(c),function(e){let n;n=t(1164),n=t(6359)(n),e._BigInt_from_str=e=>t=>{try{return e.just(n.BigInt.from_str(t))}catch(n){return e.nothing}}}(c["Ctl.Internal.Serialization.BigInt"]=c["Ctl.Internal.Serialization.BigInt"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.BigInt"]=e["Ctl.Internal.Serialization.BigInt"]||{};var n,t=e["Ctl.Internal.Serialization.BigInt"],r=e["Ctl.Internal.Serialization.BigInt"],o=e["Ctl.Internal.FfiHelpers"],a=e["Data.BigInt"],u=(n=r._BigInt_from_str(o.maybeFfiHelper),function(e){return n(a.toString(e))});t.convertBigInt=u}(c),function(e){"use strict";e["Ctl.Internal.Serialization"]=e["Ctl.Internal.Serialization"]||{};var n=e["Ctl.Internal.Serialization"],t=e["Ctl.Internal.Serialization"],r=e["Control.Applicative"],o=e["Control.Apply"],a=e["Control.Bind"],u=e["Ctl.Internal.Cardano.Types.ScriptRef"],i=e["Ctl.Internal.Cardano.Types.Transaction"],c=e["Ctl.Internal.Cardano.Types.Value"],l=e["Ctl.Internal.Deserialization.FromBytes"],s=e["Ctl.Internal.FfiHelpers"],f=e["Ctl.Internal.Helpers"],d=e["Ctl.Internal.Serialization.Address"],v=e["Ctl.Internal.Serialization.AuxiliaryData"],m=e["Ctl.Internal.Serialization.BigInt"],p=e["Ctl.Internal.Serialization.Hash"],g=e["Ctl.Internal.Serialization.NativeScript"],y=e["Ctl.Internal.Serialization.PlutusData"],w=e["Ctl.Internal.Serialization.PlutusScript"],h=e["Ctl.Internal.Serialization.WitnessSet"],b=e["Ctl.Internal.Types.BigNum"],C=e["Ctl.Internal.Types.OutputDatum"],A=e["Ctl.Internal.Types.RewardAddress"],S=e["Ctl.Internal.Types.Scripts"],I=e["Ctl.Internal.Types.TokenName"],T=e["Ctl.Internal.Types.VRFKeyHash"],D=e["Data.Foldable"],F=e["Data.FoldableWithIndex"],E=e["Data.Functor"],x=e["Data.Map.Internal"],M=e["Data.Maybe"],R=e["Data.Newtype"],P=e["Data.Set"],B=e["Data.Traversable"],k=e["Data.Tuple"],N=e["Data.UInt"],L=e["Data.Unfoldable"],_=e["Data.Unit"],U=e.Effect,H=e["Untagged.Union"],q=function(e){return t.newUnitInterval(e.numerator)(e.denominator)},O=function(e){return a.bindFlipped(U.bindEffect)(t.newWithdrawals(s.containerHelper))(B.for(U.applicativeEffect)(B.traversableArray)(x.toUnfoldable(L.unfoldableArray)(e))((function(e){return E.map(U.functorEffect)(k.Tuple.create(A.unRewardAddress(e.value0)))(f.fromJustEff("convertWithdrawals: Failed to convert BigNum")(b.fromBigInt(e.value1)))})))},W=function(e){return function(){var n=l.fromBytesEffect(l.fromBytesTransactionHash)(R.wrap()(R.unwrap()(e.transactionId)))();return t.newTransactionInput(n)(e.index)()}},V=function(e){return function(n){return function(){var r=t.newTransactionInputs();return D.traverse_(U.applicativeEffect)(e)(a.composeKleisli(U.bindEffect)(W)(t.addTransactionInput(r)))(n)(),r}}},K=function(e){return function(){var n,r,o,i,s=(n=e.amount,r=c["getNonAdaAsset'"](n),o=c["valueToCoin'"](n),function(){var e=t.newMultiAsset();F.forWithIndex_(U.applicativeEffect)(x.foldableWithIndexMap)(r)((function(n){return function(r){var o=p.scriptHashFromBytes(c.getCurrencySymbol(n));return function(){var n=f.fromJustEff("scriptHashFromBytes failed while converting value")(o)(),a=t.newAssets();return F.forWithIndex_(U.applicativeEffect)(x.foldableWithIndexMap)(r)((function(e){return function(n){var r=I.getTokenName(e);return function(){var e=t.newAssetName(r)(),o=f.fromJustEff("convertValue: number must not be negative")(b.fromBigInt(n))();return t.insertAssets(a)(e)(o)()}}}))(),t.insertMultiAsset(e)(n)(a)()}}}))();var n=t.newValueFromAssets(e)();return a.bindFlipped(U.bindEffect)(t.valueSetCoin(n))(f.fromJustEff("convertValue: coin value must not be negative")(b.fromBigInt(o)))(),n})(),d=t.newTransactionOutput(e.address)(s)();return function(){if(e.datum instanceof C.NoOutputDatum)return _.unit;if(e.datum instanceof C.OutputDatumHash)return D.for_(U.applicativeEffect)(D.foldableMaybe)(l.fromBytes(l.fromBytesDataHash)(R.wrap()(R.unwrap()(e.datum.value0))))(t.transactionOutputSetDataHash(d))();if(e.datum instanceof C.OutputDatum)return t.transactionOutputSetPlutusData(d)(y.convertPlutusData(R.unwrap()(e.datum.value0)))();throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 810, column 3 - line 818, column 28): "+[e.datum.constructor.name])}(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.scriptRef)((i=t.transactionOutputSetScriptRef(d),function(e){return i(function(e){if(e instanceof u.NativeScriptRef)return t.scriptRefNewNativeScript(g.convertNativeScript(e.value0));if(e instanceof u.PlutusScriptRef)return t.scriptRefNewPlutusScript(w.convertPlutusScript(e.value0));throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 823, column 1 - line 823, column 45): "+[e.constructor.name])}(e))}))(),d}},z=function(e){return a.composeKleisli(U.bindEffect)((n=f.fromJustEff("Failed to convert script data hash"),r=l.fromBytes(l.fromBytesPoolMetadataHash),o=R.wrap(),function(e){return n(r(o(e)))}))(t.newPoolMetadata(e.url))(e.hash);var n,r,o},J=function(e){if(e instanceof d.TestnetId)return t.networkIdTestnet;if(e instanceof d.MainnetId)return t.networkIdMainnet;throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 757, column 20 - line 759, column 34): "+[e.constructor.name])},j=function(e){var n=c.unwrapNonAdaAsset(e);return function(){var e=t.newMint();return F.forWithIndex_(U.applicativeEffect)(x.foldableWithIndexMap)(n)((function(n){return function(r){var o=p.scriptHashFromBytes(c.getCurrencySymbol(n));return function(){var n=f.fromJustEff("scriptHashFromBytes failed while converting value")(o)(),a=t.newMintAssets();return F.forWithIndex_(U.applicativeEffect)(x.foldableWithIndexMap)(r)((function(e){return function(n){var r=I.getTokenName(e);return function(){var e=t.newAssetName(r)(),o=f.fromJustEff("convertMint: failed to convert BigInt")(m.convertBigInt(n))(),u=f.fromJustEff("convertMint: numeric overflow or underflow")(t._bigIntToInt(s.maybeFfiHelper)(o))();return t.insertMintAsset(a)(e)(u)()}}}))(),t.insertMintAssets(e)(n)(a)()}}}))(),e}},Q=function(e){return a.join(U.bindEffect)(o.apply(U.applyEffect)(E.map(U.functorEffect)(t.newExUnitPrices)(q(e.memPrice)))(q(e.stepPrice)))},G=function(e){return function(){var n=t.newCostmdls();return F.forWithIndex_(U.applicativeEffect)(x.foldableWithIndexMap)(e)((function(e){return function(r){return function(){var o=function(){if(e instanceof S.PlutusV1)return t.newPlutusV1();if(e instanceof S.PlutusV2)return t.newPlutusV2();throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 860, column 18 - line 862, column 32): "+[e.constructor.name])}(),a=function(e){return function(){var n=t.newCostModel();return F.forWithIndex_(U.applicativeEffect)(F.foldableWithIndexArray)(e)((function(e){return function(r){return t.costModelSetCost(n)(e)(r)}}))(),n}}(r)();return t.costmdlsSetCostModel(n)(o)(a)()}}}))(),n}},Z=function(e){return function(){var n,r=(n=e.proposedProtocolParameterUpdates,a.bindFlipped(U.bindEffect)(t.newProposedProtocolParameterUpdates(s.containerHelper))(B.for(U.applicativeEffect)(B.traversableArray)(x.toUnfoldable(L.unfoldableArray)(R.unwrap()(n)))((function(e){return o.apply(U.applyEffect)(E.map(U.functorEffect)(k.Tuple.create)(f.fromJustEff("Failed to convert genesis hash")(l.fromBytes(l.fromBytesGenesisHash)(R.wrap()(R.unwrap()(e.value0))))))(function(e){return function(){var n,r,o,u,i,c,l,s,d,v,m,p,g,y,w,C,A,S=t.newProtocolParamUpdate();return D.for_(U.applicativeEffect)(D.foldableMaybe)(e.minfeeA)(a.composeKleisliFlipped(U.bindEffect)(t.ppuSetMinfeeA(S))((n=f.fromJustEff("convertProtocolParamUpdate: min_fee_a must not be negative"),r=R.unwrap(),function(e){return n(b.fromBigInt(r(e)))})))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.minfeeB)(a.composeKleisliFlipped(U.bindEffect)(t.ppuSetMinfeeB(S))((o=f.fromJustEff("convertProtocolParamUpdate: min_fee_b must not be negative"),u=R.unwrap(),function(e){return o(b.fromBigInt(u(e)))})))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxBlockBodySize)((i=t.ppuSetMaxBlockBodySize(S),function(e){return i(N.toInt(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxTxSize)((c=t.ppuSetMaxTxSize(S),function(e){return c(N.toInt(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxBlockHeaderSize)((l=t.ppuSetMaxBlockHeaderSize(S),function(e){return l(N.toInt(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.keyDeposit)(a.composeKleisliFlipped(U.bindEffect)(t.ppuSetKeyDeposit(S))((s=f.fromJustEff("convertProtocolParamUpdate: key_deposit must not be negative"),d=R.unwrap(),function(e){return s(b.fromBigInt(d(e)))})))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.poolDeposit)(a.composeKleisliFlipped(U.bindEffect)(t.ppuSetPoolDeposit(S))((v=f.fromJustEff("convertProtocolParamUpdate: pool_deposit must not be negative"),m=R.unwrap(),function(e){return v(b.fromBigInt(m(e)))})))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxEpoch)((p=t.ppuSetMaxEpoch(S),g=R.unwrap(),function(e){return p(N.toInt(g(e)))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.nOpt)((y=t.ppuSetNOpt(S),function(e){return y(N.toInt(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.poolPledgeInfluence)(a.composeKleisli(U.bindEffect)(q)(t.ppuSetPoolPledgeInfluence(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.expansionRate)(a.composeKleisli(U.bindEffect)(q)(t.ppuSetExpansionRate(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.treasuryGrowthRate)(a.composeKleisli(U.bindEffect)(q)(t.ppuSetTreasuryGrowthRate(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.protocolVersion)((function(e){return a.bindFlipped(U.bindEffect)(t.ppuSetProtocolVersion(S))(t.newProtocolVersion(N.toInt(e.major))(N.toInt(e.minor)))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.minPoolCost)(t.ppuSetMinPoolCost(S))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.adaPerUtxoByte)(t.ppuSetAdaPerUtxoByte(S))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.costModels)(a.composeKleisli(U.bindEffect)(G)(t.ppuSetCostModels(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.executionCosts)(a.composeKleisli(U.bindEffect)(Q)(t.ppuSetExecutionCosts(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxTxExUnits)(a.composeKleisli(U.bindEffect)(h.convertExUnits)(t.ppuSetMaxTxExUnits(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxBlockExUnits)(a.composeKleisli(U.bindEffect)(h.convertExUnits)(t.ppuSetMaxBlockExUnits(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxValueSize)((w=t.ppuSetMaxValueSize(S),function(e){return w(N.toInt(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.collateralPercentage)((C=t.ppuSetCollateralPercentage(S),function(e){return C(N.toInt(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxCollateralInputs)((A=t.ppuSetMaxCollateralInputs(S),function(e){return A(N.toInt(e))}))(),S}}(e.value1))}))))();return t.newUpdate(r)(N.toInt(R.unwrap()(e.epoch)))()}},X=function(e){if(e instanceof i.StakeRegistration)return t.newStakeRegistrationCertificate(e.value0);if(e instanceof i.StakeDeregistration)return t.newStakeDeregistrationCertificate(e.value0);if(e instanceof i.StakeDelegation)return t.newStakeDelegationCertificate(e.value0)(R.unwrap()(e.value1));if(e instanceof i.PoolRegistration)return function(){var n,r,o,a=t.newUnitInterval(e.value0.margin.numerator)(e.value0.margin.denominator)(),u=t.convertPoolOwners(s.containerHelper)(E.map(E.functorArray)((n=R.unwrap(),r=R.unwrap(),function(e){return n(r(e))}))(e.value0.poolOwners))(),c=(o=e.value0.relays,E.map(U.functorEffect)(t.packRelays(s.containerHelper))(B.for(U.applicativeEffect)(B.traversableArray)(o)((function(e){if(e instanceof i.SingleHostAddr)return function(){var n=E.map(U.functorEffect)(H.maybeToUor)(B.for(U.applicativeEffect)(B.traversableMaybe)(E.map(M.functorMaybe)(R.unwrap())(e.value0.ipv4))(t.newIpv4))(),r=E.map(U.functorEffect)(H.maybeToUor)(B.for(U.applicativeEffect)(B.traversableMaybe)(E.map(M.functorMaybe)(R.unwrap())(e.value0.ipv6))(t.newIpv6))();return t.newSingleHostAddr(H.maybeToUor(e.value0.port))(n)(r)()};if(e instanceof i.SingleHostName)return t.newSingleHostName(H.maybeToUor(e.value0.port))(e.value0.dnsName);if(e instanceof i.MultiHostName)return t.newMultiHostName(e.value0.dnsName);throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 746, column 55 - line 754, column 31): "+[e.constructor.name])}))))(),l=B.for(U.applicativeEffect)(B.traversableMaybe)(e.value0.poolMetadata)(z)();return t.newPoolRegistrationCertificate(R.unwrap()(e.value0.operator))(T.unVRFKeyHash(e.value0.vrfKeyhash))(e.value0.pledge)(e.value0.cost)(a)(A.unRewardAddress(e.value0.rewardAccount))(u)(c)(H.maybeToUor(l))()};if(e instanceof i.PoolRetirement)return t.newPoolRetirementCertificate(R.unwrap()(e.value0.poolKeyHash))(N.toInt(R.unwrap()(e.value0.epoch)));if(e instanceof i.GenesisKeyDelegation)return a.join(U.bindEffect)(o.apply(U.applyEffect)(o.apply(U.applyEffect)(E.map(U.functorEffect)(t.newGenesisKeyDelegationCertificate)(f.fromJustEff("Failed to convert genesis hash")(l.fromBytes(l.fromBytesGenesisHash)(R.wrap()(e.value0.genesisHash)))))(f.fromJustEff("Failed to convert genesis delegate hash")(l.fromBytes(l.fromBytesGenesisDelegateH)(R.wrap()(e.value0.genesisDelegateHash)))))(r.pure(U.applicativeEffect)(e.value0.vrfKeyhash)));if(e instanceof i.MoveInstantaneousRewardsCert)return a.bindFlipped(U.bindEffect)(t.newMoveInstantaneousRewardsCertificate)(function(e){if(e instanceof i.ToOtherPot)return t.newMoveInstantaneousRewardToOtherPot(e.value0.pot)(e.value0.amount);if(e instanceof i.ToStakeCreds)return a.bind(U.bindEffect)(function(e){return t.newMIRToStakeCredentials(s.containerHelper)(x.toUnfoldable(L.unfoldableArray)(e))}(e.value0.amounts))(t.newMoveInstantaneousRewardToStakeCreds(e.value0.pot));throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 729, column 1 - line 730, column 65): "+[e.constructor.name])}(e.value0));throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 668, column 15 - line 722, column 41): "+[e.constructor.name])},Y=function(e){return function(){var n=t.newCertificates();return D.for_(U.applicativeEffect)(D.foldableArray)(e)(a.composeKleisli(U.bindEffect)(X)(t.addCert(n)))(),n}},$=function(e){return function(){var n,r,o,u,i,c,d,v,m,p,g,y,w,h,C,A,S,I,T,F=V(P.foldableSet)(e.inputs)(),x=(n=e.outputs,function(){var e=t.newTransactionOutputs();return D.traverse_(U.applicativeEffect)(D.foldableArray)(a.composeKleisli(U.bindEffect)(K)(t.addTransactionOutput(e)))(n)(),e})(),M=f.fromJustEff("Failed to convert fee")(b.fromBigInt(R.unwrap()(e.fee)))(),B=t.newTransactionBody(F)(x)(M)();return D.for_(U.applicativeEffect)(D.foldableMaybe)(e.ttl)((r=t.setTxBodyTtl(B),o=R.unwrap(),function(e){return r(o(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.certs)(a.composeKleisli(U.bindEffect)(Y)(t.setTxBodyCerts(B)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.withdrawals)(a.composeKleisli(U.bindEffect)(O)(t.setTxBodyWithdrawals(B)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.update)(a.composeKleisli(U.bindEffect)(Z)(t.setTxBodyUpdate(B)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.auxiliaryDataHash)(a.composeKleisli(U.bindEffect)((u=f.fromJustEff("Failed to convert auxiliary data hash"),i=l.fromBytes(l.fromBytesAuxiliaryDataHas),c=R.wrap(),d=R.unwrap(),function(e){return u(i(c(d(e))))}))(t.transactionBodySetAuxiliaryDataHash(B)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.validityStartInterval)((v=t.transactionBodySetValidityStartInterval(B),m=R.unwrap(),function(e){return v(b.fromStringUnsafe(b.toString(m(e))))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.requiredSigners)((p=t.transactionBodySetRequiredSigners(s.containerHelper)(B),g=E.map(E.functorArray)(R.unwrap()),function(e){return p(g(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.networkId)(a.composeKleisli(U.bindEffect)(J)(t.setTxBodyNetworkId(B)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.mint)(a.composeKleisli(U.bindEffect)(j)(t.setTxBodyMint(B)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.scriptDataHash)(a.composeKleisli(U.bindEffect)((y=f.fromJustEff("Failed to convert script data hash"),w=l.fromBytes(l.fromBytesScriptDataHash),h=R.wrap(),C=R.unwrap(),function(e){return y(w(h(C(e))))}))(t.setTxBodyScriptDataHash(B)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.collateral)(a.composeKleisli(U.bindEffect)(V(D.foldableArray))(t.setTxBodyCollateral(B)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.requiredSigners)((A=t.transactionBodySetRequiredSigners(s.containerHelper)(B),S=E.map(E.functorArray)(R.unwrap()),function(e){return A(S(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.networkId)(a.composeKleisli(U.bindEffect)(J)(t.setTxBodyNetworkId(B)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.collateralReturn)(a.composeKleisli(U.bindEffect)(K)(t.setTxBodyCollateralReturn(B)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.totalCollateral)(a.composeKleisli(U.bindEffect)((I=f.fromJustEff("Failed to convert fee"),T=R.unwrap(),function(e){return I(b.fromBigInt(T(e)))}))(t.setTxBodyTotalCollateral(B)))(),D.null(P.foldableSet)(e.referenceInputs)?_.unit:a.bind(U.bindEffect)(V(P.foldableSet)(e.referenceInputs))(t.setTxBodyReferenceInputs(B))(),B}};n.convertExUnitPrices=Q,n.convertTransaction=function(e){return function(){var n=$(e.body)(),r=h.convertWitnessSet(e.witnessSet)(),o=B.for(U.applicativeEffect)(B.traversableMaybe)(e.auxiliaryData)(v.convertAuxiliaryData)(),a=function(){if(o instanceof M.Nothing)return t.newTransaction_(n)(r)();if(o instanceof M.Just)return t.newTransaction(n)(r)(o.value0)();throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 540, column 11 - line 542, column 45): "+[o.constructor.name])}();return t.setTxIsValid(a)(e.isValid)(),a}},n.convertTxBody=$,n.convertTxOutput=K,n.hashScriptData=function(e){return function(n){return function(r){return function(){var o=t.newRedeemers(),u=G(e)();return D.traverse_(U.applicativeEffect)(D.foldableArray)(a.composeKleisliFlipped(U.bindEffect)(t.addRedeemer(o))(h.convertRedeemer))(n)(),0===r.length?t._hashScriptDataNoDatums(o)(u)():t._hashScriptData(o)(u)(E.map(E.functorArray)(y.convertPlutusData)(r))()}}}},n.hashTransaction=t.hashTransaction,n.publicKeyHash=t.publicKeyHash,n.makeVkeywitness=t.makeVkeywitness}(c),function(e){"use strict";e["Data.MediaType"]=e["Data.MediaType"]||{};var n=e["Data.MediaType"],t=e["Data.Show"],r={show:function(e){return"(MediaType "+t.show(t.showString)(e)+")"}};n.showMediaType=r}(c),function(e){"use strict";e["Data.Time.Duration"]=e["Data.Time.Duration"]||{};var n=e["Data.Time.Duration"],t=e["Control.Category"],r=e["Data.Newtype"],o=function(e){return e},a=function(e){return e.fromDuration},u={fromDuration:r.over()()(o)((function(e){return 1e3*e})),toDuration:r.over()()((function(e){return e}))((function(e){return e/1e3}))},i={fromDuration:t.identity(t.categoryFn),toDuration:t.identity(t.categoryFn)};n.fromDuration=a,n.Seconds=o,n.convertDuration=function(e){return function(n){var t=n.toDuration,r=a(e);return function(e){return t(r(e))}}},n.durationMilliseconds=i,n.durationSeconds=u}(c),function(e){"use strict";e["Ctl.Internal.Service.Blockfrost"]=e["Ctl.Internal.Service.Blockfrost"]||{};var n,t,r,o,a,u,i,c,l,s,f,d,v,m,p,g,y,w,h,b,C,A,S,I,T,D=e["Ctl.Internal.Service.Blockfrost"],F=e.Aeson,E=e.Affjax,x=e["Affjax.RequestBody"],M=e["Affjax.RequestHeader"],R=e["Affjax.ResponseFormat"],P=e["Affjax.ResponseHeader"],B=e["Affjax.StatusCode"],k=e["Control.Alt"],N=e["Control.Applicative"],L=e["Control.Apply"],_=e["Control.Bind"],U=e["Control.Monad.Error.Class"],H=e["Control.Monad.Except.Trans"],q=e["Control.Monad.Logger.Class"],O=e["Control.Monad.Logger.Trans"],W=e["Control.Monad.Maybe.Trans"],V=e["Control.Monad.Reader.Class"],K=e["Control.Monad.Reader.Trans"],z=e["Control.Parallel"],J=e["Control.Parallel.Class"],j=e["Ctl.Internal.Cardano.Types.NativeScript"],Q=e["Ctl.Internal.Cardano.Types.ScriptRef"],G=e["Ctl.Internal.Cardano.Types.Transaction"],Z=e["Ctl.Internal.Cardano.Types.Value"],X=e["Ctl.Internal.Contract.QueryHandle.Error"],Y=e["Ctl.Internal.Deserialization.FromBytes"],$=e["Ctl.Internal.Deserialization.PlutusData"],ee=e["Ctl.Internal.Deserialization.Transaction"],ne=e["Ctl.Internal.QueryM.Ogmios"],te=e["Ctl.Internal.Serialization"],re=e["Ctl.Internal.Serialization.Address"],oe=e["Ctl.Internal.Serialization.Hash"],ae=e["Ctl.Internal.Serialization.ToBytes"],ue=e["Ctl.Internal.ServerConfig"],ie=e["Ctl.Internal.Service.Error"],ce=e["Ctl.Internal.Service.Helpers"],le=e["Ctl.Internal.Types.BigNum"],se=e["Ctl.Internal.Types.ByteArray"],fe=e["Ctl.Internal.Types.CborBytes"],de=e["Ctl.Internal.Types.Chain"],ve=e["Ctl.Internal.Types.Datum"],me=e["Ctl.Internal.Types.EraSummaries"],pe=e["Ctl.Internal.Types.Int"],ge=e["Ctl.Internal.Types.OutputDatum"],ye=e["Ctl.Internal.Types.ProtocolParameters"],we=e["Ctl.Internal.Types.PubKeyHash"],he=e["Ctl.Internal.Types.Rational"],be=e["Ctl.Internal.Types.RawBytes"],Ce=e["Ctl.Internal.Types.RewardAddress"],Ae=e["Ctl.Internal.Types.Scripts"],Se=e["Ctl.Internal.Types.Transaction"],Ie=e["Ctl.Internal.Types.TransactionMetadata"],Te=e["Data.Argonaut.Decode.Error"],De=e["Data.Array"],Fe=e["Data.Bifunctor"],Ee=e["Data.BigInt"],xe=e["Data.BigNumber"],Me=e["Data.Boolean"],Re=e["Data.DateTime.Instant"],Pe=e["Data.Either"],Be=e["Data.Eq"],ke=e["Data.Foldable"],Ne=e["Data.Function"],Le=e["Data.Functor"],_e=e["Data.Generic.Rep"],Ue=e["Data.HTTP.Method"],He=e["Data.JSDate"],qe=e["Data.Log.Level"],Oe=e["Data.Map.Internal"],We=e["Data.Maybe"],Ve=e["Data.MediaType"],Ke=e["Data.Monoid"],ze=e["Data.Newtype"],Je=e["Data.Number"],je=e["Data.Semigroup"],Qe=e["Data.Semiring"],Ge=e["Data.Show"],Ze=e["Data.Show.Generic"],Xe=e["Data.String.CodePoints"],Ye=e["Data.Time.Duration"],$e=e["Data.Traversable"],en=e["Data.Tuple"],nn=e["Effect.Aff"],tn=e["Effect.Aff.Class"],rn=e["Effect.Class"],on=e["Effect.Exception"],an=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),un=function(){function e(){}return e.value=new e,e}(),cn=function(){function e(){}return e.value=new e,e}(),ln=function(){function e(){}return e.value=new e,e}(),sn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),fn=function(){function e(){}return e.value=new e,e}(),dn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),vn=function(){function e(){}return e.value=new e,e}(),mn=function(){function e(){}return e.value=new e,e}(),pn=function(){function e(){}return e.value=new e,e}(),gn=function(){function e(){}return e.value=new e,e}(),yn=function(){function e(){}return e.value=new e,e}(),wn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),hn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),bn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Cn=function(){function e(){}return e.value=new e,e}(),An=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Sn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),In=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),Tn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Dn=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),Fn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),En=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),xn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Mn=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),Rn=je.semigroupArray,Pn=Ke.monoidArray,Bn=Ke.monoidArray,kn={to:function(e){return new an(e.value0,e.value1)},from:function(e){return new _e.Product(e.value0,e.value1)}},Nn={show:Ze.genericShow(kn)(Ze.genericShowConstructor(Ze.genericShowArgsProduct(Ze.genericShowArgsArgument(re.showNetworkId))(Ze.genericShowArgsArgument(Pe.showEither(we.showStakePubKeyHash)(Ae.showStakeValidatorHash))))({reflectSymbol:function(){return"BlockfrostStakeCredential"}}))},Ln={to:function(e){if(e instanceof _e.Inl)return fn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inl)return new dn(e.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inl)return vn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inl)return mn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inl)return pn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inl)return gn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return yn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new wn(e.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new hn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new bn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return Cn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new An(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new Sn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new In(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1.value1);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new Tn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new Dn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new Fn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr)return new En(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 347, column 1 - line 347, column 45): "+[e.constructor.name])},from:function(e){if(e instanceof fn)return new _e.Inl(_e.NoArguments.value);if(e instanceof dn)return new _e.Inr(new _e.Inl(e.value0));if(e instanceof vn)return new _e.Inr(new _e.Inr(new _e.Inl(_e.NoArguments.value)));if(e instanceof mn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(_e.NoArguments.value))));if(e instanceof pn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(_e.NoArguments.value)))));if(e instanceof gn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(_e.NoArguments.value))))));if(e instanceof yn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(_e.NoArguments.value)))))));if(e instanceof wn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0))))))));if(e instanceof hn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0)))))))));if(e instanceof bn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0))))))))));if(e instanceof Cn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(_e.NoArguments.value)))))))))));if(e instanceof An)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0))))))))))));if(e instanceof Sn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0)))))))))))));if(e instanceof In)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(new _e.Product(e.value0,new _e.Product(e.value1,e.value2))))))))))))))));if(e instanceof Tn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0)))))))))))))));if(e instanceof Dn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(new _e.Product(e.value0,e.value1)))))))))))))))));if(e instanceof Fn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0)))))))))))))))));if(e instanceof En)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(e.value0)))))))))))))))));throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 347, column 1 - line 347, column 45): "+[e.constructor.name])}},_n={show:Ze.genericShow(Ln)(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"BlockchainGenesis"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(Se.showDataHash))({reflectSymbol:function(){return"DatumCbor"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"EraSummaries"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"EvaluateTransaction"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"LatestBlock"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"LatestEpoch"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"LatestProtocolParameters"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(oe.showScriptHash))({reflectSymbol:function(){return"NativeScriptByHash"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(oe.showScriptHash))({reflectSymbol:function(){return"PlutusScriptCborByHash"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(oe.showScriptHash))({reflectSymbol:function(){return"ScriptInfo"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"SubmitTransaction"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(Se.showTransactionHash))({reflectSymbol:function(){return"Transaction"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(Se.showTransactionHash))({reflectSymbol:function(){return"TransactionMetadata"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsProduct(Ze.genericShowArgsArgument(re.showAddress))(Ze.genericShowArgsProduct(Ze.genericShowArgsArgument(Ge.showInt))(Ze.genericShowArgsArgument(Ge.showInt))))({reflectSymbol:function(){return"UtxosAtAddress"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(Se.showTransactionHash))({reflectSymbol:function(){return"UtxosOfTransaction"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsProduct(Ze.genericShowArgsArgument(Ge.showInt))(Ze.genericShowArgsArgument(Ge.showInt)))({reflectSymbol:function(){return"PoolIds"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(G.showPoolPubKeyHash))({reflectSymbol:function(){return"PoolParameters"}}))(Ze.genericShowConstructor(Ze.genericShowArgsArgument(Nn))({reflectSymbol:function(){return"DelegationsAndRewards"}})))))))))))))))))))},Un=function(e){return{decodeAeson:_.composeKleisli(Pe.bindEither)(F.decodeAeson(F.decodeAesonString))(_.composeKleisli(Pe.bindEither)(F.decodeJsonString(e))((n=N.pure(Pe.applicativeEither),function(e){return n(e)})))};var n},Hn={decodeAeson:(r=ce.aesonObject((function(e){return _.bind(Pe.bindEither)(_.bind(Pe.bindEither)(F.getField(F.decodeAesonString)(e)("quantity"))((n=Pe.note(new Te.TypeMismatch("Expected string repr of BigInt")),function(e){return n(Ee.fromString(e))})))((function(n){return _.bind(Pe.bindEither)(F.getField(F.decodeAesonString)(e)("unit"))((function(e){if("lovelace"===e)return N.pure(Pe.applicativeEither)(Z.lovelaceValueOf(n));var t=Xe.splitAt(56)(e);return Le.mapFlipped(Pe.functorEither)(ce.decodeAssetClass(e)(t.before)(t.after))((function(e){return Z.mkValue(Ke.mempty(Z.monoidCoin))(Z.mkSingletonNonAdaAsset(e.value0)(e.value1)(n))}))}))}));var n})),o=_.composeKleisli(Pe.bindEither)(Ne.flip(F.getField(F.decodeAesonAeson))("amount"))(ce.aesonArray((n=Le.map(Pe.functorEither)(ke.fold(ke.foldableArray)(Z.monoidValue)),t=$e.traverse($e.traversableArray)(Pe.applicativeEither)(r),function(e){return n(t(e))}))),ce.aesonObject((function(e){return _.bind(Pe.bindEither)(function(e){return _.bind(Pe.bindEither)(F.getField(F.decodeAesonString)(e)("address"))((function(e){return Pe.note(new Te.TypeMismatch("Expected bech32 encoded address"))(re.addressFromBech32(e))}))}(e))((function(n){return _.bind(Pe.bindEither)(o(e))((function(t){return _.bind(Pe.bindEither)(function(e){return _.bind(Pe.bindEither)(F["getFieldOptional'"](fe.decodeAesonCborBytes)(e)("inline_datum"))((function(n){if(n instanceof We.Just)return Pe.note(new Te.TypeMismatch("Expected CBOR encoded inline datum"))(Le.map(We.functorMaybe)(ge.OutputDatum.create)($.deserializeData(ve.fromDataDatum)(n.value0)));if(n instanceof We.Nothing)return Le.map(Pe.functorEither)(We.maybe(ge.NoOutputDatum.value)(ge.OutputDatumHash.create))(F["getFieldOptional'"](Se.decodeAesonDataHash)(e)("data_hash"));throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 996, column 48 - line 1002, column 50): "+[n.constructor.name])}))}(e))((function(r){return _.bind(Pe.bindEither)(F["getFieldOptional'"](oe.decodeAesonScriptHash)(e)("reference_script_hash"))((function(e){return N.pure(Pe.applicativeEither)(ze.wrap()({address:n,amount:t,datum:r,scriptHash:e}))}))}))}))}))})))},qn={decodeAeson:(i=ce.aesonObject((function(e){return _.bind(Pe.bindEither)(F.getField(Se.decodeAesonTransactionHas)(e)("tx_hash"))((function(n){return _.bind(Pe.bindEither)(F.getField(F.decodeAesonUInt)(e)("output_index"))((function(e){return N.pure(Pe.applicativeEither)({transactionId:n,index:e})}))}))})),c=function(e){return L.apply(Pe.applyEither)(Le.map(Pe.functorEither)(en.Tuple.create)(i(e)))(F.decodeAeson(Hn)(e))},ce.aesonArray((a=Le.map(Pe.functorEither)(ze.wrap()),u=$e.traverse($e.traversableArray)(Pe.applicativeEither)(c),function(e){return a(u(e))})))},On={decodeAeson:ce.aesonObject((function(e){return _.bind(Pe.bindEither)(F.getField(Se.decodeAesonTransactionHas)(e)("hash"))((function(n){return _.bind(Pe.bindEither)(F.getField(F.decodeAesonAeson)(e)("outputs"))(ce.aesonArray((t=Le.map(Pe.functorEither)(ze.wrap()),r=$e.traverse($e.traversableArray)(Pe.applicativeEither)(function(e){return function(n){return L.apply(Pe.applyEither)(Le.map(Pe.functorEither)(en.Tuple.create)(function(e){return ce.aesonObject((n=Le.map(Pe.functorEither)((function(n){return{transactionId:e,index:n}})),t=Ne.flip(F.getField(F.decodeAesonUInt))("output_index"),function(e){return n(t(e))}));var n,t}(e)(n)))(F.decodeAeson(Hn)(n))}}(n)),function(e){return t(r(e))})));var t,r}))}))},Wn={decodeAeson:ce.aesonObject((function(e){return _.bind(Pe.bindEither)(Le.map(Pe.functorEither)((function(e){return Ye.Seconds(Ee.toNumber(e))}))(F.getField(F.decodeAesonBigInt)(e)("system_start")))((function(e){return Pe.note(new Te.TypeMismatch("Unix timestamp"))(Le.map(We.functorMaybe)((n=ze.wrap(),t=ze.wrap(),function(e){return n(t(Re.toDateTime(e)))}))(Re.instant(Ye.convertDuration(Ye.durationSeconds)(Ye.durationMilliseconds)(e))));var n,t}))}))},Vn={decodeAeson:ce.aesonString((function(e){return"timelock"===e?N.pure(Pe.applicativeEither)(un.value):"plutusV1"===e?N.pure(Pe.applicativeEither)(cn.value):"plutusV2"===e?N.pure(Pe.applicativeEither)(ln.value):new Pe.Left(new Te.TypeMismatch("language: expected 'native' or 'plutusV{1|2}', got: "+e))}))},Kn={decodeAeson:ce.aesonObject((s=Le.map(Pe.functorEither)((l=ze.wrap(),function(e){return l({language:e})})),f=Ne.flip(F.getField(Vn))("type"),function(e){return s(f(e))}))},zn={decodeAeson:function(e){return _.bind(Pe.bindEither)(F.decodeAeson(F.decodeAesonObject(F.decodeAesonAeson))(e))((function(e){return _.bind(Pe.bindEither)(F.getField(F.decodeAesonMaybe(G.decodeAesonPoolPubKeyHash))(e)("pool_id"))((function(n){return _.bind(Pe.bindEither)(F.getFieldOptional(F.decodeAesonString)(e)("withdrawable_amount"))((function(e){return _.bind(Pe.bindEither)($e.for(Pe.applicativeEither)($e.traversableMaybe)(e)((function(e){return Pe.note(new Te.TypeMismatch("BigInt"))(Le.map(We.functorMaybe)(Z.Coin)(Ee.fromString(e)))})))((function(e){return N.pure(Pe.applicativeEither)({pool_id:n,withdrawable_amount:e})}))}))}))}))}},Jn={decodeAeson:(v=function(e){var n=_.bind(Pe.bindEither)(F.getField(F.decodeAesonArray(F.decodeAesonAeson))(e)("scripts"))($e.traverse($e.traversableArray)(Pe.applicativeEither)(ce.aesonObject(v)));return _.bind(Pe.bindEither)(F.getField(F.decodeAesonString)(e)("type"))((function(t){return"sig"===t?Le.map(Pe.functorEither)(j.ScriptPubkey.create)(_.bind(Pe.bindEither)(F.getField(se.decodeAesonByteArray)(e)("keyHash"))((r=Pe.note(new Te.TypeMismatch("Ed25519KeyHash")),function(e){return r(oe.ed25519KeyHashFromBytes(e))}))):"before"===t?Le.map(Pe.functorEither)(j.TimelockExpiry.create)(F.getField(re.decodeAesonSlot)(e)("slot")):"after"===t?Le.map(Pe.functorEither)(j.TimelockStart.create)(F.getField(re.decodeAesonSlot)(e)("slot")):"all"===t?Le.map(Pe.functorEither)(j.ScriptAll.create)(n):"any"===t?Le.map(Pe.functorEither)(j.ScriptAny.create)(n):"atLeast"===t?L.apply(Pe.applyEither)(Le.map(Pe.functorEither)(j.ScriptNOfK.create)(F.getField(F.decodeAesonInt)(e)("required")))(n):new Pe.Left(new Te.TypeMismatch("Native script constructor"));var r}))},_.composeKleisli(Pe.bindEither)(ce.aesonObject(Ne.flip(F.getField(F.decodeAesonObject(F.decodeAesonAeson)))("json")))((d=Le.map(Pe.functorEither)(ze.wrap()),function(e){return d(v(e))})))},jn={decodeAeson:_.composeKleisli(Pe.bindEither)(F.decodeAeson(F.decodeAesonArray(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(fe.decodeAesonCborBytes))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"metadata"}})()())())))((function(e){return _.bind(Pe.bindEither)($e.for(Pe.applicativeEither)($e.traversableArray)(e)((function(e){return Le.map(Le.functorFn)(Le.map(Pe.functorEither)((n=ze.unwrap(),function(e){return n(ee.convertGeneralTransactionMetadata(e))})))(Ne.flip(Pe.note)(Y.fromBytes(Y.fromBytesGeneralTransacti)(e.metadata)))(new Te.TypeMismatch("Hexadecimal encoded Metadata"));var n})))((function(e){return N.pure(Pe.applicativeEither)(Oe.unions(Ie.ordTransactionMetadatumLa)(ke.foldableArray)(e))}))}))},Qn={decodeAeson:function(e){var n=_.bind(Pe.bindEither)(F.decodeAeson(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(ne.decodeAesonTxEvaluationR))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"result"}})()())())(e))((function(e){return N.pure(Pe.applicativeEither)(new Pe.Right(e.result))})),t=N.pure(Pe.applicativeEither)(new Pe.Left(e));return Le.mapFlipped(Pe.functorEither)(k.alt(Pe.altEither)(n)(t))(sn.create)}},Gn={decodeAeson:(w=function(e){return _.bind(Pe.bindEither)(F.getField(me.decodeAesonEpochLength)(e)("epoch_length"))((function(n){return _.bind(Pe.bindEither)(Le.map(Pe.functorEither)(Le.map(Le.functorFn)(ze.wrap())(Qe.mul(Qe.semiringNumber)(1e3)))(F.getField(F.decodeAesonNumber)(e)("slot_length")))((function(t){return _.bind(Pe.bindEither)(F.getField(me.decodeAesonSafeZone)(e)("safe_zone"))((function(e){return N.pure(Pe.applicativeEither)(ze.wrap()({epochLength:n,slotLength:t,safeZone:e}))}))}))}))},h=ce.aesonObject((function(e){return _.bind(Pe.bindEither)(F.getField(me.decodeAesonEraSummaryTime)(e)("start"))((function(n){return _.bind(Pe.bindEither)(F.getField(F.decodeAesonMaybe(me.decodeAesonEraSummaryTime))(e)("end"))((function(t){return _.bind(Pe.bindEither)(_.bindFlipped(Pe.bindEither)(w)(F.getField(F.decodeAesonObject(F.decodeAesonAeson))(e)("parameters")))((function(e){return N.pure(Pe.applicativeEither)(ze.wrap()({start:n,end:t,parameters:e}))}))}))}))})),ce.aesonArray((g=Le.map(Pe.functorEither)((m=ze.wrap(),p=ze.wrap(),function(e){return m(p(e))})),y=$e.traverse($e.traversableArray)(Pe.applicativeEither)(h),function(e){return g(y(e))})))},Zn={decodeAeson:function(e){if(F.isNull(e))return N.pure(Pe.applicativeEither)(We.Nothing.value);if(Me.otherwise)return _.bind(Pe.bindEither)(ce.aesonObject(Ne.flip(F.getFieldOptional(fe.decodeAesonCborBytes))("cbor"))(e))((function(e){return N.pure(Pe.applicativeEither)(_.bindFlipped(We.bindMaybe)($.deserializeData(ve.fromDataDatum))(e))}));throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 1145, column 1 - line 1150, column 58): "+[e.constructor.name])}},Xn={decodeAeson:function(e){return Le.mapFlipped(Pe.functorEither)(F.decodeAeson(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonBigInt))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"epoch"}})()())())(e))((function(e){return ze.wrap()(e.epoch)}))}},Yn={decodeAeson:ce.aesonObject((function(e){return _.bind(Pe.bindEither)(Le.map(Pe.functorEither)(ze.wrap())(F.getField(F.decodeAesonString)(e)("hash")))((function(n){return Le.mapFlipped(Pe.functorEither)(F["getFieldOptional'"](re.decodeAesonSlot)(e)("slot"))((r=ze.wrap(),o=We.maybe(de.TipAtGenesis.value)((t=ze.wrap(),function(e){return de.Tip.create(t({blockHeaderHash:n,slot:e}))})),function(e){return r(o(e))}));var t,r,o}))}))},$n={decodeAeson:function(e){if(F.isNull(e))return N.pure(Pe.applicativeEither)(We.Nothing.value);if(Me.otherwise)return _.bind(Pe.bindEither)(ce.aesonObject(Ne.flip(F.getFieldOptional(se.decodeAesonByteArray))("cbor"))(e))((function(e){return N.pure(Pe.applicativeEither)(e)}));throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 1123, column 1 - line 1128, column 35): "+[e.constructor.name])}},et=ze.unwrap(),nt=ze.unwrap(),tt=function(e){return e},rt=function(e){return e.value0},ot=ze.unwrap(),at=ze.unwrap(),ut=ze.unwrap(),it=function(e){var n=xe.toFraction(F.unpackFinite(e))(xe.fromNumber(Je.infinity));return new en.Tuple(xe.toString(n.value0),xe.toString(n.value1))},ct=(b=ze.unwrap(),function(e){return b(e).language}),lt=function(e){return function(n){if(n instanceof Pe.Left)return new Pe.Left(new ie.ClientHttpError(n.value0));if(n instanceof Pe.Right){if(n.value0.status<200||n.value0.status>299)return _.bind(Pe.bindEither)(Fe.lmap(Fe.bifunctorEither)(ie.ClientDecodeJsonError.create(n.value0.body))(_.composeKleisliFlipped(Pe.bindEither)(F.decodeAeson(ie.decodeAesonBlockfrostErro))(F.parseJsonStringToAeson)(n.value0.body)))((function(e){return new Pe.Left(new ie.ClientHttpResponseError(ze.wrap()(n.value0.status),new ie.ServiceBlockfrostError(e)))}));if(Me.otherwise)return Fe.lmap(Fe.bifunctorEither)(ie.ClientDecodeJsonError.create(n.value0.body))(_.composeKleisliFlipped(Pe.bindEither)(F.decodeAeson(e))(F.parseJsonStringToAeson)(n.value0.body))}throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 494, column 1 - line 498, column 31): "+[n.constructor.name])}},st=function(e){return e instanceof Pe.Left&&e.value0 instanceof ie.ClientHttpResponseError&&404===e.value0.value0?new Pe.Right(We.Nothing.value):e},ft=function(e){var n=Le.map(Pe.functorEither)(We.fromMaybe(Ke.mempty(e)));return function(e){return n(st(e))}},dt=function(e){if(e instanceof fn)return"/genesis";if(e instanceof dn)return"/scripts/datum/"+se.byteArrayToHex(e.value0)+"/cbor";if(e instanceof vn)return"/network/eras";if(e instanceof mn)return"/utils/txs/evaluate";if(e instanceof pn)return"/blocks/latest";if(e instanceof gn)return"/epochs/latest";if(e instanceof yn)return"/epochs/latest/parameters";if(e instanceof wn)return"/scripts/"+be.rawBytesToHex(oe.scriptHashToBytes(e.value0))+"/json";if(e instanceof hn)return"/scripts/"+be.rawBytesToHex(oe.scriptHashToBytes(e.value0))+"/cbor";if(e instanceof bn)return"/scripts/"+be.rawBytesToHex(oe.scriptHashToBytes(e.value0));if(e instanceof Cn)return"/tx/submit";if(e instanceof An)return"/txs/"+se.byteArrayToHex(ze.unwrap()(e.value0));if(e instanceof Sn)return"/txs/"+se.byteArrayToHex(ze.unwrap()(e.value0))+"/metadata/cbor";if(e instanceof In)return"/addresses/"+re.addressBech32(e.value0)+"/utxos?page="+Ge.show(Ge.showInt)(e.value1)+"&count="+Ge.show(Ge.showInt)(e.value2);if(e instanceof Tn)return"/txs/"+se.byteArrayToHex(ze.unwrap()(e.value0))+"/utxos";if(e instanceof Dn)return"/pools?page="+Ge.show(Ge.showInt)(e.value0)+"&count="+Ge.show(Ge.showInt)(e.value1)+"&order=asc";if(e instanceof Fn)return"/pool/"+G.poolPubKeyHashToBech32(e.value0);if(e instanceof En)return"/accounts/"+function(e){if(e.value1 instanceof Pe.Left)return Ce.rewardAddressToBech32(Ce.stakePubKeyHashRewardAddress(e.value0)(e.value1.value0));if(e.value1 instanceof Pe.Right)return Ce.rewardAddressToBech32(Ce.stakeValidatorHashRewardAddress(e.value0)(e.value1.value0));throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 1210, column 37 - line 1216, column 25): "+[e.constructor.name])}(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 356, column 3 - line 393, column 67): "+[e.constructor.name])},vt=function(e){return function(n){var t=function(e){return function(n){return q.log(O.monadLoggerLoggerT(K.monadEffectReader(nn.monadEffectAff)))({level:qe.Trace.value,message:n,tags:Oe.empty,timestamp:e})}},r=function(){if(e instanceof xn)return Ge.show(Ge.showRecord()(Ge.showRecordFieldsCons({reflectSymbol:function(){return"endpoint"}})(Ge.showRecordFieldsCons({reflectSymbol:function(){return"url"}})(Ge.showRecordFieldsNil)(Ge.showString))(_n)))({endpoint:e.value0,url:dt(e.value0)});if(e instanceof Mn)return Ge.show(Ge.showRecord()(Ge.showRecordFieldsCons({reflectSymbol:function(){return"endpoint"}})(Ge.showRecordFieldsCons({reflectSymbol:function(){return"mediaType"}})(Ge.showRecordFieldsCons({reflectSymbol:function(){return"url"}})(Ge.showRecordFieldsNil)(Ge.showString))(Ve.showMediaType))(_n)))({endpoint:e.value0,mediaType:e.value1,url:dt(e.value0)});throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 483, column 20 - line 488, column 80): "+[e.constructor.name])}();return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(rn.liftEffect(O.monadEffectLoggerT(K.monadEffectReader(nn.monadEffectAff)))(He.now))((function(e){return _.discard(_.discardUnit)(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(t(e)(r))((function(){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(n)((function(n){return _.discard(_.discardUnit)(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(t(e)(Pe.either(E.printError)(Ge.show(Ge.showRecord()(Ge.showRecordFieldsCons({reflectSymbol:function(){return"body"}})(Ge.showRecordFieldsCons({reflectSymbol:function(){return"headers"}})(Ge.showRecordFieldsCons({reflectSymbol:function(){return"status"}})(Ge.showRecordFieldsCons({reflectSymbol:function(){return"statusText"}})(Ge.showRecordFieldsNil)(Ge.showString))(B.showStatusCode))(Ge.showArray(P.showResponseHeader)))(Ge.showString))))(n)))((function(){return N.pure(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(n)}))}))}))}))}},mt=function(e){return function(n){return function(t){return vt(new Mn(e,n,t))(_.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(V.ask(O.monadAskLoggerT(K.monadAskReaderT(nn.monadAff))))((function(r){return _.bindFlipped(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(function(e){return function(n){return function(t){return function(r){return _.discard(_.discardUnit)(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(ke.for_(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(ke.foldableEither)(r)((function(r){var o={endpoint:e,mediaType:n,requestBody:t,rawResponse:r.body};return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(V.asks(O.monadAskLoggerT(K.monadAskReaderT(nn.monadAff)))((function(e){return e.onBlockfrostRawPostResponse})))((function(e){return tn.liftAff(O.monadAffLoggerT(tn.monadAffReader(tn.monadAffAff)))(ke.for_(nn.applicativeAff)(ke.foldableMaybe)(e)((function(e){return e(o)})))}))})))((function(){return N.pure(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(r)}))}}}}(e)(n)(t))(tn.liftAff(O.monadAffLoggerT(tn.monadAffReader(tn.monadAffAff)))(E.request({method:new Pe.Left(Ue.POST.value),url:ue.mkHttpUrl(r.blockfrostConfig)+dt(e),headers:je.append(je.semigroupArray)([new M.ContentType(n)])(We.maybe(Ke.mempty(Ke.monoidArray))((function(e){return[new M.RequestHeader("project_id",e)]}))(r.blockfrostApiKey)),content:t,username:E.defaultRequest.username,password:E.defaultRequest.password,withCredentials:E.defaultRequest.withCredentials,responseFormat:R.string,timeout:E.defaultRequest.timeout})))})))}}},pt=function(e){return vt(new xn(e))(_.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(V.ask(O.monadAskLoggerT(K.monadAskReaderT(nn.monadAff))))((function(n){return _.bindFlipped(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(function(e){return function(n){return _.discard(_.discardUnit)(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(ke.for_(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(ke.foldableEither)(n)((function(n){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(V.asks(O.monadAskLoggerT(K.monadAskReaderT(nn.monadAff)))((function(e){return e.onBlockfrostRawGetResponse})))((function(t){return tn.liftAff(O.monadAffLoggerT(tn.monadAffReader(tn.monadAffAff)))(ke.for_(nn.applicativeAff)(ke.foldableMaybe)(t)((function(t){return t(e)(n.body)})))}))})))((function(){return N.pure(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(n)}))}}(e))(tn.liftAff(O.monadAffLoggerT(tn.monadAffReader(tn.monadAffAff)))(E.request({method:new Pe.Left(Ue.GET.value),url:ue.mkHttpUrl(n.blockfrostConfig)+dt(e),headers:We.maybe(Ke.mempty(Ke.monoidArray))((function(e){return[new M.RequestHeader("project_id",e)]}))(n.blockfrostApiKey),content:E.defaultRequest.content,username:E.defaultRequest.username,password:E.defaultRequest.password,withCredentials:E.defaultRequest.withCredentials,responseFormat:R.string,timeout:E.defaultRequest.timeout})))})))},gt=H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.map(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(lt(Yn))(pt(pn.value)))((function(e){return N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(ze.unwrap()(e))}))),yt=Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(gn.value))((C=Le.map(Pe.functorEither)(at),A=lt(Xn),function(e){return C(A(e))})),wt=H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.map(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(lt(Gn))(pt(vn.value)))((function(e){return N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(ze.unwrap()(e))}))),ht=(S=function(e){return H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new Dn(e,100)))((n=ft(Ke.monoidArray),t=lt(F.decodeAesonMaybe(F.decodeAesonArray(G.decodeAesonPoolPubKeyHash))),function(e){return n(t(e))})))((function(n){return De.length(n)<100?N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(n):Le.map(H.functorExceptT(O.functorLoggerT(K.functorReaderT(nn.functorAff))))(je.append(je.semigroupArray)(n))(S(e+1|0))})));var n,t},H.runExceptT(S(1))),bt=function(e){var n=Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new hn(e)))((function(e){return st(Le.map(Pe.functorEither)(ut)(lt($n)(e)))})),t=Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new wn(e)))((function(e){return Le.map(Pe.functorEither)(Le.map(We.functorMaybe)(nt))(st(lt(F.decodeAesonMaybe(Jn))(e)))}));return H.runExceptT(W.runMaybeT(_.bind(W.bindMaybeT(H.monadExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff)))))(function(e){return Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new bn(e)))((function(e){return st(lt(F.decodeAesonMaybe(Kn))(e))}))}(e))((function(e){var r=ct(e);if(r instanceof un)return Le.map(W.functorMaybeT(H.functorExceptT(O.functorLoggerT(K.functorReaderT(nn.functorAff)))))(Q.NativeScriptRef.create)(t);if(r instanceof cn)return Le.map(W.functorMaybeT(H.functorExceptT(O.functorLoggerT(K.functorReaderT(nn.functorAff)))))((function(e){return Q.PlutusScriptRef.create(Ae.plutusV1Script(e))}))(n);if(r instanceof ln)return Le.map(W.functorMaybeT(H.functorExceptT(O.functorLoggerT(K.functorReaderT(nn.functorAff)))))((function(e){return Q.PlutusScriptRef.create(Ae.plutusV2Script(e))}))(n);throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 578, column 3 - line 587, column 51): "+[r.constructor.name])}))))},Ct=function(e){var n=H.runExceptT($e.for(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))($e.traversableMaybe)(e.scriptHash)((function(e){return _.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(bt(e))((function(e){return Ne.flip(U.liftMaybe(H.monadThrowExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff)))))(e)(new ie.ClientOtherError("Blockfrost: Failed to resolve reference script"))}))})));return Le.map(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(Le.map(Pe.functorEither)((function(n){return{address:e.address,amount:e.amount,datum:e.datum,scriptRef:n}})))(n)},At=H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.map(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(lt(Wn))(pt(fn.value)))((function(e){return N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(ze.unwrap()(e))}))),St=function(e){var n=it(e);return Pe.note(new Te.TypeMismatch("Rational"))(_.bind(We.bindMaybe)(Ee.fromString(n.value0))((function(e){return _.bind(We.bindMaybe)(Ee.fromString(n.value1))((function(n){return he.reduce(he.rationalComponentBigInt)(e)(n)}))})))},It=function(e){var n=it(e);return Pe.note(new Te.TypeMismatch("Rational"))(_.bind(We.bindMaybe)(le.fromString(n.value0))((function(e){return _.bind(We.bindMaybe)(le.fromString(n.value1))((function(n){return N.pure(We.applicativeMaybe)({numerator:e,denominator:n})}))})))},Tt={decodeAeson:_.composeKleisli(Pe.bindEither)(F.decodeAeson(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonFiniteBigNumbe))(F.gDecodeAesonCons(F.decodeAesonFieldMaybe(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonFieldMaybe(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"verifyEd25519Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"unMapData-memory-arguments"}})()())({reflectSymbol:function(){return"unMapData-cpu-arguments"}})()())({reflectSymbol:function(){return"unListData-memory-arguments"}})()())({reflectSymbol:function(){return"unListData-cpu-arguments"}})()())({reflectSymbol:function(){return"unIData-memory-arguments"}})()())({reflectSymbol:function(){return"unIData-cpu-arguments"}})()())({reflectSymbol:function(){return"unConstrData-memory-arguments"}})()())({reflectSymbol:function(){return"unConstrData-cpu-arguments"}})()())({reflectSymbol:function(){return"unBData-memory-arguments"}})()())({reflectSymbol:function(){return"unBData-cpu-arguments"}})()())({reflectSymbol:function(){return"trace-memory-arguments"}})()())({reflectSymbol:function(){return"trace-cpu-arguments"}})()())({reflectSymbol:function(){return"tailList-memory-arguments"}})()())({reflectSymbol:function(){return"tailList-cpu-arguments"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sndPair-memory-arguments"}})()())({reflectSymbol:function(){return"sndPair-cpu-arguments"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha3_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha2_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"nullList-memory-arguments"}})()())({reflectSymbol:function(){return"nullList-cpu-arguments"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"mkPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkCons-memory-arguments"}})()())({reflectSymbol:function(){return"mkCons-cpu-arguments"}})()())({reflectSymbol:function(){return"mapData-memory-arguments"}})()())({reflectSymbol:function(){return"mapData-cpu-arguments"}})()())({reflectSymbol:function(){return"listData-memory-arguments"}})()())({reflectSymbol:function(){return"listData-cpu-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lengthOfByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lengthOfByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"indexByteString-memory-arguments"}})()())({reflectSymbol:function(){return"indexByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-memory-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-cpu-arguments"}})()())({reflectSymbol:function(){return"iData-memory-arguments"}})()())({reflectSymbol:function(){return"iData-cpu-arguments"}})()())({reflectSymbol:function(){return"headList-memory-arguments"}})()())({reflectSymbol:function(){return"headList-cpu-arguments"}})()())({reflectSymbol:function(){return"fstPair-memory-arguments"}})()())({reflectSymbol:function(){return"fstPair-cpu-arguments"}})()())({reflectSymbol:function(){return"equalsString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"equalsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsData-memory-arguments"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"constrData-memory-arguments"}})()())({reflectSymbol:function(){return"constrData-cpu-arguments"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"chooseUnit-memory-arguments"}})()())({reflectSymbol:function(){return"chooseUnit-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseList-memory-arguments"}})()())({reflectSymbol:function(){return"chooseList-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseData-memory-arguments"}})()())({reflectSymbol:function(){return"chooseData-cpu-arguments"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"blake2b_256-memory-arguments"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"bData-memory-arguments"}})()())({reflectSymbol:function(){return"bData-cpu-arguments"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-intercept"}})()())()))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"verifyEcdsaSecp256k1Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifyEcdsaSecp256k1Signature-cpu-arguments"}})()())({reflectSymbol:function(){return"unMapData-memory-arguments"}})()())({reflectSymbol:function(){return"unMapData-cpu-arguments"}})()())({reflectSymbol:function(){return"unListData-memory-arguments"}})()())({reflectSymbol:function(){return"unListData-cpu-arguments"}})()())({reflectSymbol:function(){return"unIData-memory-arguments"}})()())({reflectSymbol:function(){return"unIData-cpu-arguments"}})()())({reflectSymbol:function(){return"unConstrData-memory-arguments"}})()())({reflectSymbol:function(){return"unConstrData-cpu-arguments"}})()())({reflectSymbol:function(){return"unBData-memory-arguments"}})()())({reflectSymbol:function(){return"unBData-cpu-arguments"}})()())({reflectSymbol:function(){return"trace-memory-arguments"}})()())({reflectSymbol:function(){return"trace-cpu-arguments"}})()())({reflectSymbol:function(){return"tailList-memory-arguments"}})()())({reflectSymbol:function(){return"tailList-cpu-arguments"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sndPair-memory-arguments"}})()())({reflectSymbol:function(){return"sndPair-cpu-arguments"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha3_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha2_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"serialiseData-memory-arguments-slope"}})()())({reflectSymbol:function(){return"serialiseData-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"serialiseData-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"serialiseData-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"nullList-memory-arguments"}})()())({reflectSymbol:function(){return"nullList-cpu-arguments"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"mkPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkCons-memory-arguments"}})()())({reflectSymbol:function(){return"mkCons-cpu-arguments"}})()())({reflectSymbol:function(){return"mapData-memory-arguments"}})()())({reflectSymbol:function(){return"mapData-cpu-arguments"}})()())({reflectSymbol:function(){return"listData-memory-arguments"}})()())({reflectSymbol:function(){return"listData-cpu-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lengthOfByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lengthOfByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"indexByteString-memory-arguments"}})()())({reflectSymbol:function(){return"indexByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-memory-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-cpu-arguments"}})()())({reflectSymbol:function(){return"iData-memory-arguments"}})()())({reflectSymbol:function(){return"iData-cpu-arguments"}})()())({reflectSymbol:function(){return"headList-memory-arguments"}})()())({reflectSymbol:function(){return"headList-cpu-arguments"}})()())({reflectSymbol:function(){return"fstPair-memory-arguments"}})()())({reflectSymbol:function(){return"fstPair-cpu-arguments"}})()())({reflectSymbol:function(){return"equalsString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"equalsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsData-memory-arguments"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"constrData-memory-arguments"}})()())({reflectSymbol:function(){return"constrData-cpu-arguments"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"chooseUnit-memory-arguments"}})()())({reflectSymbol:function(){return"chooseUnit-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseList-memory-arguments"}})()())({reflectSymbol:function(){return"chooseList-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseData-memory-arguments"}})()())({reflectSymbol:function(){return"chooseData-cpu-arguments"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"blake2b_256-memory-arguments"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"bData-memory-arguments"}})()())({reflectSymbol:function(){return"bData-cpu-arguments"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-intercept"}})()())()))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"PlutusV2"}})()())({reflectSymbol:function(){return"PlutusV1"}})()())()))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonBigInt))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonUInt)))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonFiniteBigNumbe))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonFiniteBigNumbe))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonFiniteBigNumbe))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonFiniteBigNumbe))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"tau"}})()())({reflectSymbol:function(){return"rho"}})()())({reflectSymbol:function(){return"protocol_minor_ver"}})()())({reflectSymbol:function(){return"protocol_major_ver"}})()())({reflectSymbol:function(){return"price_step"}})()())({reflectSymbol:function(){return"price_mem"}})()())({reflectSymbol:function(){return"pool_deposit"}})()())({reflectSymbol:function(){return"n_opt"}})()())({reflectSymbol:function(){return"min_pool_cost"}})()())({reflectSymbol:function(){return"min_fee_b"}})()())({reflectSymbol:function(){return"min_fee_a"}})()())({reflectSymbol:function(){return"max_val_size"}})()())({reflectSymbol:function(){return"max_tx_size"}})()())({reflectSymbol:function(){return"max_tx_ex_steps"}})()())({reflectSymbol:function(){return"max_tx_ex_mem"}})()())({reflectSymbol:function(){return"max_collateral_inputs"}})()())({reflectSymbol:function(){return"max_block_size"}})()())({reflectSymbol:function(){return"max_block_header_size"}})()())({reflectSymbol:function(){return"max_block_ex_steps"}})()())({reflectSymbol:function(){return"max_block_ex_mem"}})()())({reflectSymbol:function(){return"key_deposit"}})()())({reflectSymbol:function(){return"e_max"}})()())({reflectSymbol:function(){return"cost_models"}})()())({reflectSymbol:function(){return"collateral_percent"}})()())({reflectSymbol:function(){return"coins_per_utxo_word"}})()())({reflectSymbol:function(){return"coins_per_utxo_size"}})()())({reflectSymbol:function(){return"a0"}})()())()))((function(e){return _.bind(Pe.bindEither)(St(e.a0))((function(n){return _.bind(Pe.bindEither)(St(e.rho))((function(t){return _.bind(Pe.bindEither)(St(e.tau))((function(r){return _.bind(Pe.bindEither)(It(e.price_mem))((function(o){return _.bind(Pe.bindEither)(It(e.price_step))((function(a){var u,i,c={memPrice:o,stepPrice:a};return _.bind(Pe.bindEither)(We.maybe(new Pe.Left(new Te.AtKey("coinsPerUtxoByte or coinsPerUtxoWord",Te.MissingValue.value)))(N.pure(Pe.applicativeEither))(k.alt(We.altMaybe)(Le.map(We.functorMaybe)((i=ze.unwrap(),function(e){return ye.CoinsPerUtxoByte.create(Z.Coin(i(e)))}))(e.coins_per_utxo_size))(Le.map(We.functorMaybe)((u=ze.unwrap(),function(e){return ye.CoinsPerUtxoWord.create(Z.Coin(u(e)))}))(e.coins_per_utxo_word))))((function(o){return N.pure(Pe.applicativeEither)({protocolVersion:new en.Tuple(e.protocol_major_ver,e.protocol_minor_ver),decentralization:Qe.zero(he.semiringRational),extraPraosEntropy:We.Nothing.value,maxBlockHeaderSize:e.max_block_header_size,maxBlockBodySize:e.max_block_size,maxTxSize:e.max_tx_size,txFeeFixed:e.min_fee_b,txFeePerByte:e.min_fee_a,stakeAddressDeposit:ze.unwrap()(e.key_deposit),stakePoolDeposit:ze.unwrap()(e.pool_deposit),minPoolCost:ze.unwrap()(e.min_pool_cost),poolRetireMaxEpoch:e.e_max,stakePoolTargetNum:e.n_opt,poolPledgeInfluence:n,monetaryExpansion:t,treasuryCut:r,coinsPerUtxoUnit:o,costModels:Oe.fromFoldable(Ae.ordLanguage)(ke.foldableArray)([new en.Tuple(Ae.PlutusV1.value,ye.convertPlutusV1CostModel(e.cost_models.PlutusV1)),new en.Tuple(Ae.PlutusV2.value,ye.convertPlutusV2CostModel(e.cost_models.PlutusV2))]),prices:c,maxTxExUnits:{mem:ze.unwrap()(e.max_tx_ex_mem),steps:ze.unwrap()(e.max_tx_ex_steps)},maxBlockExUnits:{mem:ze.unwrap()(e.max_block_ex_mem),steps:ze.unwrap()(e.max_block_ex_steps)},maxValueSize:ze.unwrap()(e.max_val_size),collateralPercent:e.collateral_percent,maxCollateralInputs:e.max_collateral_inputs})}))}))}))}))}))}))}))},Dt=Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(yn.value))((I=Le.map(Pe.functorEither)(et),T=lt(Tt),function(e){return I(T(e))}));D.evaluateTx=function(e){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(rn.liftEffect(O.monadEffectLoggerT(K.monadEffectReader(nn.monadEffectAff)))(te.convertTransaction(e)))((function(e){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(Le.map(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(lt(Qn))((n=ae.toBytes()(e),mt(mn.value)("application/cbor")(new We.Just(x.string(fe.cborBytesToHex(n)))))))((function(e){var n=Le.map(Pe.functorEither)(rt)(e);if(n instanceof Pe.Left)return U.throwError(O.monadThrowLoggerT(K.monadThrowReaderT(nn.monadThrowAff)))(on.error(Ge.show(ie.showClientError)(n.value0)));if(n instanceof Pe.Right&&n.value0 instanceof Pe.Left)return U.throwError(O.monadThrowLoggerT(K.monadThrowReaderT(nn.monadThrowAff)))(on.error("Server responded with `fault`: "+F.stringifyAeson(n.value0.value0)));if(n instanceof Pe.Right&&n.value0 instanceof Pe.Right)return N.pure(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(n.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 632, column 3 - line 638, column 36): "+[n.constructor.name])}));var n}))},D.getChainTip=gt,D.getCurrentEpoch=yt,D.getDatumByHash=function(e){return Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new dn(e)))((function(e){return st(Le.map(Pe.functorEither)(ot)(lt(Zn)(e)))}))},D.getEraSummaries=wt,D.getProtocolParameters=Dt,D.getScriptByHash=bt,D.getSystemStart=At,D.getTxMetadata=function(e){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(pt(new Sn(e)))((function(e){return N.pure(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(function(){var n=Le.map(Pe.functorEither)(tt)(lt(jn)(e));if(n instanceof Pe.Left&&n.value0 instanceof ie.ClientHttpResponseError&&404===n.value0.value0)return new Pe.Left(X.GetTxMetadataTxNotFoundError.value);if(n instanceof Pe.Left)return new Pe.Left(new X.GetTxMetadataClientError(n.value0));if(n instanceof Pe.Right){if(Oe.isEmpty(ze.unwrap()(n.value0)))return new Pe.Left(X.GetTxMetadataMetadataEmptyOrMissingError.value);if(Me.otherwise)return new Pe.Right(n.value0)}throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 671, column 8 - line 679, column 36): "+[n.constructor.name])}())}))},D.getUtxoByOref=function(e){return H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new Tn(e.transactionId)))((n=ft(Pn),t=lt(F.decodeAesonMaybe(On)),function(e){return n(t(e))})))((function(n){return $e.traverse($e.traversableMaybe)(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))((function(e){return H.ExceptT(Ct(e))}))(Le.map(We.functorMaybe)(en.snd)(De.find((t=Be.eq(Se.eqTransactionInput)(e),function(e){return t(en.fst(e))}))(ze.unwrap()(n))));var t})));var n,t},D.doesTxExist=function(e){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(pt(new An(e)))((function(e){return N.pure(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(function(){var n=lt(F.decodeAesonAeson)(e);if(n instanceof Pe.Right)return new Pe.Right(!0);if(n instanceof Pe.Left&&n.value0 instanceof ie.ClientHttpResponseError&&404===n.value0.value0)return new Pe.Right(!1);if(n instanceof Pe.Left)return new Pe.Left(n.value0);throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 657, column 8 - line 660, column 21): "+[n.constructor.name])}())}))},D.runBlockfrostServiceM=function(e){return function(n){var t,r,o=Ne.flip(K.runReaderT)((t=We.Nothing.value,function(e){return function(n){return{blockfrostConfig:n.blockfrostConfig,blockfrostApiKey:n.blockfrostApiKey,onBlockfrostRawGetResponse:t,onBlockfrostRawPostResponse:e}}})(We.Nothing.value)(n)),a=Ne.flip(O.runLoggerT)((r=tn.liftAff(tn.monadAffReader(tn.monadAffAff)),function(n){return r(e(n))}));return function(e){return o(a(e))}}},D.submitTx=function(e){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(rn.liftEffect(O.monadEffectLoggerT(K.monadEffectReader(nn.monadEffectAff)))(te.convertTransaction(e)))((function(e){return Le.map(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(lt(Se.decodeAesonTransactionHas))((n=ae.toBytes()(e),mt(Cn.value)("application/cbor")(new We.Just(x.arrayView(ze.unwrap()(ze.unwrap()(n)))))));var n}))},D.utxosAt=function(e){var n=function(t){return H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new In(e,t,100)))((r=ft(Bn),o=lt(F.decodeAesonMaybe(qn)),function(e){return r(o(e))})))((function(e){var r=De.length(ze.unwrap()(e))<100;if(r)return N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(e);if(!r)return Le.map(H.functorExceptT(O.functorLoggerT(K.functorReaderT(nn.functorAff))))(je.append(Rn)(e))(n(t+1|0));throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 544, column 5 - line 546, column 74): "+[r.constructor.name])})));var r,o};return H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(n(1))((function(e){return H.ExceptT((n=e,function(e){var t,r=(t=Ne.flip(O.runLoggerT)(e),function(e){return H.ExceptT(t(Ct(e)))});return H.runExceptT(Le.map(H.functorExceptT(K.functorReaderT(nn.functorAff)))(Oe.fromFoldable(Se.ordTransactionInput)(ke.foldableArray))(z.parTraverse(J.monadParExceptT(J.monadParReaderT(nn.parallelAff)))($e.traversableArray)($e.traverse($e.traversableTuple)(H.applicativeExceptT(K.monadReaderT(nn.monadAff)))(r))(n)))}));var n})))},D.getPoolIds=ht,D.getPubKeyHashDelegationsAndRewards=function(e){return function(n){return H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new En(new an(e,new Pe.Left(n)))))((t=lt(F.decodeAesonMaybe(zn)),function(e){return st(t(e))})))((function(e){return N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(We.functorMaybe)(e)((function(e){return{rewards:e.withdrawable_amount,delegate:e.pool_id}})))})));var t}},D.getValidatorHashDelegationsAndRewards=function(e){return function(n){return H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new En(new an(e,new Pe.Right(n)))))((t=lt(F.decodeAesonMaybe(zn)),function(e){return st(t(e))})))((function(e){return N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(We.functorMaybe)(e)((function(e){return{rewards:e.withdrawable_amount,delegate:e.pool_id}})))})));var t}}}(c),function(e){"use strict";e["Ctl.Internal.Types.UsedTxOuts"]=e["Ctl.Internal.Types.UsedTxOuts"]||{};var n=e["Ctl.Internal.Types.UsedTxOuts"],t=e["Control.Alternative"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Control.Monad.Reader.Class"],u=e["Ctl.Internal.Types.Transaction"],i=e["Data.Functor"],c=e["Data.Map.Internal"],l=e["Data.Maybe"],s=e["Data.Newtype"],f=e["Data.Set"],d=e["Data.UInt"],v=e["Effect.Class"],m=e["Effect.Ref"],p=function(e){return e};n.isTxOutRefUsed=function(e){return function(n){return function(i){return o.bind(e.Monad0().Bind1())(o.bindFlipped(e.Monad0().Bind1())((p=v.liftEffect(n),g=s.unwrap(),function(e){return p(m.read(g(e)))}))(a.ask(e)))((function(n){return r.pure(e.Monad0().Applicative0())(function(e){return function(n){return l.isJust(o.bind(l.bindMaybe)(c.lookup(u.ordTransactionHash)(n.transactionId)(e))((function(e){return t.guard(l.alternativeMaybe)(f.member(d.uintOrd)(n.index)(e))})))}}(n)(i))}));var p,g}}},n.newUsedTxOuts=function(e){return i.map(e.Monad0().Bind1().Apply0().Functor0())(p)(v.liftEffect(e)(m.new(c.empty)))}}(c),function(e){const n=new Error("`window` is not an object. Are you trying to run a Contract with connected light wallet in NodeJS environment?");e._enableWallet=e=>()=>{if(t(e)())return window.cardano[e].enable().catch((e=>{throw new Error("enableWallet failed: "+("string"==typeof e.info?e.info:e.toString()))}));throw new Error("Wallet is not available. Use `isWalletAvailable "+(e=>({nami:"NamiWallet",gerowallet:"GeroWallet",flint:"FlintWallet",LodeWallet:"LodeWallet",eternl:"EternlWallet"}[e]||"is?WalletAvailable"))(e)+"` before connecting.")};const t=e=>()=>((()=>{if("object"!=typeof window)throw n})(),void 0!==window.cardano&&void 0!==window.cardano[e]&&"function"==typeof window.cardano[e].enable);e._isWalletAvailable=t,e._name=e=>()=>{if(t(e)())return window.cardano[e].name;throw new Error("Wallet `"+e+"` is not available")}}(c["Ctl.Internal.Wallet"]=c["Ctl.Internal.Wallet"]||{}),function(e){e._getNetworkId=e=>()=>e.getNetworkId(),e._getUtxos=e=>n=>()=>n.getUtxos().then((n=>null===n?e.nothing:e.just(n))),e._getCollateral=e=>n=>()=>n.experimental.getCollateral().then((n=>null!==n&&n.length?e.just(n):e.nothing)),e._getBalance=e=>()=>e.getBalance(),e._getAddresses=e=>e.getUsedAddresses,e._getUnusedAddresses=e=>()=>e.getUnusedAddresses(),e._getChangeAddress=e=>()=>e.getChangeAddress(),e._getRewardAddresses=e=>()=>e.getRewardAddresses(),e._signTx=e=>n=>()=>n.signTx(e,!0).catch((e=>{throw JSON.stringify(e)})),e._signData=e=>n=>t=>()=>t.signData(e,n).catch((e=>{throw JSON.stringify(e)}))}(c["Ctl.Internal.Wallet.Cip30"]=c["Ctl.Internal.Wallet.Cip30"]||{}),function(e){e.thenImpl=function(e){return function(n){return function(t){return function(){e.then(t,n)}}}}}(c["Control.Promise"]=c["Control.Promise"]||{}),function(e){"use strict";e["Control.Promise"]=e["Control.Promise"]||{};var n,t=e["Control.Promise"],r=e["Control.Promise"],o=e["Control.Alt"],a=e["Control.Bind"],u=e["Control.Category"],i=e["Control.Monad.Except"],c=e["Control.Monad.Except.Trans"],l=e["Data.Either"],s=e["Data.Functor"],f=e["Data.Identity"],d=e["Data.List.Types"],v=e["Data.Monoid"],m=e.Effect,p=e["Effect.Aff"],g=e["Effect.Class"],y=e["Effect.Exception"],w=e.Foreign,h=(n=function(e){return l.either((function(e){return y.error("Promise failed, couldn't extract JS Error or String")}))(u.identity(u.categoryFn))(i.runExcept(o.alt(c.altExceptT(d.semigroupNonEmptyList)(f.monadIdentity))(w.unsafeReadTagged(f.monadIdentity)("Error")(e))(s.map(c.functorExceptT(f.functorIdentity))(y.error)(w.readString(f.monadIdentity)(e)))))},function(e){return p.makeAff((function(t){return s.voidRight(m.functorEffect)(v.mempty(p.monoidCanceler))(r.thenImpl(e)((function(e){return t(l.Left.create(n(e)))()}))((function(e){return t(l.Right.create(e))()})))}))});t.toAffE=function(e){return a.bind(p.bindAff)(g.liftEffect(p.monadEffectAff)(e))(h)}}(c),function(e){let n;n=t(1164),n=t(6359)(n);const r=e=>n=>n[e](),o=e=>n=>t=>{const r=t[e]();return null!=r?n.just(r):n.nothing},a=e=>n=>{const t=(e=>{const n=[];for(let t=0;tn=>t=>{if(t.is_native_script())return e(t.native_script());if(t.is_plutus_script())return n(t.plutus_script());throw"Impossible happened: withScriptRef: not a script"},e.getAmount=r("amount"),e.getCoin=r("coin"),e.getMultiAsset=o("multiasset"),e.extractMultiAsset=a,e.extractAssets=a,e.getDataHash=o("data_hash")}(c["Ctl.Internal.Deserialization.UnspentOutput"]=c["Ctl.Internal.Deserialization.UnspentOutput"]||{}),function(e){const n=e=>n=>n[e](),t=e=>n=>t=>{const r=t[e]();return null!=r?n.just(r):n.nothing},r=e=>{const n=[];for(let t=0;tt=>{if(t.kind()==n.LanguageKind.PlutusV1)return e.plutusV1;if(t.kind()==n.LanguageKind.PlutusV2)return e.plutusV2;throw"_convertLanguage: Unsupported language kind: "+t.kind()}}(c["Ctl.Internal.Deserialization.Language"]=c["Ctl.Internal.Deserialization.Language"]||{}),function(e){"use strict";e["Ctl.Internal.Deserialization.Language"]=e["Ctl.Internal.Deserialization.Language"]||{};var n=e["Ctl.Internal.Deserialization.Language"],t=e["Ctl.Internal.Deserialization.Language"],r=e["Ctl.Internal.Types.Scripts"],o=t._convertLanguage({plutusV1:r.PlutusV1.value,plutusV2:r.PlutusV2.value});n.convertLanguage=o}(c),function(e){"use strict";e["Ctl.Internal.Deserialization.WitnessSet"]=e["Ctl.Internal.Deserialization.WitnessSet"]||{};var n,t,r,o,a=e["Ctl.Internal.Deserialization.WitnessSet"],u=e["Ctl.Internal.Deserialization.WitnessSet"],i=e["Control.Applicative"],c=e["Control.Bind"],l=e["Ctl.Internal.Cardano.Types.Transaction"],s=e["Ctl.Internal.Deserialization.Language"],f=e["Ctl.Internal.Deserialization.NativeScript"],d=e["Ctl.Internal.Deserialization.PlutusData"],v=e["Ctl.Internal.FfiHelpers"],m=e["Ctl.Internal.Types.BigNum"],p=e["Ctl.Internal.Types.RedeemerTag"],g=e["Ctl.Internal.Types.Scripts"],y=e["Data.Functor"],w=e["Data.Maybe"],h=e["Data.Traversable"],b=e["Data.Tuple"],C=function(e){return l.Vkey(l.mkFromCslPubKey(u.vkeyPublicKey(e)))},A=function(e){var n=u.getVkey(e),t=l.mkFromCslEd25519Signature(u.getSignature(e)),r=C(n);return new b.Tuple(r,t)},S=(n=y.map(y.functorArray)(A),function(e){return n(u.extractWitnesses(e))}),I=function(e){var n=s.convertLanguage(u.plutusScriptVersion(e));return b.curry(g.PlutusScript)(u.plutusScriptBytes(e))(n)},T=function(e){return y.mapFlipped(y.functorArray)(u.extractPlutusScripts(e))(I)},D=(t=y.map(y.functorArray)(d.convertPlutusData),function(e){return t(u.extractPlutusData(e))}),F=function(e){return y.mapFlipped(y.functorArray)(u.extractNativeScripts(e))(f.convertNativeScript)},E=(r=h.traverse(h.traversableArray)(w.applicativeMaybe)((function(e){return c.bind(w.bindMaybe)((n=u.getRedeemerTag(e),0===(t=u.getRedeemerTagKind(n))?new w.Just(p.Spend.value):1===t?new w.Just(p.Mint.value):2===t?new w.Just(p.Cert.value):3===t?new w.Just(p.Reward.value):w.Nothing.value))((function(n){var t,r,o=m.toBigInt(u.getRedeemerIndex(e)),a=(t=u.getExUnits(e),r=m.toBigInt(u.getExUnitsSteps(t)),{mem:m.toBigInt(u.getExUnitsMem(t)),steps:r}),c=d.convertPlutusData(u.getRedeemerPlutusData(e));return i.pure(w.applicativeMaybe)({tag:n,index:o,data:c,exUnits:a})}));var n,t})),function(e){return r(u.extractRedeemers(e))}),x=(o=y.map(y.functorArray)((function(e){return{vkey:C(u.getBootstrapVkey(e)),signature:l.mkFromCslEd25519Signature(u.getBootstrapSignature(e)),chainCode:u.getBootstrapChainCode(e),attributes:u.getBootstrapAttributes(e)}})),function(e){return o(u.extractBootstraps(e))});a.convertPlutusScript=I,a.convertVkeyWitness=A,a.convertWitnessSet=function(e){var n=y.mapFlipped(w.functorMaybe)(u.getPlutusScripts(v.maybeFfiHelper)(e))(T),t=y.mapFlipped(w.functorMaybe)(u.getWitnessSetPlutusData(v.maybeFfiHelper)(e))(D),r=y.mapFlipped(w.functorMaybe)(u.getNativeScripts(v.maybeFfiHelper)(e))(F);return c.bind(w.bindMaybe)(h.for(w.applicativeMaybe)(h.traversableMaybe)(u.getRedeemers(v.maybeFfiHelper)(e))(E))((function(o){return i.pure(w.applicativeMaybe)({vkeys:y.mapFlipped(w.functorMaybe)(u.getVkeywitnesses(v.maybeFfiHelper)(e))(S),nativeScripts:r,bootstraps:y.mapFlipped(w.functorMaybe)(u.getBootstraps(v.maybeFfiHelper)(e))(x),plutusScripts:n,plutusData:t,redeemers:o})}))}}(c),function(e){"use strict";e["Ctl.Internal.Deserialization.UnspentOutput"]=e["Ctl.Internal.Deserialization.UnspentOutput"]||{};var n=e["Ctl.Internal.Deserialization.UnspentOutput"],t=e["Ctl.Internal.Deserialization.UnspentOutput"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Cardano.Types.ScriptRef"],u=e["Ctl.Internal.Cardano.Types.Value"],i=e["Ctl.Internal.Deserialization.NativeScript"],c=e["Ctl.Internal.Deserialization.PlutusData"],l=e["Ctl.Internal.Deserialization.WitnessSet"],s=e["Ctl.Internal.FfiHelpers"],f=e["Ctl.Internal.Serialization.Hash"],d=e["Ctl.Internal.Serialization.ToBytes"],v=e["Ctl.Internal.Types.BigNum"],m=e["Ctl.Internal.Types.OutputDatum"],p=e["Ctl.Internal.Types.TokenName"],g=e["Ctl.Internal.Types.Transaction"],y=e["Data.Bitraversable"],w=e["Data.Foldable"],h=e["Data.Functor"],b=e["Data.Map.Internal"],C=e["Data.Maybe"],A=e["Data.Newtype"],S=e["Data.Traversable"],I=e["Data.Tuple"],T=function(e){var n=v.toBigInt(t.getCoin(e));return o.bind(C.bindMaybe)(S.for(C.applicativeMaybe)(S.traversableMaybe)(t.getMultiAsset(s.maybeFfiHelper)(e))((function(e){var n,a,i,c,l,s=h.map(h.functorArray)(h.map(I.functorTuple)(t.extractAssets(I.Tuple.create)))(t.extractMultiAsset(I.Tuple.create)(e));return o.bind(C.bindMaybe)((c=h.map(C.functorMaybe)(b.fromFoldable(u.ordCurrencySymbol)(w.foldableArray)),l=(a=h.map(C.functorMaybe),i=h.map(h.functorArray),function(e){return a(i(e))})(h.map(I.functorTuple)(b.fromFoldable(p.ordTokenName)(w.foldableArray))),function(e){return c(l(e))})(S.traverse(S.traversableArray)(C.applicativeMaybe)(y.bitraverse(y.bitraversableTuple)(C.applicativeMaybe)((n=A.unwrap(),function(e){return u.mkCurrencySymbol(n(f.scriptHashToBytes(e)))}))(S.traverse(S.traversableArray)(C.applicativeMaybe)(y.ltraverse(y.bitraversableTuple)(C.applicativeMaybe)((function(e){return p.mkTokenName(p.assetNameName(e))})))))(s)))((function(e){return r.pure(C.applicativeMaybe)(h.map(b.functorMap)(h.map(b.functorMap)(v.toBigInt))(e))}))})))((function(e){return r.pure(C.applicativeMaybe)(u.mkValue(n)(u.mkNonAdaAsset(C.fromMaybe(b.empty)(e))))}))},D=t.withScriptRef((function(e){return a.NativeScriptRef.create(i.convertNativeScript(e))}))((function(e){return a.PlutusScriptRef.create(l.convertPlutusScript(e))}));n.convertUnspentOutput=function(e){var n,a=function(e){var n=t.getTransactionIndex(e);return{transactionId:A.unwrap()(d.toBytes()(t.getTransactionHash(e))),index:n}}(t.getInput(e));return o.bind(C.bindMaybe)((n=t.getOutput(e),o.bind(C.bindMaybe)(T(t.getAmount(n)))((function(e){var a,u,i=t.getPlutusData(s.maybeFfiHelper)(n),l=h.mapFlipped(C.functorMaybe)(t.getDataHash(s.maybeFfiHelper)(n))((a=A.unwrap(),u=d.toBytes(),function(e){return g.DataHash(a(u(e)))})),f=t.getAddress(n);return o.bind(C.bindMaybe)(function(){if(i instanceof C.Just&&l instanceof C.Just)return C.Nothing.value;if(i instanceof C.Just&&l instanceof C.Nothing)return r.pure(C.applicativeMaybe)(new m.OutputDatum(A.wrap()(c.convertPlutusData(i.value0))));if(i instanceof C.Nothing&&l instanceof C.Just)return r.pure(C.applicativeMaybe)(new m.OutputDatumHash(l.value0));if(i instanceof C.Nothing&&l instanceof C.Nothing)return r.pure(C.applicativeMaybe)(m.NoOutputDatum.value);throw new Error("Failed pattern match at Ctl.Internal.Deserialization.UnspentOutput (line 98, column 12 - line 103, column 43): "+[i.constructor.name,l.constructor.name])}())((function(o){var a=h.mapFlipped(C.functorMaybe)(t.getScriptRef(s.maybeFfiHelper)(n))(D);return r.pure(C.applicativeMaybe)({address:f,amount:e,datum:o,scriptRef:a})}))}))))((function(e){return r.pure(C.applicativeMaybe)({input:a,output:e})}))},n.convertValue=T}(c),function(e){"use strict";e["Ctl.Internal.Wallet.Cip30"]=e["Ctl.Internal.Wallet.Cip30"]||{};var n,t,r,o,a,u=e["Ctl.Internal.Wallet.Cip30"],i=e["Ctl.Internal.Wallet.Cip30"],c=e["Control.Alt"],l=e["Control.Applicative"],s=e["Control.Bind"],f=e["Control.Monad"],d=e["Control.Monad.Error.Class"],v=e["Control.Promise"],m=e["Ctl.Internal.Cardano.Types.Transaction"],p=e["Ctl.Internal.Deserialization.FromBytes"],g=e["Ctl.Internal.Deserialization.UnspentOutput"],y=e["Ctl.Internal.Deserialization.WitnessSet"],w=e["Ctl.Internal.FfiHelpers"],h=e["Ctl.Internal.Serialization"],b=e["Ctl.Internal.Serialization.Address"],C=e["Ctl.Internal.Serialization.ToBytes"],A=e["Ctl.Internal.Types.ByteArray"],S=e["Ctl.Internal.Types.CborBytes"],I=e["Ctl.Internal.Types.RawBytes"],T=e["Data.Functor"],D=e["Data.Maybe"],F=e["Data.Newtype"],E=e["Data.Semigroup"],x=e["Data.Traversable"],M=e.Effect,R=e["Effect.Aff"],P=e["Effect.Class"],B=e["Effect.Exception"],k=(r=P.liftEffect(R.monadEffectAff),o=T.map(M.functorEffect)((n=F.unwrap(),t=C.toBytes(),function(e){return A.byteArrayToHex(n(t(e)))})),function(e){return r(o(h.convertTransaction(e)))}),N=function(e){return function(n){return function(t){var r=T.map(D.functorMaybe)(b.rewardAddressBytes)(b.rewardAddressFromAddress(n)),o=T.map(D.functorMaybe)(b.pointerAddressBytes)(b.pointerAddressFromAddress(n)),a=T.map(D.functorMaybe)(b.enterpriseAddressBytes)(b.enterpriseAddressFromAddress(n)),u=T.map(D.functorMaybe)(b.baseAddressBytes)(b.baseAddressFromAddress(n));return s.bind(R.bindAff)(d.liftMaybe(R.monadThrowAff)(B.error("Can't convert Address to base, enterprise, pointer or reward"))(c.alt(D.altMaybe)(c.alt(D.altMaybe)(c.alt(D.altMaybe)(u)(a))(o))(r)))((function(n){return s.bind(R.bindAff)(v.toAffE(i._signData(S.cborBytesToHex(n))(I.rawBytesToHex(t))(e)))((function(e){return l.pure(R.applicativeAff)(s.bind(D.bindMaybe)(S.hexToCborBytes(e.key))((function(n){return s.bind(D.bindMaybe)(S.hexToCborBytes(e.signature))((function(e){return l.pure(D.applicativeMaybe)({key:n,signature:e})}))})))}))}))}}},L=s.composeKleisliFlipped(D.bindMaybe)((a=p.fromBytes(p.fromBytesAddress),function(e){return a(S.rawBytesAsCborBytes(e))}))(I.hexToRawBytes),_=function(e){return T.mapFlipped(R.functorAff)(v.toAffE(i._getAddresses(e)))(x.traverse(x.traversableArray)(D.applicativeMaybe)(L))},U=function(e){return s.bind(R.bindAff)(v.toAffE(i._getUtxos(w.maybeFfiHelper)(e)))((function(e){return P.liftEffect(R.monadEffectAff)(x.for(M.applicativeEffect)(x.traversableMaybe)(e)(x.traverse(x.traversableArray)(M.applicativeEffect)((function(e){return d.liftMaybe(d.monadThrowEffect)(B.error("Unable to convert UTxO"))(s.bind(D.bindMaybe)(s.bind(D.bindMaybe)(S.hexToCborBytes(e))(p.fromBytes(p.fromBytesTransactionUnspe)))(g.convertUnspentOutput))}))))}))},H=function(e){return T.mapFlipped(R.functorAff)(v.toAffE(i._getUnusedAddresses(e)))(x.traverse(x.traversableArray)(D.applicativeMaybe)(L))},q=function(e){return T.mapFlipped(R.functorAff)(v.toAffE(i._getRewardAddresses(e)))(x.traverse(x.traversableArray)(D.applicativeMaybe)(L))},O=function(e){return v.toAffE(i._getNetworkId(e))},W=function(e){return s.bind(R.bindAff)(v.toAffE(function(e){return d.catchError(d.monadErrorEffect)(i._getCollateral(w.maybeFfiHelper)(e))((function(e){return d.throwError(d.monadThrowEffect)(B.error("Wallet doesn't implement `getCollateral`."))}))}(e)))((function(e){var n=s.join(D.bindMaybe)(T.map(D.functorMaybe)(x.traverse(x.traversableArray)(D.applicativeMaybe)(I.hexToRawBytes))(e));return P.liftEffect(R.monadEffectAff)(x.for(M.applicativeEffect)(x.traversableMaybe)(n)((function(e){return x.for(M.applicativeEffect)(x.traversableArray)(e)((function(e){return s.bindFlipped(M.bindEffect)(D.maybe(B.throw("Unable to convert UTxO"))(l.pure(M.applicativeEffect)))(T.map(M.functorEffect)(g.convertUnspentOutput)(p.fromBytesEffect(p.fromBytesTransactionUnspe)(S.rawBytesAsCborBytes(e))))}))})))}))},V=function(e){return T.mapFlipped(R.functorAff)(v.toAffE(i._getChangeAddress(e)))(L)},K=function(e){var n=T.map(R.functorAff)(I.hexToRawBytes);return function(t){return n(v.toAffE(e(t)))}},z=function(e){return T.mapFlipped(R.functorAff)(K(i._getBalance)(e))((function(e){return s.bind(D.bindMaybe)(e)((function(e){return s.bind(D.bindMaybe)(p.fromBytes(p.fromBytesValue)(S.rawBytesAsCborBytes(e)))(g.convertValue)}))}))},J=function(e){return function(n){return s.bind(R.bindAff)(k(n))((function(t){return s.bind(R.bindAff)(K(i._signTx(t))(e))((function(e){if(e instanceof D.Nothing)return l.pure(R.applicativeAff)(D.Nothing.value);if(e instanceof D.Just)return T.map(R.functorAff)(T.map(D.functorMaybe)(function(e){return function(n){return{body:e.body,witnessSet:E.append(m.semigroupTransactionWitne)(e.witnessSet)(n),isValid:e.isValid,auxiliaryData:e.auxiliaryData}}}(n)))(P.liftEffect(R.monadEffectAff)(T.map(M.functorEffect)(y.convertWitnessSet)(p.fromBytesEffect(p.fromBytesTransactionWitne)(S.rawBytesAsCborBytes(e.value0)))));throw new Error("Failed pattern match at Ctl.Internal.Wallet.Cip30 (line 175, column 42 - line 180, column 8): "+[e.constructor.name])}))}))}};u.mkCip30WalletAff=function(e){return function(n){return s.bind(R.bindAff)(v.toAffE(n))((function(n){return s.discard(s.discardUnit)(R.bindAff)(f.whenM(R.monadAff)(T.map(R.functorAff)(D.isNothing)(W(n)))(P.liftEffect(R.monadEffectAff)(B.throw(e+" wallet missing collateral"))))((function(){return l.pure(R.applicativeAff)({connection:n,getNetworkId:O,getUtxos:U,getCollateral:W,getBalance:z,getWalletAddresses:_,getUnusedAddresses:H,getChangeAddress:V,getRewardAddresses:q,signTx:J,signData:N})}))}))}}}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.FakeOutput"]=e["Ctl.Internal.BalanceTx.FakeOutput"]||{};var n,t=e["Ctl.Internal.BalanceTx.FakeOutput"],r=e["Ctl.Internal.Cardano.Types.Value"],o=e["Ctl.Internal.Serialization.Address"],a=e["Ctl.Internal.Types.OutputDatum"],u=e["Data.Maybe"],i=e["Data.Monoid"],c=(n=r.mkValue(i.mempty(r.monoidCoin)),function(e){return t=n(e),{address:u.fromJust()(o.addressFromBech32("addr_test1qpu5vlrf4xkxv2qpwngf6cjhtw542ayty80v8dyr49rf5ewvxwdrt70qlcpeeagscasafhffqsxy36t90ldv06wqrk2qum8x5w")),amount:t,datum:a.NoOutputDatum.value,scriptRef:u.Nothing.value};var t});t.fakeOutputWithNonAdaAssets=c}(c),function(e){let n;n=t(1164),n=t(6359)(n),e.minAdaForOutput=e=>t=>r=>{try{return e.just(n.min_ada_for_output(t,r))}catch(n){return e.nothing}},e.newCoinsPerWord=e=>n.DataCost.new_coins_per_word(e),e.newCoinsPerByte=e=>n.DataCost.new_coins_per_byte(e)}(c["Ctl.Internal.BalanceTx.UtxoMinAda"]=c["Ctl.Internal.BalanceTx.UtxoMinAda"]||{}),function(e){"use strict";e["Ctl.Internal.BalanceTx.UtxoMinAda"]=e["Ctl.Internal.BalanceTx.UtxoMinAda"]||{};var n=e["Ctl.Internal.BalanceTx.UtxoMinAda"],t=e["Ctl.Internal.BalanceTx.UtxoMinAda"],r=e["Control.Monad.Error.Class"],o=e["Ctl.Internal.FfiHelpers"],a=e["Ctl.Internal.Serialization"],u=e["Ctl.Internal.Types.BigNum"],i=e["Ctl.Internal.Types.ProtocolParameters"],c=e["Data.Functor"],l=e["Data.Maybe"],s=e.Effect,f=e["Effect.Exception"];n.utxoMinAdaValue=function(e){return function(n){return function(){var d=a.convertTxOutput(n)(),v=function(){if(e instanceof i.CoinsPerUtxoByte)return c.map(s.functorEffect)(t.newCoinsPerByte)(r.liftMaybe(r.monadThrowEffect)(f.error("Failed to convert CoinsPerUtxoByte"))(u.fromBigInt(e.value0)))();if(e instanceof i.CoinsPerUtxoWord)return c.map(s.functorEffect)(t.newCoinsPerWord)(r.liftMaybe(r.monadThrowEffect)(f.error("Failed to convert CoinsPerUtxoWord"))(u.fromBigInt(e.value0)))();throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.UtxoMinAda (line 42, column 15 - line 48, column 30): "+[e.constructor.name])}();return c.mapFlipped(l.functorMaybe)(t.minAdaForOutput(o.maybeFfiHelper)(d)(v))(u.toBigInt)}}}}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.Collateral.Select"]=e["Ctl.Internal.BalanceTx.Collateral.Select"]||{};var n,t,r,o,a,u,i,c=e["Ctl.Internal.BalanceTx.Collateral.Select"],l=e["Ctl.Internal.BalanceTx.FakeOutput"],s=e["Ctl.Internal.BalanceTx.UtxoMinAda"],f=e["Ctl.Internal.Cardano.Types.Value"],d=e["Data.BigInt"],v=e["Data.Eq"],m=e["Data.Foldable"],p=e["Data.Function"],g=e["Data.Functor"],y=e["Data.List"],w=e["Data.List.Types"],h=e["Data.Map.Internal"],b=e["Data.Maybe"],C=e["Data.Newtype"],A=e["Data.Ord"],S=e["Data.Ordering"],I=e["Data.Semigroup"],T=e["Data.Semiring"],D=e["Data.Traversable"],F=e["Data.Tuple"],E=e.Effect,x={eq:p.on(v.eq(d.eqBigInt))((n=C.unwrap(),function(e){return F.snd(n(e))}))},M=function(e){if(e instanceof w.Nil)return new w.Cons(w.Nil.value,w.Nil.value);if(e instanceof w.Cons){var n=M(e.value1);return I.append(w.semigroupList)(g.map(w.functorList)(w.Cons.create(e.value0))(n))(n)}throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Collateral.Select (line 172, column 1 - line 172, column 60): "+[e.constructor.name])},R=(t=C.unwrap(),r=C.unwrap(),function(e){return f.getNonAdaAsset(t(r(e).output).amount)}),P=function(e){return g.map(b.functorMaybe)((n=F.Tuple.create(e.value0),function(e){return n(e)}))(e.value1);var n},B=d.fromInt(5e6),k=(o=C.unwrap(),a=C.unwrap(),function(e){return f["valueToCoin'"](o(a(e).output).amount)}),N=function(e){var n=T.add(d.semiringBigInt)(e);return function(e){return n(k(e))}},L={compare:function(e){return function(n){var t,r,o,a,u=function(e){return function(n){return e instanceof S.EQ?n:e}},i=(t=C.unwrap(),function(e){return F.snd(t(e))}),c=(r=C.unwrap(),function(e){return y.length(F.fst(r(e)))}),l=(o=m.foldl(w.foldableList)(N)(T.zero(d.semiringBigInt)),a=C.unwrap(),function(e){return o(F.fst(a(e)))});return u(p.on(A.compare(d.ordBigInt))(i)(e)(n))(u(p.on(A.compare(A.ordInt))(c)(e)(n))(p.on(A.compare(d.ordBigInt))(l)(e)(n)))}},Eq0:function(){return x}},_={eq:p.on(v.eq(d.eqBigInt))((u=C.unwrap(),function(e){return k(u(e))}))},U={compare:p.on(A.compare(d.ordBigInt))((i=C.unwrap(),function(e){return k(i(e))})),Eq0:function(){return _}};c.minRequiredCollateral=B,c.selectCollateral=function(e){return function(n){var t,r,o,a,u,i=g.map(E.functorEffect)((r=g.map(b.functorMaybe)((t=C.unwrap(),function(e){return F.fst(t(e))})),o=y.sort(L),function(e){return r(y.head(o(e)))})),c=g.map(E.functorEffect)(y.mapMaybe(P)),v=D.traverse(w.traversableList)(E.applicativeEffect)((function(n){return g.map(E.functorEffect)(F.Tuple.create(n))(function(e){var n=s.utxoMinAdaValue(e),t=m.foldMap(w.foldableList)(f.monoidNonAdaAsset)(R);return function(e){return n(l.fakeOutputWithNonAdaAssets(t(e)))}}(e)(n))})),p=y.filter((function(e){return A.greaterThanOrEq(d.ordBigInt)(m.foldl(w.foldableList)(N)(T.zero(d.semiringBigInt))(e))(B)})),I=(a=n,u=y.filter((function(e){return y.length(e)<=a&&!y.null(e)})),function(e){return u(M(e))}),x=y.take(10),k=g.map(w.functorList)(C.unwrap()),_=y.sortBy((function(e){var n=A.compare(U)(e);return function(e){return S.invert(n(e))}})),H=g.map(w.functorList)((function(e){return n=e,C.wrap()({input:n.value0,output:n.value1});var n})),q=h.toUnfoldable(w.unfoldableList);return function(e){return i(c(v(p(I(x(k(_(H(q(e))))))))))}}}}(c),function(e){let n;n=t(8200),e.newCoseSign1Builder=e=>t=>()=>n.COSESign1Builder.new(t,e,!1),e.makeDataToSign=e=>e.make_data_to_sign().to_bytes(),e.sign=e=>n=>e.sign(n).to_bytes(),e.buildSignature=e=>n=>e.build(n).to_bytes(),e.newHeaders=e=>t=>n.Headers.new(t,e),e.newProtectedHeaderMap=e=>n.ProtectedHeaderMap.new(e),e.newHeaderMap=()=>n.HeaderMap.new(),e.setAlgHeaderToEdDsa=e=>()=>{const t=n.Label.from_algorithm_id(n.AlgorithmId.EdDSA);e.set_algorithm_id(t)},e.setAddressHeader=e=>t=>()=>{const r=n.Label.new_text("address"),o=n.CBORValue.new_bytes(e);t.set_header(r,o)},e.newCoseKeyWithOkpType=()=>n.COSEKey.new(n.Label.from_key_type(n.KeyType.OKP)),e.setCoseKeyAlgHeaderToEdDsa=e=>()=>{e.set_algorithm_id(n.Label.from_algorithm_id(n.AlgorithmId.EdDSA))},e.setCoseKeyCrvHeaderToEd25519=e=>()=>{e.set_header(n.Label.new_int(n.Int.new_negative(n.BigNum.from_str("1"))),n.CBORValue.new_int(n.Int.new_i32(6)))},e.setCoseKeyXHeader=e=>t=>()=>{t.set_header(n.Label.new_int(n.Int.new_negative(n.BigNum.from_str("2"))),n.CBORValue.new_bytes(e))},e.bytesFromCoseKey=e=>e.to_bytes()}(c["Ctl.Internal.Wallet.Cip30.SignData"]=c["Ctl.Internal.Wallet.Cip30.SignData"]||{}),function(e){"use strict";e["Ctl.Internal.Wallet.Cip30.SignData"]=e["Ctl.Internal.Wallet.Cip30.SignData"]||{};var n=e["Ctl.Internal.Wallet.Cip30.SignData"],t=e["Ctl.Internal.Wallet.Cip30.SignData"],r=e["Control.Apply"],o=e["Control.Bind"],a=e["Ctl.Internal.Serialization.Keys"],u=e["Ctl.Internal.Serialization.ToBytes"],i=e["Ctl.Internal.Types.CborBytes"],c=e["Data.Functor"],l=e.Effect;n.signData=function(e){return function(n){return function(s){var f,d,v,m,p,g=(f=r.apply(l.applyEffect)(c.map(l.functorEffect)(t.newHeaders)(t.newHeaderMap))((function(){var e=t.newHeaderMap();return t.setAlgHeaderToEdDsa(e)(),t.setAddressHeader(u.toBytes()(n))(e)(),t.newProtectedHeaderMap(e)})),v=o.bind(l.bindEffect)(f)(t.newCoseSign1Builder(s)),m=c.map(l.functorEffect)((d=t.sign(e),function(e){return d(t.makeDataToSign(e))}))(v),c.map(l.functorEffect)(i.CborBytes)(r.apply(l.applyEffect)(c.map(l.functorEffect)(t.buildSignature)(v))(m))),y=(p=a.bytesFromPublicKey(a.publicKeyFromPrivateKey(e)),function(){var e=t.newCoseKeyWithOkpType();return t.setCoseKeyAlgHeaderToEdDsa(e)(),t.setCoseKeyCrvHeaderToEd25519(e)(),t.setCoseKeyXHeader(p)(e)(),t.bytesFromCoseKey(e)});return r.apply(l.applyEffect)(c.map(l.functorEffect)((function(e){return function(n){return{key:e,signature:n}}}))(y))(g)}}}}(c),function(e){"use strict";e["Data.Lens.Setter"]=e["Data.Lens.Setter"]||{};var n=e["Data.Lens.Setter"],t=e["Control.Monad.State.Class"],r=e["Data.Function"],o=e["Data.Functor"],a=e["Data.Maybe"],u=e["Data.Semigroup"],i=function(e){return function(n){return e(r.const(n))}},c=function(e){return function(n){return function(r){return o.void(e.Monad0().Bind1().Apply0().Functor0())(t.modify(e)(n(r)))}}};n.over=function(e){return e},n.set=i,n.appendOver=function(e){return function(n){var t=n,o=r.flip(u.append(e));return function(e){return t(o(e))}}},n.setJust=function(e){var n=i(e);return function(e){return n(a.Just.create(e))}},n.assign=function(e){return function(n){return function(r){return o.void(e.Monad0().Bind1().Apply0().Functor0())(t.modify(e)(i(n)(r)))}}},n.modifying=c,n.appendModifying=function(e){return function(n){return function(t){var o=c(e)(t),a=r.flip(u.append(n));return function(e){return o(a(e))}}}}}(c),function(e){"use strict";e["Ctl.Internal.Wallet.Key"]=e["Ctl.Internal.Wallet.Key"]||{};var n=e["Ctl.Internal.Wallet.Key"],t=e["Control.Applicative"],r=e["Ctl.Internal.BalanceTx.Collateral.Select"],o=e["Ctl.Internal.Cardano.Types.Transaction"],a=e["Ctl.Internal.Deserialization.WitnessSet"],u=e["Ctl.Internal.Serialization"],i=e["Ctl.Internal.Serialization.Address"],c=e["Ctl.Internal.Serialization.Keys"],l=e["Ctl.Internal.Wallet.Cip30.SignData"],s=e["Data.Array"],f=e["Data.Foldable"],d=e["Data.Functor"],v=e["Data.Lens.Setter"],m=e["Data.List.Types"],p=e["Data.Maybe"],g=e["Data.Monoid"],y=e["Data.Newtype"],w=e["Data.Profunctor.Strong"],h=e["Data.Semigroup"],b=e["Data.Traversable"],C=e.Effect,A=e["Effect.Aff"],S=e["Effect.Class"];n.PrivatePaymentKey=function(e){return e},n.PrivateStakeKey=function(e){return e},n.privateKeysToKeyWallet=function(e){return function(n){var I=function(e){return function(n){return function(t){var r,o=c.publicKeyFromPrivateKey(y.unwrap()(e));if(n instanceof p.Just){var a=c.publicKeyFromPrivateKey(y.unwrap()(n.value0));return i.baseAddressToAddress(i.baseAddress({network:t,paymentCred:i.keyHashCredential(u.publicKeyHash(o)),delegationCred:i.keyHashCredential(u.publicKeyHash(a))}))}if(n instanceof p.Nothing)return r=u.publicKeyHash(o),i.enterpriseAddressToAddress(i.enterpriseAddress({network:t,paymentCred:i.keyHashCredential(r)}));throw new Error("Failed pattern match at Ctl.Internal.Wallet.Key (line 128, column 3 - line 144, column 37): "+[n.constructor.name])}}}(e)(n);return{address:I,selectCollateral:function(e){return function(n){return function(t){return d.map(C.functorEffect)(d.map(p.functorMaybe)(s.fromFoldable(m.foldableList)))(r.selectCollateral(e)(n)(t))}}},signTx:function(r){return S.liftEffect(A.monadEffectAff)((function(){var i=u.convertTxBody(r.body)(),c=u.hashTransaction(i)(),l=d.map(C.functorEffect)(a.convertVkeyWitness)(u.makeVkeywitness(c)(y.unwrap()(e)))(),s=b.for(C.applicativeEffect)(b.traversableMaybe)(n)((function(e){return d.map(C.functorEffect)(a.convertVkeyWitness)(u.makeVkeywitness(c)(y.unwrap()(e)))}))();return v.set(o._vkeys(w.strongFn))(t.pure(p.applicativeMaybe)(h.append(h.semigroupArray)([l])(f.fold(f.foldableMaybe)(g.monoidArray)(d.map(p.functorMaybe)(t.pure(t.applicativeArray))(s)))))(g.mempty(o.monoidTransactionWitnessS))}))},signData:function(n){return function(t){return S.liftEffect(A.monadEffectAff)(l.signData(y.unwrap()(e))(I(n))(t))}},paymentKey:e,stakeKey:n}}}}(c),function(e){"use strict";e["Ctl.Internal.Wallet"]=e["Ctl.Internal.Wallet"]||{};var n,t,r=e["Ctl.Internal.Wallet"],o=e["Ctl.Internal.Wallet"],a=e["Control.Applicative"],u=e["Control.Apply"],i=e["Control.Bind"],c=e["Control.Monad.Error.Class"],l=e["Ctl.Internal.Types.Natural"],s=e["Ctl.Internal.Wallet.Cip30"],f=e["Ctl.Internal.Wallet.Key"],d=e["Data.Eq"],v=e["Data.Functor"],m=e["Data.Int"],p=e["Data.Maybe"],g=e["Data.Newtype"],y=e["Data.Semiring"],w=e["Data.Show"],h=e["Data.Unit"],b=e["Effect.Aff"],C=e["Effect.Aff.Class"],A=e["Effect.Class"],S=e["Effect.Exception"],I=function(){function e(){}return e.value=new e,e}(),T=function(){function e(){}return e.value=new e,e}(),D=function(){function e(){}return e.value=new e,e}(),F=function(){function e(){}return e.value=new e,e}(),E=function(){function e(){}return e.value=new e,e}(),x=function(){function e(){}return e.value=new e,e}(),M=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),R=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),P=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),B=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),k=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),N=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),L=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),_=function(e){if(e instanceof I)return"nami";if(e instanceof T)return"gerowallet";if(e instanceof D)return"flint";if(e instanceof F)return"eternl";if(e instanceof E)return"LodeWallet";if(e instanceof x)return"nufi";throw new Error("Failed pattern match at Ctl.Internal.Wallet (line 230, column 25 - line 236, column 23): "+[e.constructor.name])},U=(A.liftEffect(b.monadEffectAff),function(e){return function(n){return n(e)(e.connection)}}),H=(t=function(e){return function(n){return function(r){return d.eq(l.eqNatural)(e)(y.zero(l.semiringNatural))?a.pure(b.applicativeAff)(h.unit):i.bind(b.bindAff)(r)((function(o){return o?a.pure(b.applicativeAff)(h.unit):u.applySecond(b.applyAff)(b.delay(g.wrap()(n)))(t(l.minus(e)(y.one(l.semiringNatural)))(n)(r))}))}}},i.discard(i.discardUnit)(b.bindAff)(t(l["fromInt'"](10))(m.toNumber(100))(A.liftEffect(b.monadEffectAff)((n=E.value,o._isWalletAvailable(_(n))))))((function(){return c.catchError(b.monadErrorAff)(v.map(b.functorAff)(k.create)(s.mkCip30WalletAff("Lode")(o._enableWallet("LodeWallet"))))((function(e){return c.throwError(b.monadThrowAff)(S.error(w.show(S.showError)(e)+" Note: LodeWallet is injected asynchronously and may be unreliable."))}))})));r.Gero=R,r.Nami=M,r.Flint=P,r.Lode=k,r.Eternl=B,r.NuFi=N,r.KeyWallet=L,r.NamiWallet=I,r.LodeWallet=E,r.GeroWallet=T,r.FlintWallet=D,r.EternlWallet=F,r.NuFiWallet=x,r.mkKeyWallet=function(e){return function(n){return new L(f.privateKeysToKeyWallet(e)(n))}},r.mkWalletAff=function(e){var n=_(e);if(e instanceof I)return v.map(b.functorAff)(M.create)(s.mkCip30WalletAff("Nami")(o._enableWallet(n)));if(e instanceof T)return v.map(b.functorAff)(R.create)(s.mkCip30WalletAff("Gero")(o._enableWallet(n)));if(e instanceof F)return v.map(b.functorAff)(B.create)(s.mkCip30WalletAff("Eternl")(o._enableWallet(n)));if(e instanceof D)return v.map(b.functorAff)(P.create)(s.mkCip30WalletAff("Flint")(o._enableWallet(n)));if(e instanceof E)return H;if(e instanceof x)return v.map(b.functorAff)(N.create)(s.mkCip30WalletAff("NuFi")(o._enableWallet(n)));throw new Error("Failed pattern match at Ctl.Internal.Wallet (line 106, column 3 - line 114, column 78): "+[e.constructor.name])},r.cip30Wallet=function(e){if(e instanceof M)return new p.Just(e.value0);if(e instanceof R)return new p.Just(e.value0);if(e instanceof P)return new p.Just(e.value0);if(e instanceof B)return new p.Just(e.value0);if(e instanceof k)return new p.Just(e.value0);if(e instanceof N)return new p.Just(e.value0);if(e instanceof L)return p.Nothing.value;throw new Error("Failed pattern match at Ctl.Internal.Wallet (line 220, column 15 - line 227, column 25): "+[e.constructor.name])},r.actionBasedOnWallet=function(e){return function(n){return function(t){return function(r){if(r instanceof B)return C.liftAff(e)(U(r.value0)(n));if(r instanceof M)return C.liftAff(e)(U(r.value0)(n));if(r instanceof R)return C.liftAff(e)(U(r.value0)(n));if(r instanceof P)return C.liftAff(e)(U(r.value0)(n));if(r instanceof k)return C.liftAff(e)(U(r.value0)(n));if(r instanceof N)return C.liftAff(e)(U(r.value0)(n));if(r instanceof L)return t(r.value0);throw new Error("Failed pattern match at Ctl.Internal.Wallet (line 296, column 3 - line 303, column 39): "+[r.constructor.name])}}}},r.callCip30Wallet=U}(c),function(e){"use strict";e["Ctl.Internal.Types.Cbor"]=e["Ctl.Internal.Types.Cbor"]||{};var n,t=e["Ctl.Internal.Types.Cbor"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Control.Monad.Error.Class"],u=e["Control.Monad.Except"],i=e["Control.Monad.Except.Trans"],c=e["Control.Monad.State.Class"],l=e["Control.Monad.State.Trans"],s=e["Ctl.Internal.Types.ByteArray"],f=e["Data.Foldable"],d=e["Data.Function"],v=e["Data.Functor"],m=e["Data.Identity"],p=e["Data.Semiring"],g=e["Data.UInt"],y=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),w=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),h=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),b=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),C=function(e){return n=g.toInt(e),o.bind(l.bindStateT(i.monadExceptT(m.monadIdentity)))(c.get(l.monadStateStateT(i.monadExceptT(m.monadIdentity))))((function(e){return o.discard(o.discardUnit)(l.bindStateT(i.monadExceptT(m.monadIdentity)))(r.when(l.applicativeStateT(i.monadExceptT(m.monadIdentity)))(n>s.byteLength(e))(a.throwError(l.monadThrowStateT(i.monadThrowExceptT(m.monadIdentity)))(new b(e,n))))((function(){return o.discard(o.discardUnit)(l.bindStateT(i.monadExceptT(m.monadIdentity)))(c.put(l.monadStateStateT(i.monadExceptT(m.monadIdentity)))(s.subarray(n)(s.byteLength(e))(e)))((function(){return r.pure(l.applicativeStateT(i.monadExceptT(m.monadIdentity)))(s.subarray(0)(n)(e))}))}))}));var n},A=function(e){return v.map(l.functorStateT(i.functorExceptT(m.functorIdentity)))((n=v.map(v.functorArray)(g.fromInt),function(e){return n(s.byteArrayToIntArray(e))}))(C(e));var n},S=f.foldl(f.foldableArray)((function(e){return function(n){return g.or(g.shl(e)(g.fromInt(8)))(n)}}))(p.zero(g.uintSemiring)),I=v.map(l.functorStateT(i.functorExceptT(m.functorIdentity)))(S)(A(p.one(g.uintSemiring))),T=o.bind(l.bindStateT(i.monadExceptT(m.monadIdentity)))(I)((function(e){var n,t,o=(n=e,{majorType:g.zshr(n)(g.fromInt(5)),additionalInformation:g.and(n)(g.fromInt(31))}),u=(t=g.toInt(o.additionalInformation))<24?r.pure(l.applicativeStateT(i.monadExceptT(m.monadIdentity)))(o.additionalInformation):24===t?v.mapFlipped(l.functorStateT(i.functorExceptT(m.functorIdentity)))(A(g.fromInt(1)))(S):25===t?v.mapFlipped(l.functorStateT(i.functorExceptT(m.functorIdentity)))(A(g.fromInt(2)))(S):26===t?v.mapFlipped(l.functorStateT(i.functorExceptT(m.functorIdentity)))(A(g.fromInt(4)))(S):27===t?v.mapFlipped(l.functorStateT(i.functorExceptT(m.functorIdentity)))(A(g.fromInt(8)))(S):a.throwError(l.monadThrowStateT(i.monadThrowExceptT(m.monadIdentity)))(new h(o.additionalInformation));return 2===g.toInt(o.majorType)?v.map(l.functorStateT(i.functorExceptT(m.functorIdentity)))(y.create)(u):a.throwError(l.monadThrowStateT(i.monadThrowExceptT(m.monadIdentity)))(new w(o.majorType))})),D=(n=o.bind(l.bindStateT(i.monadExceptT(m.monadIdentity)))(T)((function(e){return C(e.value0)})),function(e){return u.runExcept(d.flip(l.evalStateT(i.functorExceptT(m.functorIdentity)))(e)(n))});t.toByteArray=D}(c),function(e){"use strict";e["Ctl.Internal.Cardano.TextEnvelope"]=e["Ctl.Internal.Cardano.TextEnvelope"]||{};var n=e["Ctl.Internal.Cardano.TextEnvelope"],t=e.Aeson,r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Types.ByteArray"],u=e["Ctl.Internal.Types.Cbor"],i=e["Ctl.Internal.Types.Scripts"],c=e["Data.Either"],l=e["Data.Eq"],s=e["Data.Maybe"],f=e["Data.Newtype"],d=function(){function e(){}return e.value=new e,e}(),v=function(){function e(){}return e.value=new e,e}(),m=function(){function e(){}return e.value=new e,e}(),p=function(){function e(){}return e.value=new e,e}(),g=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),y={eq:function(e){return function(n){return e instanceof d&&n instanceof d||e instanceof v&&n instanceof v||e instanceof m&&n instanceof m||e instanceof p&&n instanceof p||e instanceof g&&n instanceof g&&e.value0===n.value0}}},w={decodeAeson:function(e){return o.bind(c.bindEither)(t.decodeAeson(t.decodeAesonString)(e))((function(e){return"PlutusScriptV1"===e?r.pure(c.applicativeEither)(d.value):"PlutusScriptV2"===e?r.pure(c.applicativeEither)(v.value):"PaymentSigningKeyShelley_ed25519"===e?r.pure(c.applicativeEither)(m.value):"StakeSigningKeyShelley_ed25519"===e?r.pure(c.applicativeEither)(p.value):r.pure(c.applicativeEither)(new g(e))}))}};n.PaymentSigningKeyShelleyed25519=m,n.StakeSigningKeyShelleyed25519=p,n.decodeTextEnvelope=function(e){return o.bind(s.bindMaybe)(c.hush(t.parseJsonStringToAeson(e)))((function(e){return o.bind(s.bindMaybe)(c.hush(t.decodeAeson(t.decodeAesonRecord(t.gDecodeAesonCons(t.decodeAesonField1(t.decodeAesonString))(t.gDecodeAesonCons(t.decodeAesonField1(t.decodeAesonString))(t.gDecodeAesonCons(t.decodeAesonField1(w))(t.gDecodeAesonRowNil)({reflectSymbol:function(){return"type"}})()())({reflectSymbol:function(){return"description"}})()())({reflectSymbol:function(){return"cborHex"}})()())())(e)))((function(e){return o.bind(s.bindMaybe)((n=e.cborHex,o.bind(s.bindMaybe)(a.hexToByteArray(n))((function(e){return c.hush(u.toByteArray(f.wrap()(f.wrap()(e))))}))))((function(n){return r.pure(s.applicativeMaybe)(f.wrap()({type_:e.type,description:e.description,bytes:n}))}));var n}))}))},n.plutusScriptV2FromEnvelope=function(e){return(n=v.value,function(e){return function(t){return o.discard(o.discardUnit)(s.bindMaybe)(r.unless(s.applicativeMaybe)(l.eq(y)(t.type_)(n))(s.Nothing.value))((function(){return r.pure(s.applicativeMaybe)(e(t.bytes))}))}})(i.plutusV2Script)(e);var n},n.eqTextEnvelopeType=y}(c),function(e){"use strict";e["Node.Encoding"]=e["Node.Encoding"]||{};var n=e["Node.Encoding"],t=function(){function e(){}return e.value=new e,e}(),r=function(){function e(){}return e.value=new e,e}(),o=function(){function e(){}return e.value=new e,e}(),a=function(){function e(){}return e.value=new e,e}(),u=function(){function e(){}return e.value=new e,e}(),i=function(){function e(){}return e.value=new e,e}(),c=function(){function e(){}return e.value=new e,e}(),l=function(){function e(){}return e.value=new e,e}(),s={show:function(e){if(e instanceof t)return"ASCII";if(e instanceof r)return"UTF8";if(e instanceof o)return"UTF16LE";if(e instanceof a)return"UCS2";if(e instanceof u)return"Base64";if(e instanceof i)return"Latin1";if(e instanceof c)return"Binary";if(e instanceof l)return"Hex";throw new Error("Failed pattern match at Node.Encoding (line 19, column 1 - line 27, column 23): "+[e.constructor.name])}};n.UTF8=r,n.showEncoding=s}(c),function(e){"use strict";e.unsafeRequireFS=t(5174)}(c["Node.FS.Internal"]=c["Node.FS.Internal"]||{}),function(e){"use strict";e["Node.FS.Internal"]=e["Node.FS.Internal"]||{};var n=e["Node.FS.Internal"],t=e["Node.FS.Internal"],r=e["Unsafe.Coerce"].unsafeCoerce;n.mkEffect=r,n.unsafeRequireFS=t.unsafeRequireFS}(c),function(e){"use strict";e["Node.FS.Sync"]=e["Node.FS.Sync"]||{};var n=e["Node.FS.Sync"],t=e["Data.Show"],r=e["Node.Encoding"],o=e["Node.FS.Internal"],a=o.unsafeRequireFS;n.readTextFile=function(e){return function(n){return o.mkEffect((function(o){return a.readFileSync(n,{encoding:t.show(r.showEncoding)(e)})}))}}}(c),function(e){"use strict";e["Ctl.Internal.Wallet.KeyFile"]=e["Ctl.Internal.Wallet.KeyFile"]||{};var n=e["Ctl.Internal.Wallet.KeyFile"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Error.Class"],a=e["Ctl.Internal.Cardano.TextEnvelope"],u=e["Ctl.Internal.Deserialization.Keys"],i=e["Ctl.Internal.Helpers"],c=e["Ctl.Internal.Wallet.Key"],l=e["Data.Eq"],s=e["Data.Functor"],f=e["Data.Maybe"],d=e["Data.Newtype"],v=e["Data.Show"],m=e["Effect.Aff"],p=e["Effect.Class"],g=e["Effect.Exception"],y=e["Node.Encoding"],w=e["Node.FS.Sync"],h=function(e){return function(n){var u;return u=r.bind(m.bindAff)(p.liftEffect(m.monadEffectAff)(w.readTextFile(y.UTF8.value)(e)))((function(e){var u=g.error("Error while decoding key");return o.liftMaybe(m.monadThrowAff)(u)(r.bind(f.bindMaybe)(a.decodeTextEnvelope(e))((function(e){return r.discard(r.discardUnit)(f.bindMaybe)(t.unless(f.applicativeMaybe)(l.eq(a.eqTextEnvelopeType)(e.type_)(n))(f.Nothing.value))((function(){return t.pure(f.applicativeMaybe)(e.bytes)}))})))})),o.catchError(m.monadErrorAff)(u)((function(n){return p.liftEffect(m.monadEffectAff)(g.throw("Unable to load key from file: "+v.show(v.showString)(e)+", error: "+v.show(g.showError)(n)))}))}};n.privatePaymentKeyFromFile=function(e){return r.bind(m.bindAff)(h(e)(a.PaymentSigningKeyShelleyed25519.value))((function(e){return i.liftM(m.monadErrorAff)(g.error("Unable to decode private payment key"))(s.map(f.functorMaybe)(c.PrivatePaymentKey)(u.privateKeyFromBytes(d.wrap()(e))))}))},n.privateStakeKeyFromFile=function(e){return r.bind(m.bindAff)(h(e)(a.StakeSigningKeyShelleyed25519.value))((function(e){return i.liftM(m.monadErrorAff)(g.error("Unable to decode private stake key"))(s.map(f.functorMaybe)(c.PrivateStakeKey)(u.privateKeyFromBytes(d.wrap()(e))))}))}}(c),function(e){"use strict";e["Ctl.Internal.Wallet.Spec"]=e["Ctl.Internal.Wallet.Spec"]||{};var n=e["Ctl.Internal.Wallet.Spec"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Ctl.Internal.Wallet"],a=e["Ctl.Internal.Wallet.KeyFile"],u=e["Data.Traversable"],i=e["Effect.Aff"],c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),d=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),v=function(){function e(){}return e.value=new e,e}(),m=function(){function e(){}return e.value=new e,e}(),p=function(){function e(){}return e.value=new e,e}(),g=function(){function e(){}return e.value=new e,e}(),y=function(){function e(){}return e.value=new e,e}(),w=function(){function e(){}return e.value=new e,e}();n.ConnectToNami=v,n.ConnectToFlint=p,n.ConnectToEternl=g,n.ConnectToLode=y,n.mkWalletBySpec=function(e){if(e instanceof d)return r.bind(i.bindAff)(function(){if(e.value0 instanceof s)return a.privatePaymentKeyFromFile(e.value0.value0);if(e.value0 instanceof f)return t.pure(i.applicativeAff)(e.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.Wallet.Spec (line 62, column 26 - line 65, column 45): "+[e.value0.constructor.name])}())((function(n){return r.bind(i.bindAff)(u.for(i.applicativeAff)(u.traversableMaybe)(e.value1)((function(e){if(e instanceof c)return a.privateStakeKeyFromFile(e.value0);if(e instanceof l)return t.pure(i.applicativeAff)(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Wallet.Spec (line 66, column 45 - line 68, column 43): "+[e.constructor.name])})))((function(e){return t.pure(i.applicativeAff)(o.mkKeyWallet(n)(e))}))}));if(e instanceof v)return o.mkWalletAff(o.NamiWallet.value);if(e instanceof m)return o.mkWalletAff(o.GeroWallet.value);if(e instanceof p)return o.mkWalletAff(o.FlintWallet.value);if(e instanceof g)return o.mkWalletAff(o.EternlWallet.value);if(e instanceof y)return o.mkWalletAff(o.LodeWallet.value);if(e instanceof w)return o.mkWalletAff(o.NuFiWallet.value);throw new Error("Failed pattern match at Ctl.Internal.Wallet.Spec (line 60, column 18 - line 75, column 42): "+[e.constructor.name])}}(c),function(e){"use strict";e.copyRecord=function(e){var n={};for(var t in e)({}).hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n}}(c["Record.Builder"]=c["Record.Builder"]||{}),function(e){"use strict";e["Record.Builder"]=e["Record.Builder"]||{};var n=e["Record.Builder"],t=e["Record.Builder"],r=e["Control.Semigroupoid"],o=e["Record.Unsafe.Union"],a=r.semigroupoidFn;n.build=function(e){return function(n){return e(t.copyRecord(n))}},n.merge=function(){return function(){return function(e){return function(n){return o.unsafeUnionFn(e,n)}}}},n.semigroupoidBuilder=a}(c),function(e){"use strict";e["Ctl.Internal.Contract.Monad"]=e["Ctl.Internal.Contract.Monad"]||{};var n,t=e["Ctl.Internal.Contract.Monad"],r=e["Control.Applicative"],o=e["Control.Apply"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Control.Monad.Logger.Trans"],c=e["Control.Monad.Reader.Class"],l=e["Control.Monad.Reader.Trans"],s=e["Control.Parallel.Class"],f=e["Control.Semigroupoid"],d=e["Ctl.Internal.Contract.QueryBackend"],v=e["Ctl.Internal.Helpers"],m=e["Ctl.Internal.JsWebSocket"],p=e["Ctl.Internal.Logging"],g=e["Ctl.Internal.QueryM"],y=e["Ctl.Internal.QueryM.Kupo"],w=e["Ctl.Internal.Serialization.Address"],h=e["Ctl.Internal.Service.Blockfrost"],b=e["Ctl.Internal.Service.Error"],C=e["Ctl.Internal.Types.Transaction"],A=e["Ctl.Internal.Types.UsedTxOuts"],S=e["Ctl.Internal.Wallet"],I=e["Ctl.Internal.Wallet.Spec"],T=e["Data.Bifunctor"],D=e["Data.Boolean"],F=e["Data.Either"],E=e["Data.Eq"],x=e["Data.Foldable"],M=e["Data.Function"],R=e["Data.Functor"],P=e["Data.HeytingAlgebra"],B=e["Data.Maybe"],k=e["Data.Newtype"],N=e["Data.Show"],L=e["Data.Traversable"],_=e["Data.Unit"],U=e.Effect,H=e["Effect.Aff"],q=e["Effect.Aff.Class"],O=e["Effect.Class"],W=e["Effect.Exception"],V=e["Record.Builder"],K=l.monadThrowReaderT(H.monadThrowAff),z=l.monadErrorReaderT(H.monadErrorAff),J=l.monadEffectReader(H.monadEffectAff),j=l.monadReaderT(H.monadAff),Q=l.monadAskReaderT(H.monadAff),G=q.monadAffReader(q.monadAffAff),Z=l.functorReaderT(H.functorAff),X=l.bindReaderT(H.bindAff),Y={log:function(e){return a.bind(X)(c.ask(Q))((function(n){var t=B.fromMaybe(v.logWithLevel(H.monadEffectAff))(n.customLogger);return q.liftAff(G)(t(n.logLevel)(e))}))},MonadEffect0:function(){return J}},$=l.applicativeReaderT(H.applicativeParAff),ee={parallel:function(e){return s.parallel(s.monadParReaderT(H.parallelAff))(e)},sequential:function(e){return s.sequential(s.monadParReaderT(H.parallelAff))(e)},Monad0:function(){return j},Applicative1:function(){return $}},ne=l.applicativeReaderT(H.applicativeAff),te=l.alternativeReaderT(H.alternativeParAff),re=(n=l.withReaderT((function(e){return e.usedTxOuts})),function(e){return n(e)}),oe=function(e){return function(n){var t=M.flip(l.runReaderT)(function(e){return function(n){return{config:{kupoConfig:n.kupoConfig,logLevel:e.logLevel,customLogger:e.customLogger,suppressLogs:e.suppressLogs},runtime:{ogmiosWs:n.ogmios.ws}}}}(e)(n)),r=k.unwrap();return function(e){return t(r(e))}}},ae=function(e){return function(n){return a.bind(H.bindAff)(O.liftEffect(H.monadEffectAff)(p.setupLogs(e.logLevel)(e.customLogger)))((function(t){var c=function(){if(e.suppressLogs)return new B.Just((n=R.map(R.functorFn)(O.liftEffect(H.monadEffectAff)),function(e){return n(t.addLogEntry(e))}));var n;if(D.otherwise)return e.customLogger;throw new Error("Failed pattern match at Ctl.Internal.Contract.Monad (line 321, column 5 - line 321, column 60): "+[])}();return a.bind(H.bindAff)(function(e){var n,t,u=p.mkLogger(e.logLevel)(e.customLogger),c={networkId:e.networkId,logLevel:e.logLevel,walletSpec:e.walletSpec,customLogger:e.customLogger,suppressLogs:e.suppressLogs,hooks:e.hooks},m=L.traverse(L.traversableMaybe)(H.applicativeAff)(I.mkWalletBySpec)(e.walletSpec);return a.discard(a.discardUnit)(H.bindAff)(x.for_(H.applicativeAff)(x.foldableMaybe)(e.hooks.beforeInit)((n=R.void(H.functorAff),t=O.liftEffect(H.monadEffectAff),function(e){return n(t(W.try(e)))})))((function(){return a.bind(H.bindAff)(A.newUsedTxOuts(H.monadEffectAff))((function(n){return a.bind(H.bindAff)(s.sequential(H.parallelAff)(o.apply(H.applyParAff)(R.map(H.functorParAff)((function(e){return function(t){return f.composeFlipped(V.semigroupoidBuilder)(e)(f.composeFlipped(V.semigroupoidBuilder)(t)(V.merge()()({usedTxOuts:n})))}}))(s.parallel(H.parallelAff)(a.bind(H.bindAff)(function(e){var n=function(n){var t,o,u,i=(t=R.map(H.functorAff)(F.isRight),o=y.isTxConfirmedAff(n.kupoConfig),u=k.wrap(),function(e){return t(o(u(e)))});return a.bind(H.bindAff)(g.mkOgmiosWebSocketAff(i)(e)(n.ogmiosConfig))((function(e){return r.pure(H.applicativeAff)({ogmios:{config:n.ogmiosConfig,ws:e},kupoConfig:n.kupoConfig})}))};return function(e){if(e instanceof d.CtlBackendParams)return R.map(H.functorAff)(M.flip(d.CtlBackend.create)(e.value1))(n(e.value0));if(e instanceof d.BlockfrostBackendParams)return R.map(H.functorAff)(d.BlockfrostBackend.create(e.value0))(L.traverse(L.traversableMaybe)(H.applicativeAff)(n)(e.value1));throw new Error("Failed pattern match at Ctl.Internal.Contract.Monad (line 221, column 23 - line 225, column 78): "+[e.constructor.name])}}(u)(e.backendParams))((function(n){return a.bind(H.bindAff)(function(e){var n,t,r,u=a.bindFlipped(i.bindLoggerT(l.monadReaderT(H.monadAff)))((t=v.liftEither(i.monadErrorLoggerT(l.monadErrorReaderT(H.monadErrorAff))),r=T.lmap(T.bifunctorEither)((n=N.show(b.showClientError),function(e){return W.error(n(e))})),function(e){return t(r(e))})),c=p.mkLogger(e.logLevel)(e.customLogger),s=B.fromMaybe(v.logWithLevel(H.monadEffectAff))(e.customLogger)(e.logLevel);return function(e){if(e instanceof d.CtlBackend)return o.apply(H.applyAff)(R.map(H.functorAff)((function(e){return function(n){return{pparams:e,systemStart:n}}}))(R.map(H.functorAff)(k.unwrap())(g.getProtocolParametersAff(e.value0.ogmios.ws)(c))))(g.getSystemStartAff(e.value0.ogmios.ws)(c));if(e instanceof d.BlockfrostBackend)return h.runBlockfrostServiceM(s)(e.value0)(o.apply(i.applyLoggerT(l.monadReaderT(H.monadAff)))(R.map(i.functorLoggerT(l.functorReaderT(H.functorAff)))((function(e){return function(n){return{pparams:e,systemStart:n}}}))(u(h.getProtocolParameters)))(u(h.getSystemStart)));throw new Error("Failed pattern match at Ctl.Internal.Contract.Monad (line 248, column 29 - line 257, column 54): "+[e.constructor.name])}}(e)(n))((function(e){return r.pure(H.applicativeAff)(V.merge()()({backend:n,ledgerConstants:e}))}))})))))(s.parallel(H.parallelAff)(a.bind(H.bindAff)(m)((function(e){return r.pure(H.applicativeAff)(V.merge()()({wallet:e}))}))))))((function(e){return r.pure(H.applicativeAff)(V.build(e)(c))}))}))}))}({backendParams:e.backendParams,networkId:e.networkId,logLevel:e.logLevel,walletSpec:e.walletSpec,customLogger:c,suppressLogs:e.suppressLogs,hooks:e.hooks}))((function(e){return a.discard(a.discardUnit)(H.bindAff)(x.for_(H.applicativeAff)(x.foldableMaybe)(e.wallet)((i=e.networkId,c=function(e){return 0===e?r.pure(H.applicativeAff)(w.TestnetId.value):1===e?r.pure(H.applicativeAff)(w.MainnetId.value):O.liftEffect(H.monadEffectAff)(W.throw("Unknown network id"))},l=function(e){return r.unless(H.applicativeAff)(E.eq(w.eqNetworkId)(i)(e))(O.liftEffect(H.monadEffectAff)(W.throw("The networkId that is specified is not equal to the one from wallet. The wallet is using "+N.show(w.showNetworkId)(e)+" while "+N.show(w.showNetworkId)(i)+" is specified in the config.")))},S.actionBasedOnWallet(q.monadAffAff)((function(e){return a.composeKleisliFlipped(H.bindAff)(l)(a.composeKleisliFlipped(H.bindAff)(c)(e.getNetworkId))}))(r.pure(r.applicativeFn)(r.pure(H.applicativeAff)(_.unit))))))((function(){return a.bind(H.bindAff)(H.attempt(M.flip(H.finally)(H.supervise(n(e)))(function(e){var n,t=(n=o.apply(o.applyFn)(R.map(R.functorFn)(o.applySecond(U.applyEffect))(m._wsFinalize))(m._wsClose),function(e){return n(g.underlyingWebSocket(e))});return O.liftEffect(H.monadEffectAff)(x.traverse_(U.applicativeEffect)(x.foldableMaybe)((function(e){return t(e.ogmios.ws)}))(d.getCtlBackend(e.backend)))}(e))))((function(n){return O.liftEffect(H.monadEffectAff)(function(){if(n instanceof F.Left)return function(){return x.for_(U.applicativeEffect)(x.foldableMaybe)(e.hooks.onError)((function(e){return R.void(U.functorEffect)(W.try(e(n.value0)))}))(),r.when(U.applicativeEffect)(e.suppressLogs)(t.printLogs)(),u.throwError(u.monadThrowEffect)(n.value0)()};if(n instanceof F.Right)return function(){var t;return x.for_(U.applicativeEffect)(x.foldableMaybe)(e.hooks.onSuccess)((t=R.void(U.functorEffect),function(e){return t(W.try(e))}))(),n.value0};throw new Error("Failed pattern match at Ctl.Internal.Contract.Monad (line 331, column 16 - line 338, column 15): "+[n.constructor.name])}())}))}));var i,c,l}))}))}};t.runContract=function(e){return function(n){return ae(e)((function(e){return(t=e,r=M.flip(l.runReaderT)(t),o=k.unwrap(),function(e){return r(o(e))})(n);var t,r,o}))}},t.runQueryM=oe,t.wrapQueryM=function(e){return a.bind(X)(c.asks(Q)((function(e){return e.backend})))((function(n){return a.bind(X)(v.liftM(z)(W.error("Operation only supported on CTL backend"))(d.getCtlBackend(n)))((function(n){return a.bind(X)(c.ask(Q))((function(t){return q.liftAff(G)(oe(t)(n)(e))}))}))}))},t.filterLockedUtxos=function(e){return re(M.flip(v.filterMapWithKeyM(C.ordTransactionInput)(l.monadReaderT(H.monadAff)))(e)((function(e){return function(n){return R.map(l.functorReaderT(H.functorAff))(P.not(P.heytingAlgebraBoolean))(A.isTxOutRefUsed(l.monadAskReaderT(H.monadAff))(l.monadEffectReader(H.monadEffectAff))(k.unwrap()(e)))}})))},t.functorContract=Z,t.applicativeContract=ne,t.bindContract=X,t.monadContract=j,t.monadEffectContract=J,t.monadAffContract=G,t.monadAskContractEnvContra=Q,t.monadThrowErrorContract=K,t.monadErrorErrorContract=z,t.monadLoggerContract=Y,t.parallelParContractContra=ee,t.alternativeParContract=te}(c),function(e){"use strict";e["Contract.Log"]=e["Contract.Log"]||{};var n=e["Contract.Log"],t=e["Control.Monad.Logger.Class"],r=e["Data.Map.Internal"];n["logDebug'"]=function(e){return t.debug(e)(r.empty)},n["logInfo'"]=function(e){return t.info(e)(r.empty)},n["logWarn'"]=function(e){return t.warn(e)(r.empty)},n["logError'"]=function(e){return t.error(e)(r.empty)}}(c),function(e){const n=t(8002);let r;t(4288),t(466),r=t(1164),r=t(6359)(r),e.blake2b256Hash=e=>n.blake2b(e,null,32),e.hashPlutusData=e=>r.hash_plutus_data(e),e.hashPlutusScript=e=>e.hash()}(c["Ctl.Internal.Hashing"]=c["Ctl.Internal.Hashing"]||{}),function(e){"use strict";e["Ctl.Internal.Hashing"]=e["Ctl.Internal.Hashing"]||{};var n,t,r,o,a,u,i,c=e["Ctl.Internal.Hashing"],l=e["Ctl.Internal.Hashing"],s=e["Ctl.Internal.Cardano.Types.ScriptRef"],f=e["Ctl.Internal.Deserialization.Transaction"],d=e["Ctl.Internal.Serialization.Hash"],v=e["Ctl.Internal.Serialization.NativeScript"],m=e["Ctl.Internal.Serialization.PlutusData"],p=e["Ctl.Internal.Serialization.PlutusScript"],g=e["Ctl.Internal.Serialization.ToBytes"],y=e["Data.Newtype"],w=(n=y.wrap(),t=y.unwrap(),r=g.toBytes(),function(e){return n(l.blake2b256Hash(t(r(f._txBody(e)))))}),h=function(e){return l.hashPlutusScript(p.convertPlutusScript(e))},b=(o=y.wrap(),a=y.unwrap(),u=g.toBytes(),i=y.unwrap(),function(e){return o(a(u(l.hashPlutusData(m.convertPlutusData(i(e))))))});c.datumHash=b,c.plutusScriptHash=h,c.transactionHash=w,c.scriptRefHash=function(e){if(e instanceof s.PlutusScriptRef)return h(e.value0);if(e instanceof s.NativeScriptRef)return d.nativeScriptHash(v.convertNativeScript(e.value0));throw new Error("Failed pattern match at Ctl.Internal.Hashing (line 86, column 1 - line 86, column 41): "+[e.constructor.name])}}(c),function(e){"use strict";e["Ctl.Internal.QueryM.CurrentEpoch"]=e["Ctl.Internal.QueryM.CurrentEpoch"]||{};var n=e["Ctl.Internal.QueryM.CurrentEpoch"],t=e["Ctl.Internal.QueryM"],r=e["Ctl.Internal.QueryM.Ogmios"],o=e["Data.Unit"],a=t.mkOgmiosRequest(r.queryCurrentEpochCall)((function(e){return e.currentEpoch}))(o.unit);n.getCurrentEpoch=a}(c),function(e){"use strict";e["Ctl.Internal.QueryM.EraSummaries"]=e["Ctl.Internal.QueryM.EraSummaries"]||{};var n=e["Ctl.Internal.QueryM.EraSummaries"],t=e["Ctl.Internal.QueryM"],r=e["Ctl.Internal.QueryM.Ogmios"],o=e["Data.Functor"],a=e["Data.Newtype"],u=e["Data.Unit"],i=e["Effect.Aff"],c=o.map(t.functorQueryMT(i.functorAff))(a.unwrap())(t.mkOgmiosRequest(r.queryEraSummariesCall)((function(e){return e.eraSummaries}))(u.unit));n.getEraSummaries=c}(c),function(e){"use strict";e["Ctl.Internal.QueryM.Pools"]=e["Ctl.Internal.QueryM.Pools"]||{};var n=e["Ctl.Internal.QueryM.Pools"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Ctl.Internal.QueryM"],a=e["Ctl.Internal.QueryM.Ogmios"],u=e["Ctl.Internal.Serialization.Hash"],i=e["Ctl.Internal.Types.ByteArray"],c=e["Data.Map.Internal"],l=e["Data.Newtype"],s=e["Data.Ord"],f=e["Data.Unit"],d=e["Effect.Aff"],v=o.mkOgmiosRequest(a.queryPoolIdsCall)((function(e){return e.poolIds}))(f.unit);n.getPoolIds=v,n.getPubKeyHashDelegationsAndRewards=function(e){var n=u.ed25519KeyHashToBech32Unsafe("stake_vkh")(l.unwrap()(l.unwrap()(e))),f=i.byteArrayToHex(l.unwrap()(u.ed25519KeyHashToBytes(l.unwrap()(l.unwrap()(e)))));return r.bind(o.bindQueryMT(d.bindAff))(o.mkOgmiosRequest(a.queryDelegationsAndRewards)((function(e){return e.delegationsAndRewards}))([n]))((function(e){return t.pure(o.applicativeQueryMT(d.applicativeAff))(c.lookup(s.ordString)(f)(e))}))},n.getValidatorHashDelegationsAndRewards=function(e){var n=u.scriptHashToBech32Unsafe("script")(l.unwrap()(e)),f=i.byteArrayToHex(l.unwrap()(u.scriptHashToBytes(l.unwrap()(e))));return r.bind(o.bindQueryMT(d.bindAff))(o.mkOgmiosRequest(a.queryDelegationsAndRewards)((function(e){return e.delegationsAndRewards}))([n]))((function(e){return t.pure(o.applicativeQueryMT(d.applicativeAff))(c.lookup(s.ordString)(f)(e))}))}}(c),function(e){"use strict";e["Ctl.Internal.Contract.QueryHandle"]=e["Ctl.Internal.Contract.QueryHandle"]||{};var n=e["Ctl.Internal.Contract.QueryHandle"],t=e.Aeson,r=e["Contract.Log"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Control.Monad.Logger.Trans"],c=e["Control.Monad.Reader.Class"],l=e["Control.Monad.Reader.Trans"],s=e["Ctl.Internal.Contract.Monad"],f=e["Ctl.Internal.Contract.QueryBackend"],d=e["Ctl.Internal.Hashing"],v=e["Ctl.Internal.Helpers"],m=e["Ctl.Internal.QueryM"],p=e["Ctl.Internal.QueryM.CurrentEpoch"],g=e["Ctl.Internal.QueryM.EraSummaries"],y=e["Ctl.Internal.QueryM.Kupo"],w=e["Ctl.Internal.QueryM.Ogmios"],h=e["Ctl.Internal.QueryM.Pools"],b=e["Ctl.Internal.Serialization"],C=e["Ctl.Internal.Serialization.ToBytes"],A=e["Ctl.Internal.Service.Blockfrost"],S=e["Ctl.Internal.Service.Error"],I=e["Ctl.Internal.Types.Transaction"],T=e["Data.Either"],D=e["Data.Functor"],F=e["Data.Map.Internal"],E=e["Data.Maybe"],x=e["Data.Newtype"],M=e["Data.Show"],R=e["Effect.Aff"],P=e["Effect.Class"],B=e["Effect.Exception"],k=D.mapFlipped(s.functorContract)(c.ask(s.monadAskContractEnvContra))((function(e){if(e.backend instanceof f.CtlBackend)return function(e){return function(n){var u,i=s.runQueryM(e)(n);return{getDatumByHash:function(e){return i(y.getDatumByHash(e))},getScriptByHash:function(e){return i(y.getScriptByHash(e))},getUtxoByOref:function(e){return i(y.getUtxoByOref(e))},doesTxExist:(u=D.map(m.functorQueryMT(R.functorAff))(D.map(T.functorEither)(E.isJust)),function(e){return i(u(y.isTxConfirmed(e)))}),getTxMetadata:function(e){return i(y.getTxMetadata(e))},utxosAt:function(e){return i(y.utxosAt(e))},getChainTip:D.map(R.functorAff)(T.Right.create)(i(m.getChainTip)),getCurrentEpoch:i(p.getCurrentEpoch),submitTx:function(e){return i(a.bind(m.bindQueryMT(R.bindAff))(P.liftEffect(m.monadEffectQueryMTAff)(b.convertTransaction(e)))((function(e){var n=d.transactionHash(e);return a.discard(a.discardUnit)(m.bindQueryMT(R.bindAff))(r["logDebug'"](m.monadLoggerQueryMTAff)("Pre-calculated tx hash: "+M.show(I.showTransactionHash)(n)))((function(){var r=C.toBytes()(e);return a.bind(m.bindQueryMT(R.bindAff))(m.submitTxOgmios(x.unwrap()(n))(r))((function(e){if(e instanceof w.SubmitTxSuccess)return o.pure(m.applicativeQueryMT(R.applicativeAff))(o.pure(T.applicativeEither)(x.wrap()(e.value0)));if(e instanceof w.SubmitFail)return o.pure(m.applicativeQueryMT(R.applicativeAff))(new T.Left(new S.ClientOtherError(M.show(M.showArray(t.showAeson))(e.value0))));throw new Error("Failed pattern match at Ctl.Internal.Contract.QueryHandle (line 124, column 7 - line 126, column 68): "+[e.constructor.name])}))}))})))},evaluateTx:function(e){return function(n){return i(a.bind(m.bindQueryMT(R.bindAff))(D.map(m.functorQueryMT(R.functorAff))(C.toBytes())(P.liftEffect(m.monadEffectQueryMTAff)(b.convertTransaction(e))))((function(e){return m.evaluateTxOgmios(e)(n)})))}},getEraSummaries:D.map(R.functorAff)(T.Right.create)(i(g.getEraSummaries)),getPoolIds:D.map(R.functorAff)(T.Right.create)(i(h.getPoolIds)),getPubKeyHashDelegationsAndRewards:function(e){return function(e){return D.map(R.functorAff)(T.Right.create)(i(h.getPubKeyHashDelegationsAndRewards(e)))}},getValidatorHashDelegationsAndRewards:function(e){return function(e){return D.map(R.functorAff)(T.Right.create)(i(h.getValidatorHashDelegationsAndRewards(e)))}}}}}(e)(e.backend.value0);if(e.backend instanceof f.BlockfrostBackend)return function(e){return function(n){var t=A.runBlockfrostServiceM(E.fromMaybe(v.logWithLevel(R.monadEffectAff))(e.customLogger)(e.logLevel))(n);return{getDatumByHash:function(e){return t(A.getDatumByHash(e))},getScriptByHash:function(e){return t(A.getScriptByHash(e))},getUtxoByOref:function(e){return t(A.getUtxoByOref(e))},doesTxExist:function(e){return t(A.doesTxExist(e))},getTxMetadata:function(e){return t(A.getTxMetadata(e))},utxosAt:function(e){return t(A.utxosAt(e))},getChainTip:t(A.getChainTip),getCurrentEpoch:a.bind(R.bindAff)(t(A.getCurrentEpoch))((function(e){if(e instanceof T.Right)return o.pure(R.applicativeAff)(x.wrap()(e.value0));if(e instanceof T.Left)return u.throwError(R.monadThrowAff)(B.error(M.show(S.showClientError)(e.value0)));throw new Error("Failed pattern match at Ctl.Internal.Contract.QueryHandle (line 156, column 61 - line 158, column 50): "+[e.constructor.name])})),submitTx:function(e){return t(A.submitTx(e))},evaluateTx:function(e){return function(n){return t(a.discard(a.discardUnit)(i.bindLoggerT(l.monadReaderT(R.monadAff)))(o.unless(i.applicativeLoggerT(l.monadReaderT(R.monadAff)))(F.isEmpty(x.unwrap()(n)))(r["logWarn'"](i.monadLoggerLoggerT(l.monadEffectReader(R.monadEffectAff)))("Blockfrost does not support explicit additional utxos")))((function(){return A.evaluateTx(e)})))}},getEraSummaries:t(A.getEraSummaries),getPoolIds:t(A.getPoolIds),getPubKeyHashDelegationsAndRewards:function(e){return function(n){return t(A.getPubKeyHashDelegationsAndRewards(e)(n))}},getValidatorHashDelegationsAndRewards:function(e){return function(n){return t(A.getValidatorHashDelegationsAndRewards(e)(n))}}}}}(e)(e.backend.value0);throw new Error("Failed pattern match at Ctl.Internal.Contract.QueryHandle (line 102, column 3 - line 106, column 58): "+[e.backend.constructor.name])}));n.getQueryHandle=k}(c),function(e){"use strict";e["Ctl.Internal.Contract"]=e["Ctl.Internal.Contract"]||{};var n=e["Ctl.Internal.Contract"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Reader.Class"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Contract.QueryHandle"],i=e["Ctl.Internal.Service.Error"],c=e["Data.Either"],l=e["Data.Show"],s=e["Effect.Aff"],f=e["Effect.Aff.Class"],d=e["Effect.Class"],v=e["Effect.Exception"],m=o.asks(a.monadAskContractEnvContra)((function(e){return e.ledgerConstants.pparams})),p=r.bind(a.bindContract)(u.getQueryHandle)((function(e){return f.liftAff(a.monadAffContract)(r.bind(s.bindAff)(e.getChainTip)(c.either((n=d.liftEffect(s.monadEffectAff),o=l.show(i.showClientError),function(e){return n(v.throw(o(e)))}))(t.pure(s.applicativeAff))));var n,o}));n.getChainTip=p,n.getProtocolParameters=m}(c),function(e){"use strict";e["Ctl.Internal.Contract.Wallet"]=e["Ctl.Internal.Contract.Wallet"]||{};var n,t,r,o,a,u=e["Ctl.Internal.Contract.Wallet"],i=e["Control.Applicative"],c=e["Control.Bind"],l=e["Control.Monad.Reader.Class"],s=e["Ctl.Internal.Cardano.Types.Value"],f=e["Ctl.Internal.Contract"],d=e["Ctl.Internal.Contract.Monad"],v=e["Ctl.Internal.Contract.QueryHandle"],m=e["Ctl.Internal.Helpers"],p=e["Ctl.Internal.Serialization.Address"],g=e["Ctl.Internal.Types.Transaction"],y=e["Ctl.Internal.Wallet"],w=e["Data.Array"],h=e["Data.BigInt"],b=e["Data.Either"],C=e["Data.Foldable"],A=e["Data.Functor"],S=e["Data.Map.Internal"],I=e["Data.Maybe"],T=e["Data.Monoid"],D=e["Data.Newtype"],F=e["Data.Ord"],E=e["Data.Traversable"],x=e["Data.Tuple"],M=e["Data.UInt"],R=e["Effect.Aff"],P=e["Effect.Aff.Class"],B=e["Effect.Class"],k=e["Effect.Exception"],N=l.asks(d.monadAskContractEnvContra)((function(e){return e.wallet})),L=c.bind(d.bindContract)(A.map(d.functorContract)(D.unwrap())(f.getProtocolParameters))((function(e){return c.bind(d.bindContract)(c.bind(d.bindContract)(N)(I.maybe(i.pure(d.applicativeContract)(I.Nothing.value))(y.actionBasedOnWallet(d.monadAffContract)((function(e){return e.getCollateral}))((function(n){return c.bind(d.bindContract)(v.getQueryHandle)((function(t){return c.bind(d.bindContract)(l.asks(d.monadAskContractEnvContra)((function(e){return e.networkId})))((function(r){var o,a=D.unwrap()(n).address(r);return c.bind(d.bindContract)(c.bind(d.bindContract)(A.mapFlipped(d.functorContract)(P.liftAff(d.monadAffContract)(t.utxosAt(a)))((o=I.fromMaybe(S.empty),function(e){return o(b.hush(e))})))(d.filterLockedUtxos))((function(t){return B.liftEffect(d.monadEffectContract)(D.unwrap()(n).selectCollateral(e.coinsPerUtxoUnit)(M.toInt(e.maxCollateralInputs))(t))}))}))}))})))))((function(n){var t=function(e){return D.unwrap()(D.unwrap()(e).output).amount},r=s.lovelaceValueOf(h.fromInt(5e6)),o=A.mapFlipped(I.functorMaybe)(n)((function(e){return C.foldl(C.foldableArray)((function(e){return function(n){return s.geq(w.foldMap(s.monoidValue)(t)(e))(r)?e:w.cons(n)(e)}}))([])(e)}));return c.discard(c.discardUnit)(d.bindContract)(C.for_(d.applicativeContract)(C.foldableMaybe)(o)((function(n){var t=F.greaterThan(M.uintOrd)(M.fromInt(w.length(n)))(e.maxCollateralInputs);return i.when(d.applicativeContract)(t)(B.liftEffect(d.monadEffectContract)(k.throw("Wallet returned too many UTxOs as collateral. This is likely a bug in the wallet.")))})))((function(){return i.pure(d.applicativeContract)(o)}))}))})),_=function(e){return c.bind(d.bindContract)(m.liftedM(d.monadErrorErrorContract)(k.error("No wallet set"))(N))((function(n){return e(n)}))},U=A.map(d.functorContract)(C.fold(C.foldableMaybe)(T.monoidArray))(_(y.actionBasedOnWallet(d.monadAffContract)((function(e){return e.getWalletAddresses}))((function(e){return c.bind(d.bindContract)(l.asks(d.monadAskContractEnvContra)((function(e){return e.networkId})))((function(n){return i.pure(d.applicativeContract)(i.pure(I.applicativeMaybe)(w.singleton(D.unwrap()(e).address(n))))}))})))),H=(t=S.fromFoldable(g.ordTransactionInput)(C.foldableArray),r=A.map(A.functorArray)((n=D.unwrap(),function(e){return t=n(e),new x.Tuple(t.input,t.output);var t})),o=function(e){return t(r(e))},c.bind(d.bindContract)(v.getQueryHandle)((function(e){return c.bind(d.bindContract)(N)((n=A.map(d.functorContract)(c.join(I.bindMaybe)),t=E.traverse(E.traversableMaybe)(d.applicativeContract)(y.actionBasedOnWallet(d.monadAffContract)((function(e){return function(n){return A.mapFlipped(R.functorAff)(e.getUtxos(n))(A.map(I.functorMaybe)(o))}}))((function(n){return c.bind(d.bindContract)(A.mapFlipped(d.functorContract)(U)(w.head))((function(n){return A.map(d.functorContract)(c.join(I.bindMaybe))(E.for(d.applicativeContract)(E.traversableMaybe)(n)((t=A.map(d.functorContract)(b.hush),r=P.liftAff(d.monadAffContract),function(n){return t(r(e.utxosAt(n)))})));var t,r}))}))),function(e){return n(t(e))}));var n,t}))),q=A.map(d.functorContract)(w.catMaybes)(c.bind(d.bindContract)(U)(E.traverse(E.traversableArray)(d.applicativeContract)((function(e){return c.bind(d.bindContract)(m.liftM(d.monadErrorErrorContract)(k.error("Unable to get payment credential from Address"))(p.addressPaymentCred(e)))((function(e){return i.pure(d.applicativeContract)(A.mapFlipped(I.functorMaybe)(p.stakeCredentialToKeyHash(e))(D.wrap()))}))})))),O=A.map(d.functorContract)(A.map(A.functorArray)(D.wrap()))(q),W=(a=function(e){return c.bind(I.bindMaybe)(p.baseAddressFromAddress(e))((function(e){return A.map(I.functorMaybe)((n=D.wrap(),t=D.wrap(),function(e){return n(t(e))}))(p.stakeCredentialToKeyHash(p.baseAddressDelegationCred(e)));var n,t}))},c.bind(d.bindContract)(U)((function(e){return i.pure(d.applicativeContract)(A.map(A.functorArray)(a)(e))}))),V=_(y.actionBasedOnWallet(d.monadAffContract)((function(e){return e.getChangeAddress}))((function(e){return c.bind(d.bindContract)(l.asks(d.monadAskContractEnvContra)((function(e){return e.networkId})))((function(n){return i.pure(d.applicativeContract)(i.pure(I.applicativeMaybe)(D.unwrap()(e).address(n)))}))})));u.getChangeAddress=V,u.getWalletAddresses=U,u.ownPaymentPubKeyHashes=O,u.ownStakePubKeysHashes=W,u.withWallet=_,u.getWalletCollateral=L,u.getWalletUtxos=H}(c),function(e){"use strict";e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"]=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"]||{};var n=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"];n.getIndexWithLabelConsI1=function(){return function(){return function(e){return function(n){return{IsSymbol0:function(){return e}}}}}},n.getIndexWithLabelConsI=function(e){return function(){return function(){return function(n){return function(n){return{IsSymbol0:e.IsSymbol0}}}}}}}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.Credential"]=e["Ctl.Internal.Plutus.Types.Credential"]||{};var n=e["Ctl.Internal.Plutus.Types.Credential"],t=e["Ctl.Internal.FromData"],r=e["Ctl.Internal.Serialization.Address"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.TypeLevel.Nat"],u=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],i=e["Ctl.Internal.Types.PubKeyHash"],c=e["Ctl.Internal.Types.Scripts"],l=e["Data.Generic.Rep"],s=e["Data.Show"],f=e["Data.Show.Generic"],d=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),v=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),m=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),p=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),g={to:function(e){if(e instanceof l.Inl)return new m(e.value0);if(e instanceof l.Inr)return new p(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.Credential (line 111, column 1 - line 111, column 44): "+[e.constructor.name])},from:function(e){if(e instanceof m)return new l.Inl(e.value0);if(e instanceof p)return new l.Inr(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.Credential (line 111, column 1 - line 111, column 44): "+[e.constructor.name])}},y={to:function(e){if(e instanceof l.Inl)return new d(e.value0);if(e instanceof l.Inr)return new v(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.Credential (line 59, column 1 - line 59, column 37): "+[e.constructor.name])},from:function(e){if(e instanceof d)return new l.Inl(e.value0);if(e instanceof v)return new l.Inr(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.Credential (line 59, column 1 - line 59, column 37): "+[e.constructor.name])}},w={show:f.genericShow(y)(f.genericShowSum(f.genericShowConstructor(f.genericShowArgsArgument(i.showPubKeyHash))({reflectSymbol:function(){return"PubKeyCredential"}}))(f.genericShowConstructor(f.genericShowArgsArgument(c.showValidatorHash))({reflectSymbol:function(){return"ScriptCredential"}})))},h={show:f.genericShow(g)(f.genericShowSum(f.genericShowConstructor(f.genericShowArgsArgument(w))({reflectSymbol:function(){return"StakingHash"}}))(f.genericShowConstructor(f.genericShowArgsArgument(s.showRecord()(s.showRecordFieldsCons({reflectSymbol:function(){return"certIx"}})(s.showRecordFieldsCons({reflectSymbol:function(){return"slot"}})(s.showRecordFieldsCons({reflectSymbol:function(){return"txIx"}})(s.showRecordFieldsNil)(r.showTransactionIndex))(r.showSlot))(r.showCertificateIndex))))({reflectSymbol:function(){return"StakingPtr"}})))},b={toData:o.genericToData(y)(o.toDataWithSchemaSum(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PubKeyCredential"}})(o.toDataArgsArgument(i.toDataPubKeyHash)({reflectSymbol:function(){return"PubKeyCredential"}}))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PubKeyCredential"}})(a.knownNatZ))(a.knownNatZ))(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"ScriptCredential"}})(o.toDataArgsArgument(c.toDataValidatorHash)({reflectSymbol:function(){return"ScriptCredential"}}))()()(u.getIndexWithLabelConsI(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"ScriptCredential"}})(a.knownNatS(a.knownNatZ)))()()({reflectSymbol:function(){return"ScriptCredential"}})(a.knownNatS(a.knownNatZ)))(a.knownNatS(a.knownNatZ))))},C={toData:o.genericToData(g)(o.toDataWithSchemaSum(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"StakingHash"}})(o.toDataArgsArgument(b)({reflectSymbol:function(){return"StakingHash"}}))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"StakingHash"}})(a.knownNatZ))(a.knownNatZ))(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"StakingPtr"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"StakingPtr"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(r.toDataCertificateIndex)(o.toDataArgsRLHelperCons(r.toDataSlot)(o.toDataArgsRLHelperCons(r.toDataTransactionIndex)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"txIx"}})({reflectSymbol:function(){return"StakingPtr"}})()()()()(a.knownNatS(a.knownNatZ)))()()()({reflectSymbol:function(){return"slot"}})({reflectSymbol:function(){return"StakingPtr"}})()()()()(a.knownNatZ))()()()({reflectSymbol:function(){return"certIx"}})({reflectSymbol:function(){return"StakingPtr"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatZ)))))()))()()(u.getIndexWithLabelConsI(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"StakingPtr"}})(a.knownNatS(a.knownNatZ)))()()({reflectSymbol:function(){return"StakingPtr"}})(a.knownNatS(a.knownNatZ)))(a.knownNatS(a.knownNatZ))))},A={fromData:t.genericFromData(y)(t.fromDataWithSchemaSum(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"PubKeyCredential"}})()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PubKeyCredential"}})(a.knownNatZ))(t.fromDataArgsArgument(i.fromDataPubKeyHash))(a.knownNatZ))(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"ScriptCredential"}})()()(u.getIndexWithLabelConsI(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"ScriptCredential"}})(a.knownNatS(a.knownNatZ)))()()({reflectSymbol:function(){return"ScriptCredential"}})(a.knownNatS(a.knownNatZ)))(t.fromDataArgsArgument(c.fromDataValidatorHash))(a.knownNatS(a.knownNatZ))))},S={fromData:t.genericFromData(g)(t.fromDataWithSchemaSum(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"StakingHash"}})()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"StakingHash"}})(a.knownNatZ))(t.fromDataArgsArgument(A))(a.knownNatZ))(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"StakingPtr"}})()()(u.getIndexWithLabelConsI(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"StakingPtr"}})(a.knownNatS(a.knownNatZ)))()()({reflectSymbol:function(){return"StakingPtr"}})(a.knownNatS(a.knownNatZ)))(t.fromDataArgsArgumentRecor(t.fromDataArgsRLCons(r.fromDataSlot)(t.fromDataArgsRLCons(r.fromDataTransactionIndex)(t.fromDataArgsRLCons(r.fromDataCertificateIndex)(t.fromDataArgsRLNilRow)()()({reflectSymbol:function(){return"certIx"}}))()()({reflectSymbol:function(){return"txIx"}}))()()({reflectSymbol:function(){return"slot"}}))()()())(a.knownNatS(a.knownNatZ))))};n.PubKeyCredential=d,n.ScriptCredential=v,n.StakingHash=m,n.StakingPtr=p,n.showCredential=w,n.toDataCredential=b,n.fromDataCredential=A,n.showStakingCredential=h,n.toDataStakingCredential=C,n.fromDataStakingCredential=S}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.Address"]=e["Ctl.Internal.Plutus.Types.Address"]||{};var n,t,r=e["Ctl.Internal.Plutus.Types.Address"],o=e["Control.Category"],a=e["Ctl.Internal.FromData"],u=e["Ctl.Internal.Plutus.Types.Credential"],i=e["Ctl.Internal.ToData"],c=e["Ctl.Internal.TypeLevel.Nat"],l=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],s=e["Data.Maybe"],f=e["Data.Newtype"],d=e["Data.Show"],v=e["Data.Show.Generic"],m={getAddress:o.identity(o.categoryFn)},p={getAddress:(n=f.unwrap(),function(e){return n(e).address})},g={to:function(e){return e},from:function(e){return e}},y={show:v.genericShow(g)(v.genericShowConstructor(v.genericShowArgsArgument(d.showRecord()(d.showRecordFieldsCons({reflectSymbol:function(){return"addressCredential"}})(d.showRecordFieldsCons({reflectSymbol:function(){return"addressStakingCredential"}})(d.showRecordFieldsNil)(s.showMaybe(u.showStakingCredential)))(u.showCredential))))({reflectSymbol:function(){return"Address"}}))},w={toData:i.genericToData(g)(i.toDataWithSchemaConstruct({reflectSymbol:function(){return"Address"}})(i.toDataArgsArgumentRecord(i.toDataArgsRecord({reflectSymbol:function(){return"Address"}})(i.toDataArgsRL(i.toDataArgsRLHelperCons(u.toDataCredential)(i.toDataArgsRLHelperCons(i.toDataMaybe(u.toDataStakingCredential))(i.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"addressStakingCredential"}})({reflectSymbol:function(){return"Address"}})()()()()(c.knownNatS(c.knownNatZ)))()()()({reflectSymbol:function(){return"addressCredential"}})({reflectSymbol:function(){return"Address"}})()()()()(c.knownNatZ)))()))()()(l.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"Address"}})(c.knownNatZ))(c.knownNatZ))},h={fromData:a.genericFromData(g)(a.fromDataWithSchemaConstru({reflectSymbol:function(){return"Address"}})()()(l.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"Address"}})(c.knownNatZ))(a.fromDataArgsArgumentRecor(a.fromDataArgsRLCons(u.fromDataCredential)(a.fromDataArgsRLCons(a.fromDataMaybe(u.fromDataStakingCredential))(a.fromDataArgsRLNilRow)()()({reflectSymbol:function(){return"addressStakingCredential"}}))()()({reflectSymbol:function(){return"addressCredential"}}))()()())(c.knownNatZ))},b=(t=f.unwrap(),function(e){return t(e).addressStakingCredential});r.AddressWithNetworkTag=function(e){return e},r.getAddress=function(e){return e.getAddress},r.toPubKeyHash=function(e){var n=f.unwrap()(e).addressCredential;return n instanceof u.PubKeyCredential?new s.Just(n.value0):s.Nothing.value},r.toStakingCredential=b,r.plutusAddressAddress=m,r.plutusAddressAddressWithN=p,r.showAddress=y,r.toDataAddress=w,r.fromDataAddress=h}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Conversion.Address"]=e["Ctl.Internal.Plutus.Conversion.Address"]||{};var n,t,r=e["Ctl.Internal.Plutus.Conversion.Address"],o=e["Control.Alt"],a=e["Control.Bind"],u=e["Ctl.Internal.Plutus.Types.Address"],i=e["Ctl.Internal.Plutus.Types.Credential"],c=e["Ctl.Internal.Serialization.Address"],l=e["Data.Function"],s=e["Data.Functor"],f=e["Data.Maybe"],d=e["Data.Newtype"],v=function(e){var n,t,r,v,m=c.withStakeCredential({onKeyHash:(t=d.wrap(),function(e){return i.PubKeyCredential.create(t(e))}),onScriptHash:(n=d.wrap(),function(e){return i.ScriptCredential.create(n(e))})}),p=c.addressNetworkId(e);return s.map(f.functorMaybe)((function(e){return u.AddressWithNetworkTag({address:e,networkId:p})}))(o.alt(f.altMaybe)(o.alt(f.altMaybe)((r=e,v=function(e){return function(n){return new f.Just(d.wrap()({addressCredential:e,addressStakingCredential:l.flip(c.withStakeCredential)(n)({onKeyHash:function(e){return new f.Just(new i.StakingHash(new i.PubKeyCredential(d.wrap()(e))))},onScriptHash:function(e){return new f.Just(new i.StakingHash(new i.ScriptCredential(d.wrap()(e))))}})}))}},a.bind(f.bindMaybe)(c.baseAddressFromAddress(r))((function(e){var n=c.baseAddressPaymentCred(e),t=c.baseAddressDelegationCred(e);return l.flip(c.withStakeCredential)(n)({onKeyHash:function(e){return v(new i.PubKeyCredential(d.wrap()(e)))(t)},onScriptHash:function(e){return v(new i.ScriptCredential(d.wrap()(e)))(t)}})}))))(function(e){return a.bind(f.bindMaybe)(c.pointerAddressFromAddress(e))((function(e){var n=c.pointerAddressStakePointer(e),t=c.pointerAddressPaymentCred(e);return new f.Just(d.wrap()({addressCredential:m(t),addressStakingCredential:new f.Just(new i.StakingPtr(n))}))}))}(e)))(function(e){return a.bind(f.bindMaybe)(c.enterpriseAddressFromAddress(e))((function(e){var n=c.enterpriseAddressPaymentCred(e);return new f.Just(d.wrap()({addressCredential:m(n),addressStakingCredential:f.Nothing.value}))}))}(e)))},m=(t=s.map(f.functorMaybe)((n=d.unwrap(),function(e){return n(e).address})),function(e){return t(v(e))}),p=function(e){return function(n){if(n.addressCredential instanceof i.PubKeyCredential&&n.addressStakingCredential instanceof f.Just&&n.addressStakingCredential.value0 instanceof i.StakingHash&&n.addressStakingCredential.value0.value0 instanceof i.PubKeyCredential)return c.baseAddressToAddress(c.paymentKeyHashStakeKeyHashAddress(e)(n.addressCredential.value0)(n.addressStakingCredential.value0.value0.value0));if(n.addressCredential instanceof i.ScriptCredential&&n.addressStakingCredential instanceof f.Just&&n.addressStakingCredential.value0 instanceof i.StakingHash&&n.addressStakingCredential.value0.value0 instanceof i.PubKeyCredential)return c.baseAddressToAddress(c.scriptHashStakeKeyHashAddress(e)(n.addressCredential.value0)(n.addressStakingCredential.value0.value0.value0));if(n.addressCredential instanceof i.PubKeyCredential&&n.addressStakingCredential instanceof f.Just&&n.addressStakingCredential.value0 instanceof i.StakingHash&&n.addressStakingCredential.value0.value0 instanceof i.ScriptCredential)return c.baseAddressToAddress(c.paymentKeyHashScriptHashAddress(e)(n.addressCredential.value0)(n.addressStakingCredential.value0.value0.value0));if(n.addressCredential instanceof i.ScriptCredential&&n.addressStakingCredential instanceof f.Just&&n.addressStakingCredential.value0 instanceof i.StakingHash&&n.addressStakingCredential.value0.value0 instanceof i.ScriptCredential)return c.baseAddressToAddress(c.scriptHashScriptHashAddress(e)(n.addressCredential.value0)(n.addressStakingCredential.value0.value0.value0));if(n.addressCredential instanceof i.PubKeyCredential&&n.addressStakingCredential instanceof f.Just&&n.addressStakingCredential.value0 instanceof i.StakingPtr)return c.pointerAddressToAddress(c.paymentKeyHashPointerAddress(e)(n.addressCredential.value0)(n.addressStakingCredential.value0.value0));if(n.addressCredential instanceof i.ScriptCredential&&n.addressStakingCredential instanceof f.Just&&n.addressStakingCredential.value0 instanceof i.StakingPtr)return c.pointerAddressToAddress(c.scriptHashPointerAddress(e)(n.addressCredential.value0)(n.addressStakingCredential.value0.value0));if(n.addressCredential instanceof i.PubKeyCredential&&n.addressStakingCredential instanceof f.Nothing)return c.enterpriseAddressToAddress(c.paymentKeyHashEnterpriseAddress(e)(n.addressCredential.value0));if(n.addressCredential instanceof i.ScriptCredential&&n.addressStakingCredential instanceof f.Nothing)return c.enterpriseAddressToAddress(c.scriptHashEnterpriseAddress(e)(n.addressCredential.value0));throw new Error("Failed pattern match at Ctl.Internal.Plutus.Conversion.Address (line 67, column 3 - line 110, column 53): "+[n.addressCredential.constructor.name,n.addressStakingCredential.constructor.name])}};r.fromPlutusAddress=p,r.fromPlutusAddressWithNetworkTag=function(e){return p(e.networkId)(e.address)},r.toPlutusAddress=m,r.toPlutusAddressWithNetworkTag=v}(c),function(e){"use strict";e["Ctl.Internal.NativeScripts"]=e["Ctl.Internal.NativeScripts"]||{};var n,t=e["Ctl.Internal.NativeScripts"],r=e["Control.Apply"],o=e["Ctl.Internal.Cardano.Types.NativeScript"],a=e["Ctl.Internal.Serialization.Hash"],u=e["Ctl.Internal.Serialization.NativeScript"],i=e["Data.Array"],c=e["Data.Boolean"],l=e["Data.Foldable"],s=e["Data.Function"],f=e["Data.Functor"],d=e["Data.List"],v=e["Data.List.Types"],m=e["Data.Maybe"],p=e["Data.Newtype"],g=e["Data.Ord"],y=e["Data.Semigroup"],w=e["Data.Set"],h=e["Data.Unfoldable"],b=(n=p.wrap(),function(e){return n(a.nativeScriptHash(u.convertNativeScript(e)))}),C=[w.empty];t.nativeScriptHash=b,t.getMaximumSigners=function(e){var n=function(t){if(t instanceof o.ScriptPubkey){if(w.member(a.ordEd25519KeyHash)(t.value0)(e))return C;if(c.otherwise)return[w.singleton(t.value0)]}if(t instanceof o.ScriptAll)return l.foldr(l.foldableArray)((u=a.ordEd25519KeyHash,function(e){return function(n){return r.apply(r.applyArray)(f.map(f.functorArray)(y.append(w.semigroupSet(u)))(e))(n)}}))(C)(f.map(f.functorArray)(n)(t.value0));var u,s,m,p,g,b;if(t instanceof o.ScriptAny)return l.foldr(l.foldableArray)(function(e){return function(n){return function(t){return i.nub(w.ordSet(e))(y.append(y.semigroupArray)(n)(t))}}}(a.ordEd25519KeyHash))(C)(f.map(f.functorArray)(n)(t.value0));if(t instanceof o.ScriptNOfK)return n(new o.ScriptAny(f.map(f.functorArray)(o.ScriptAll.create)((s=t.value0,m=f.map(f.functorArray)(d.toUnfoldable(h.unfoldableArray)),p=d.toUnfoldable(h.unfoldableArray),g=function(e){return function(n){var t=function(e){return function(n){if(n instanceof v.Nil)return new v.Cons(v.Nil.value,v.Nil.value);if(n instanceof v.Cons)return new v.Cons(d.take(e)(n),t(e)(n.value1));throw new Error("Failed pattern match at Ctl.Internal.NativeScripts (line 64, column 3 - line 64, column 46): "+[e.constructor.name,n.constructor.name])}};return d.take(1+(d.length(n)-e|0)|0)(t(e)(n))}}(s),b=d.fromFoldable(l.foldableArray),function(e){return m(p(g(b(e))))})(t.value1))));if(t instanceof o.TimelockStart)return C;if(t instanceof o.TimelockExpiry)return C;throw new Error("Failed pattern match at Ctl.Internal.NativeScripts (line 79, column 11 - line 90, column 39): "+[t.constructor.name])},t=m.fromMaybe(0),u=f.map(m.functorMaybe)(w.size),p=l.maximumBy(l.foldableArray)(s.on(g.compare(g.ordInt))(w.size));return function(e){return t(u(p(n(e))))}}}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.CurrencySymbol"]=e["Ctl.Internal.Plutus.Types.CurrencySymbol"]||{};var n,t=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],r=e["Control.Applicative"],o=e["Ctl.Internal.Serialization.Hash"],a=e["Ctl.Internal.ToData"],u=e["Ctl.Internal.Types.ByteArray"],i=e["Ctl.Internal.Types.Scripts"],c=e["Data.Boolean"],l=e["Data.Eq"],s=e["Data.Functor"],f=e["Data.Maybe"],d=e["Data.Monoid"],v=e["Data.Newtype"],m=e["Data.Show"],p=a.toDataByteArray,g={show:function(e){return"(CurrencySymbol "+m.show(u.showByteArray)(e)+")"}},y=u.eqByteArray,w=(n=f.fromJust(),function(e){return n(o.scriptHashFromBytes(e))}),h=d.mempty(u.monoidByteArray),b=function(e){if(l.eq(u.eqByteArray)(e)(d.mempty(u.monoidByteArray)))return r.pure(f.applicativeMaybe)(h);if(c.otherwise)return s.voidLeft(f.functorMaybe)(o.scriptHashFromBytes(e))(e);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.CurrencySymbol (line 94, column 1 - line 94, column 54): "+[e.constructor.name])};t.adaSymbol=h,t.currencyMPSHash=function(e){return i.MintingPolicyHash(w(e))},t.getCurrencySymbol=function(e){return e},t.mkCurrencySymbol=b,t.mpsSymbol=function(e){return b(v.unwrap()(o.scriptHashToBytes(e)))},t.eqCurrencySymbol=y,t.toDataCurrencySymbol=p,t.showCurrencySymbol=g}(c),function(e){"use strict";e["Ctl.Internal.Scripts"]=e["Ctl.Internal.Scripts"]||{};var n,t,r,o,a,u,i,c=e["Ctl.Internal.Scripts"],l=e["Ctl.Internal.Hashing"],s=e["Ctl.Internal.NativeScripts"],f=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],d=e["Ctl.Internal.Serialization.Address"],v=e["Ctl.Internal.Types.Scripts"],m=e["Data.Newtype"],p=function(e){return function(n){return d.enterpriseAddressToAddress(d.enterpriseAddress({network:e,paymentCred:d.scriptHashCredential(m.unwrap()(n))}))}},g=(n=m.wrap(),t=m.unwrap(),function(e){return n(l.plutusScriptHash(t(e)))}),y=(r=m.wrap(),o=m.unwrap(),function(e){return r(l.plutusScriptHash(o(e)))}),w=(a=m.wrap(),u=m.unwrap(),i=m.unwrap(),function(e){return a(u(s.nativeScriptHash(i(e))))}),h=function(e){if(e instanceof v.PlutusMintingPolicy)return m.wrap()(l.plutusScriptHash(e.value0));if(e instanceof v.NativeMintingPolicy)return m.wrap()(m.unwrap()(s.nativeScriptHash(e.value0)));throw new Error("Failed pattern match at Ctl.Internal.Scripts (line 61, column 21 - line 63, column 74): "+[e.constructor.name])};c.mintingPolicyHash=h,c.nativeScriptStakeValidatorHash=w,c.plutusScriptStakeValidatorHash=y,c.scriptCurrencySymbol=function(e){return f.mpsSymbol(h(e))},c.typedValidatorEnterpriseAddress=function(e){return function(n){return p(e)(n.validatorHash)}},c.validatorHash=g,c.validatorHashBaseAddress=function(e){var n=d.scriptAddress(e),t=m.unwrap();return function(e){return d.baseAddressToAddress(n(t(e)))}},c.validatorHashEnterpriseAddress=p}(c),function(e){"use strict";e["Contract.Address"]=e["Contract.Address"]||{};var n=e["Contract.Address"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Reader.Class"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Contract.Wallet"],i=e["Ctl.Internal.Helpers"],c=e["Ctl.Internal.Plutus.Conversion.Address"],l=e["Ctl.Internal.Scripts"],s=e["Ctl.Internal.Serialization.Address"],f=e["Data.Traversable"],d=e["Effect.Exception"],v=u.ownStakePubKeysHashes,m=u.ownPaymentPubKeyHashes,p=r.bind(a.bindContract)(u.getWalletAddresses)((function(e){return f.traverse(f.traversableArray)(a.applicativeContract)((n=i.liftM(a.monadErrorErrorContract)(d.error("getWalletAddressesWithNetworkTag: failed to deserialize `Address`")),function(e){return n(c.toPlutusAddressWithNetworkTag(e))}))(e);var n})),g=(r.bind(a.bindContract)(u.getWalletAddresses)((function(e){return f.traverse(f.traversableArray)(a.applicativeContract)((n=i.liftM(a.monadErrorErrorContract)(d.error("getWalletAddresses: failed to deserialize `Address`")),function(e){return n(c.toPlutusAddress(e))}))(e);var n})),o.asks(a.monadAskContractEnvContra)((function(e){return e.networkId}))),y=function(e){return s.addressBech32(c.fromPlutusAddressWithNetworkTag(e))};n.getNetworkId=g,n.addressWithNetworkTagToBech32=y,n.addressToBech32=function(e){return r.bind(a.bindContract)(g)((function(n){return t.pure(a.applicativeContract)(y({address:e,networkId:n}))}))},n.getWalletAddressesWithNetworkTag=p,n.ownPaymentPubKeysHashes=m,n.ownStakePubKeysHashes=v,n.validatorHashBaseAddress=function(e){var n=l.validatorHashBaseAddress(e);return function(e){return c.toPlutusAddress(n(e))}}}(c),function(e){"use strict";e["Ctl.Internal.Contract.Hooks"]=e["Ctl.Internal.Contract.Hooks"]||{};var n=e["Ctl.Internal.Contract.Hooks"],t=e["Data.Maybe"],r={beforeSign:t.Nothing.value,beforeInit:t.Nothing.value,onSuccess:t.Nothing.value,onError:t.Nothing.value,onSubmit:t.Nothing.value};n.emptyHooks=r}(c),function(e){"use strict";e["Contract.Config"]=e["Contract.Config"]||{};var n=e["Contract.Config"],t=e["Ctl.Internal.Contract.Hooks"],r=e["Ctl.Internal.Contract.QueryBackend"],o=e["Ctl.Internal.Serialization.Address"],a=e["Ctl.Internal.ServerConfig"],u=e["Data.Log.Level"],i=e["Data.Maybe"],c={backendParams:r.mkCtlBackendParams({ogmiosConfig:a.defaultOgmiosWsConfig,kupoConfig:a.defaultKupoServerConfig}),networkId:o.TestnetId.value,walletSpec:i.Nothing.value,logLevel:u.Trace.value,customLogger:i.Nothing.value,suppressLogs:!1,hooks:t.emptyHooks};n.testnetConfig=c}(c),function(e){"use strict";e["Contract.Monad"]=e["Contract.Monad"]||{};var n=e["Contract.Monad"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Ctl.Internal.Contract.Monad"],a=e["Data.Either"],u=e["Data.Maybe"],i=e["Data.Show"],c=e["Effect.Class"],l=e["Effect.Exception"],s=function(e){return u.maybe(c.liftEffect(o.monadEffectContract)(l.throw(e)))(t.pure(o.applicativeContract))},f=function(e){return a.either(function(e){var n=c.liftEffect(o.monadEffectContract),t=i.show(e);return function(e){return n(l.throw(t(e)))}}(e))(t.pure(o.applicativeContract))};n.liftContractE=f,n.liftContractM=s,n.liftedE=function(e){return r.bindFlipped(o.bindContract)(f(e))},n.liftedM=function(e){return r.bindFlipped(o.bindContract)(s(e))}}(c),function(e){"use strict";e["Ctl.Internal.Address"]=e["Ctl.Internal.Address"]||{};var n,t,r,o=e["Ctl.Internal.Address"],a=e["Control.Alt"],u=e["Control.Applicative"],i=e["Control.Bind"],c=e["Ctl.Internal.Serialization.Address"],l=e["Ctl.Internal.Types.Scripts"],s=e["Data.Functor"],f=e["Data.Maybe"],d=i.composeKleisliFlipped(f.bindMaybe)(c.stakeCredentialToScriptHash)(i.composeKleisliFlipped(f.bindMaybe)((n=u.pure(f.applicativeMaybe),function(e){return n(c.enterpriseAddressPaymentCred(e))}))(c.enterpriseAddressFromAddress)),v=i.composeKleisliFlipped(f.bindMaybe)(c.stakeCredentialToScriptHash)(i.composeKleisliFlipped(f.bindMaybe)((t=u.pure(f.applicativeMaybe),function(e){return t(c.baseAddressPaymentCred(e))}))(c.baseAddressFromAddress)),m=c.addressBech32,p=(r=s.map(f.functorMaybe)(l.ValidatorHash),function(e){return r((n=e,a.alt(f.altMaybe)(v(n))(d(n))));var n});o.addressToOgmiosAddress=m,o.addressPaymentValidatorHash=p}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.AssocMap"]=e["Ctl.Internal.Plutus.Types.AssocMap"]||{};var n=e["Ctl.Internal.Plutus.Types.AssocMap"],t=e["Data.Array"],r=e["Data.Eq"],o=e["Data.Foldable"],a=e["Data.Functor"],u=e["Data.Maybe"],i=e["Data.Semigroup"],c=e["Data.Show"],l=e["Data.Show.Generic"],s=e["Data.These"],f=e["Data.Tuple"],d={to:function(e){return e},from:function(e){return e}},v={map:function(e){return function(n){return a.map(a.functorArray)(a.map(f.functorTuple)(e))(n)}}},m={foldMap:function(e){return function(n){return function(t){return o.foldMap(o.foldableArray)(e)(o.foldMap(o.foldableTuple)(e)(n))(t)}}},foldr:function(e){return o.foldrDefault(m)(e)},foldl:function(e){return o.foldlDefault(m)(e)}},p=function(e){return function(n){return function(t){return o.lookup(o.foldableArray)(e)(n)(t)}}};n.lookup=p,n.singleton=function(e){return function(n){return t.singleton(new f.Tuple(e,n))}},n.union=function(e){return function(n){return function(o){var c=t.filter((function(o){return!t.any((function(n){return r.eq(e)(n.value0)(o.value0)}))(n)}))(o),l=a.map(a.functorArray)(a.map(f.functorTuple)(s.That.create))(c),d=a.map(a.functorArray)((function(n){return new f.Tuple(n.value0,(t=n.value1,function(e){if(e instanceof u.Nothing)return new s.This(t);if(e instanceof u.Just)return new s.Both(t,e.value0);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.AssocMap (line 155, column 11 - line 157, column 25): "+[e.constructor.name])})(p(e)(n.value0)(o)));var t}))(n);return i.append(i.semigroupArray)(d)(l)}}},n.showMap=function(e){return function(n){return{show:l.genericShow(d)(l.genericShowConstructor(l.genericShowArgsArgument(c.showArray(f.showTuple(e)(n))))({reflectSymbol:function(){return"Map"}}))}}},n.functorMap=v,n.foldableMap=m}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.Value"]=e["Ctl.Internal.Plutus.Types.Value"]||{};var n,t,r,o=e["Ctl.Internal.Plutus.Types.Value"],a=e["Control.Applicative"],u=e["Control.Apply"],i=e["Control.Bind"],c=e["Control.Category"],l=e["Ctl.Internal.Plutus.Types.AssocMap"],s=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],f=e["Ctl.Internal.Types.ByteArray"],d=e["Ctl.Internal.Types.TokenName"],v=e["Data.Array"],m=e["Data.BigInt"],p=e["Data.Boolean"],g=e["Data.Eq"],y=e["Data.Foldable"],w=e["Data.Function"],h=e["Data.Functor"],b=e["Data.HeytingAlgebra"],C=e["Data.Maybe"],A=e["Data.Monoid"],S=e["Data.Semiring"],I=e["Data.Show"],T=e["Data.These"],D=e["Data.Tuple"],F={show:function(e){return"(PlutusValue "+I.show(l.showMap(s.showCurrencySymbol)(l.showMap(d.showTokenName)(m.showBigInt)))(e)+")"}},E=function(e){return function(n){return function(t){return C.fromMaybe(S.zero(m.semiringBigInt))(i.bind(C.bindMaybe)(l.lookup(s.eqCurrencySymbol)(n)(e))(l.lookup(d.eqTokenName)(t)))}}},x=function(e){return function(n){return h.map(l.functorMap)(T.these(h.map(l.functorMap)(T.This.create))(h.map(l.functorMap)(T.That.create))(l.union(d.eqTokenName)))(l.union(s.eqCurrencySymbol)(e)(n))}},M={append:(n=S.add(m.semiringBigInt),function(e){var t=h.map(l.functorMap)(h.map(l.functorMap)(T.these(c.identity(c.categoryFn))(c.identity(c.categoryFn))(n))),r=x(e);return function(e){return t(r(e))}})},R={mempty:[],Semigroup0:function(){return M}},P=function(e){return function(n){var t=l.singleton(e),r=l.singleton(n);return function(e){return t(r(e))}}},B=P(s.adaSymbol)(d.adaToken),k=(r=v.filter((t=g.notEq(s.eqCurrencySymbol)(s.adaSymbol),function(e){return t(D.fst(e))})),function(e){return r((n=e,w.flip(v.concatMap)(n)((function(e){return h.mapFlipped(h.functorArray)(e.value1)((function(n){return new D.Tuple(e.value0,new D.Tuple(n.value0,n.value1))}))}))));var n}),N={eq:function(e){return function(n){return function(t){return function(e){return function(n){return function(t){return y.all(l.foldableMap)(b.heytingAlgebraBoolean)(y.all(l.foldableMap)(b.heytingAlgebraBoolean)(e))(x(n)(t))}}}(T.these(w.flip(e)(S.zero(m.semiringBigInt)))(e(S.zero(m.semiringBigInt)))(e))(n)(t)}}}(g.eq(m.eqBigInt))};o.flattenNonAdaAssets=k,o.getValue=function(e){return e},o.lovelaceValueOf=B,o.singleton=P,o["singleton'"]=function(e){return function(n){return function(t){if(g.eq(f.eqByteArray)(e)(A.mempty(f.monoidByteArray))&&g.notEq(f.eqByteArray)(n)(A.mempty(f.monoidByteArray)))return C.Nothing.value;if(p.otherwise)return u.lift3(C.applyMaybe)(P)(s.mkCurrencySymbol(e))(d.mkTokenName(n))(a.pure(C.applicativeMaybe)(t));throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.Value (line 181, column 1 - line 181, column 62): "+[e.constructor.name,n.constructor.name,t.constructor.name])}}},o.valueOf=E,o["valueToCoin'"]=function(e){return E(e)(s.adaSymbol)(d.adaToken)},o.eqValue=N,o.showValue=F,o.semigroupValue=M,o.monoidValue=R}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Conversion.Value"]=e["Ctl.Internal.Plutus.Conversion.Value"]||{};var n=e["Ctl.Internal.Plutus.Conversion.Value"],t=e["Control.Bind"],r=e["Ctl.Internal.Cardano.Types.Value"],o=e["Ctl.Internal.Plutus.Types.AssocMap"],a=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],u=e["Ctl.Internal.Plutus.Types.Value"],i=e["Ctl.Internal.Types.TokenName"],c=e["Data.Array"],l=e["Data.BigInt"],s=e["Data.Boolean"],f=e["Data.Eq"],d=e["Data.Foldable"],v=e["Data.Function"],m=e["Data.Functor"],p=e["Data.List.Types"],g=e["Data.Map.Internal"],y=e["Data.Maybe"],w=e["Data.Monoid"],h=e["Data.Newtype"],b=e["Data.Semigroup"],C=e["Data.Semiring"],A=e["Data.Traversable"],S=e["Data.Tuple"];n.fromPlutusValue=function(e){var n,s={adaTokenMap:(n=c.partition((function(e){return f.eq(a.eqCurrencySymbol)(e.value0)(a.adaSymbol)}))(h.unwrap()(u.getValue(e)))).yes,nonAdaTokenMap:n.no},p=y.fromJust()(r.mkNonAdaAssetsFromTokenMap(A.traversableArray)(m.mapFlipped(m.functorArray)(s.nonAdaTokenMap)((function(e){return new S.Tuple(a.getCurrencySymbol(e.value0),g.fromFoldable(i.ordTokenName)(d.foldableArray)(h.unwrap()(e.value1)))})))),I=v.flip(r.mkValue)(w.mempty(r.monoidNonAdaAsset))(h.wrap()(y.fromMaybe(C.zero(l.semiringBigInt))(t.bind(y.bindMaybe)(m.map(y.functorMaybe)(S.snd)(c.head(s.adaTokenMap)))((function(e){return o.lookup(i.eqTokenName)(i.adaToken)(e)})))));return b.append(r.semigroupValue)(I)(r.mkValue(w.mempty(r.monoidCoin))(p))},n.toPlutusValue=function(e){var n=m.mapFlipped(p.functorList)(r.flattenNonAdaValue(e.value1))((function(e){return y.fromJust()(u["singleton'"](r.getCurrencySymbol(e.value0))(i.getTokenName(e.value1.value0))(e.value1.value1))})),t=function(){if(f.eq(l.eqBigInt)(e.value0)(C.zero(l.semiringBigInt)))return w.mempty(u.monoidValue);if(s.otherwise)return u.lovelaceValueOf(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Conversion.Value (line 72, column 3 - line 72, column 27): "+[])}();return b.append(u.semigroupValue)(t)(d.fold(p.foldableList)(u.monoidValue)(n))}}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Conversion"]=e["Ctl.Internal.Plutus.Conversion"]||{};var n=e["Ctl.Internal.Plutus.Conversion"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Ctl.Internal.Hashing"],a=e["Ctl.Internal.Plutus.Conversion.Address"],u=e["Ctl.Internal.Plutus.Conversion.Value"],i=e["Data.Functor"],c=e["Data.Map.Internal"],l=e["Data.Maybe"],s=e["Data.Newtype"],f=e["Data.Traversable"].traverse(c.traversableMap)(l.applicativeMaybe)((function(e){return i.mapFlipped(l.functorMaybe)((c=e,f=s.unwrap()(c),r.bind(l.bindMaybe)(a.toPlutusAddress(f.address))((function(e){var n=i.map(l.functorMaybe)(o.scriptRefHash)(f.scriptRef),r=u.toPlutusValue(f.amount);return t.pure(l.applicativeMaybe)(s.wrap()({address:e,amount:r,datum:f.datum,referenceScript:n}))}))))((n=s.wrap(),function(t){return n({output:t,scriptRef:s.unwrap()(e).scriptRef})}));var n,c,f})),d=function(e){return function(n){return function(e){return function(n){return function(t){var r=s.unwrap()(t);return s.wrap()({address:a.fromPlutusAddress(e)(r.address),amount:u.fromPlutusValue(r.amount),datum:r.datum,scriptRef:n})}}}(e)(n.scriptRef)(n.output)}};n.fromPlutusTxOutputWithRefScript=d,n.fromPlutusUtxoMap=function(e){return i.map(c.functorMap)(d(e))},n.toPlutusUtxoMap=f}(c),function(e){"use strict";e["Ctl.Internal.Transaction"]=e["Ctl.Internal.Transaction"]||{};var n=e["Ctl.Internal.Transaction"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Except.Trans"],a=e["Ctl.Internal.Cardano.Types.Transaction"],u=e["Ctl.Internal.Deserialization.WitnessSet"],i=e["Ctl.Internal.Helpers"],c=e["Ctl.Internal.Serialization"],l=e["Ctl.Internal.Serialization.PlutusData"],s=e["Ctl.Internal.Serialization.PlutusScript"],f=e["Ctl.Internal.Serialization.ToBytes"],d=e["Ctl.Internal.Serialization.WitnessSet"],v=e["Data.Array"],m=e["Data.Boolean"],p=e["Data.Either"],g=e["Data.Foldable"],y=e["Data.Functor"],w=e["Data.Generic.Rep"],h=e["Data.Maybe"],b=e["Data.Monoid"],C=e["Data.Newtype"],A=e["Data.Semigroup"],S=e["Data.Show.Generic"],I=e["Data.Traversable"],T=e.Effect,D=e["Effect.Class"],F=function(){function e(){}return e.value=new e,e}(),E=function(){function e(){}return e.value=new e,e}(),x={to:function(e){if(e instanceof w.Inl)return F.value;if(e instanceof w.Inr)return E.value;throw new Error("Failed pattern match at Ctl.Internal.Transaction (line 46, column 1 - line 46, column 40): "+[e.constructor.name])},from:function(e){if(e instanceof F)return new w.Inl(w.NoArguments.value);if(e instanceof E)return new w.Inr(w.NoArguments.value);throw new Error("Failed pattern match at Ctl.Internal.Transaction (line 46, column 1 - line 46, column 40): "+[e.constructor.name])}},M={show:S.genericShow(x)(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsNoArguments)({reflectSymbol:function(){return"ConvertWitnessesError"}}))(S.genericShowConstructor(S.genericShowArgsNoArguments)({reflectSymbol:function(){return"ConvertDatumError"}})))},R=function(e){return function(n){return i.liftEither(o.monadErrorExceptT(T.monadEffect))(new p.Right(C.over()()(a.Transaction)((function(t){return{witnessSet:A.append(a.semigroupTransactionWitne)(e.witnessSet)(n),auxiliaryData:t.auxiliaryData,body:t.body,isValid:t.isValid}}))(e)))}},P=function(e){return function(n){return r.bind(o.bindExceptT(T.monadEffect))(D.liftEffect(o.monadEffectExceptT(D.monadEffectEffect))(d.convertWitnessSet(e)))((function(e){return r.discard(r.discardUnit)(o.bindExceptT(T.monadEffect))(D.liftEffect(o.monadEffectExceptT(D.monadEffectEffect))(n(e)))((function(){return i.liftEither(o.monadErrorExceptT(T.monadEffect))(p.note(F.value)(u.convertWitnessSet(e)))}))}))}};n.attachDatum=function(e){var n,t=(n=v.singleton(e),function(e){if(0===n.length)return i.liftEither(o.monadErrorExceptT(T.monadEffect))(new p.Right(e));var t,a=y.map(y.functorArray)((t=C.unwrap(),function(e){return l.convertPlutusData(t(e))}))(n);return r.bindFlipped(o.bindExceptT(T.monadEffect))(R(e))(P(e.witnessSet)(d.setPlutusData(a)))});return function(e){return o.runExceptT(t(e))}},n.attachRedeemer=function(e){var n,t=(n=v.singleton(e),function(e){return r.bind(o.bindExceptT(T.monadEffect))(D.liftEffect(o.monadEffectExceptT(D.monadEffectEffect))(I.traverse(I.traversableArray)(T.applicativeEffect)(d.convertRedeemer)(n)))((function(n){return r.bindFlipped(o.bindExceptT(T.monadEffect))(R(e))(P(e.witnessSet)(d.setRedeemers(n)))}))});return function(e){return o.runExceptT(t(e))}},n.attachPlutusScript=function(e){var n=function(e){return function(n){var t=y.map(y.functorArray)(s.convertPlutusScript)(e);return r.bindFlipped(o.bindExceptT(T.monadEffect))(R(n))(P(n.witnessSet)(d.setPlutusScripts(t)))}}(v.singleton(e));return function(e){return o.runExceptT(n(e))}},n.attachNativeScript=function(e){return function(n){return o.runExceptT(R(n)(C.over()()(a.TransactionWitnessSet)((function(n){return{nativeScripts:new h.Just([e]),bootstraps:n.bootstraps,plutusData:n.plutusData,plutusScripts:n.plutusScripts,redeemers:n.redeemers,vkeys:n.vkeys}}))(b.mempty(a.monoidTransactionWitnessS))))}},n.setScriptDataHash=function(e){return function(n){return function(r){return function(o){return g.null(g.foldableMaybe)(C.unwrap()(o.witnessSet).plutusScripts)&&g.null(g.foldableArray)(n)&&g.null(g.foldableArray)(r)?t.pure(T.applicativeEffect)(o):function(t){if(m.otherwise)return function(){var t,u,i=y.map(T.functorEffect)((t=C.unwrap(),u=f.toBytes(),function(e){return a.ScriptDataHash(t(u(e)))}))(c.hashScriptData(e)(n)(y.map(y.functorArray)(C.unwrap())(r)))();return C.over()()(a.Transaction)((function(e){return{body:C.over()()(a.TxBody)((function(e){return{scriptDataHash:new h.Just(i),auxiliaryDataHash:e.auxiliaryDataHash,certs:e.certs,collateral:e.collateral,collateralReturn:e.collateralReturn,fee:e.fee,inputs:e.inputs,mint:e.mint,networkId:e.networkId,outputs:e.outputs,referenceInputs:e.referenceInputs,requiredSigners:e.requiredSigners,totalCollateral:e.totalCollateral,ttl:e.ttl,update:e.update,validityStartInterval:e.validityStartInterval,withdrawals:e.withdrawals}}))(o.body),auxiliaryData:e.auxiliaryData,isValid:e.isValid,witnessSet:e.witnessSet}}))(o)};throw new Error("Failed pattern match at Ctl.Internal.Transaction (line 54, column 1 - line 59, column 24): "+[e.constructor.name,n.constructor.name,r.constructor.name,o.constructor.name])}()}}}},n.showModifyTxError=M}(c),function(e){"use strict";e["Ctl.Internal.Types.Interval"]=e["Ctl.Internal.Types.Interval"]||{};var n=e["Ctl.Internal.Types.Interval"],t=e["Control.Applicative"],r=e["Control.Apply"],o=e["Control.Bind"],a=e["Control.Monad.Error.Class"],u=e["Control.Monad.Except.Trans"],i=e["Ctl.Internal.FromData"],c=e["Ctl.Internal.Helpers"],l=e["Ctl.Internal.QueryM.Ogmios"],s=e["Ctl.Internal.Serialization.Address"],f=e["Ctl.Internal.ToData"],d=e["Ctl.Internal.Types.BigNum"],v=e["Ctl.Internal.Types.SystemStart"],m=e["Data.Array"],p=e["Data.BigInt"],g=e["Data.Either"],y=e["Data.Eq"],w=e["Data.Functor"],h=e["Data.Generic.Rep"],b=e["Data.Maybe"],C=e["Data.Newtype"],A=e["Data.Ord"],S=e["Data.Ring"],I=e["Data.Semiring"],T=e["Data.Show"],D=e["Data.Show.Generic"],F=e["Data.Tuple"],E=e.Effect,x=e.Math,M=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),R=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),P=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),B=function(){function e(){}return e.value=new e,e}(),k=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),N=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),L=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),_=function(){function e(){}return e.value=new e,e}(),U=function(){function e(){}return e.value=new e,e}(),H=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),q=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),O=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),W=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),V=function(){function e(){}return e.value=new e,e}(),K=function(){function e(){}return e.value=new e,e}(),z=f.toDataBigInt,J={show:function(e){return c.showWithParens(p.showBigInt)("POSIXTime")(e)}},j={show:function(e){return c.showWithParens(p.showBigInt)("ModTime")(e)}},Q={show:function(e){return c.showWithParens(p.showBigInt)("AbsTime")(e)}},G=p.semiringBigInt,Z=p.ordBigInt,X={to:function(e){if(e instanceof h.Inl)return new H(e.value0);if(e instanceof h.Inr&&e.value0 instanceof h.Inl)return new q(e.value0.value0);if(e instanceof h.Inr&&e.value0 instanceof h.Inr&&e.value0.value0 instanceof h.Inl)return new O(e.value0.value0.value0);if(e instanceof h.Inr&&e.value0 instanceof h.Inr&&e.value0.value0 instanceof h.Inr&&e.value0.value0.value0 instanceof h.Inl)return new W(e.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value1);if(e instanceof h.Inr&&e.value0 instanceof h.Inr&&e.value0.value0 instanceof h.Inr&&e.value0.value0.value0 instanceof h.Inr&&e.value0.value0.value0.value0 instanceof h.Inl)return V.value;if(e instanceof h.Inr&&e.value0 instanceof h.Inr&&e.value0.value0 instanceof h.Inr&&e.value0.value0.value0 instanceof h.Inr&&e.value0.value0.value0.value0 instanceof h.Inr)return K.value;throw new Error("Failed pattern match at Ctl.Internal.Types.Interval (line 859, column 1 - line 859, column 47): "+[e.constructor.name])},from:function(e){if(e instanceof H)return new h.Inl(e.value0);if(e instanceof q)return new h.Inr(new h.Inl(e.value0));if(e instanceof O)return new h.Inr(new h.Inr(new h.Inl(e.value0)));if(e instanceof W)return new h.Inr(new h.Inr(new h.Inr(new h.Inl(new h.Product(e.value0,e.value1)))));if(e instanceof V)return new h.Inr(new h.Inr(new h.Inr(new h.Inr(new h.Inl(h.NoArguments.value)))));if(e instanceof K)return new h.Inr(new h.Inr(new h.Inr(new h.Inr(new h.Inr(h.NoArguments.value)))));throw new Error("Failed pattern match at Ctl.Internal.Types.Interval (line 859, column 1 - line 859, column 47): "+[e.constructor.name])}},Y={show:D.genericShow(X)(D.genericShowSum(D.genericShowConstructor(D.genericShowArgsArgument(Q))({reflectSymbol:function(){return"CannotFindTimeInEraSummaries"}}))(D.genericShowSum(D.genericShowConstructor(D.genericShowArgsArgument(J))({reflectSymbol:function(){return"PosixTimeBeforeSystemStart"}}))(D.genericShowSum(D.genericShowConstructor(D.genericShowArgsArgument(Q))({reflectSymbol:function(){return"StartTimeGreaterThanTime"}}))(D.genericShowSum(D.genericShowConstructor(D.genericShowArgsProduct(D.genericShowArgsArgument(s.showSlot))(D.genericShowArgsArgument(j)))({reflectSymbol:function(){return"EndSlotLessThanSlotOrModNonZero"}}))(D.genericShowSum(D.genericShowConstructor(D.genericShowArgsNoArguments)({reflectSymbol:function(){return"CannotGetBigIntFromNumber'"}}))(D.genericShowConstructor(D.genericShowArgsNoArguments)({reflectSymbol:function(){return"CannotGetBigNumFromBigInt'"}})))))))},$={map:function(e){return function(n){if(n instanceof k)return new k(e(n.value0),e(n.value1));if(n instanceof N)return new N(e(n.value0));if(n instanceof L)return new L(e(n.value0));if(n instanceof _)return _.value;if(n instanceof U)return U.value;throw new Error("Failed pattern match at Ctl.Internal.Types.Interval (line 262, column 1 - line 262, column 33): "+[n.constructor.name])}}},ee=i.fromDataBigInt,ne=function(e){return function(n){if(n instanceof k)return r.apply(e.Apply0())(w.map(e.Apply0().Functor0())(k.create)(n.value0))(n.value1);if(n instanceof N)return w.map(e.Apply0().Functor0())(N.create)(n.value0);if(n instanceof L)return w.map(e.Apply0().Functor0())(L.create)(n.value0);if(n instanceof U)return t.pure(e)(U.value);if(n instanceof _)return t.pure(e)(_.value);throw new Error("Failed pattern match at Ctl.Internal.Types.Interval (line 1043, column 1 - line 1047, column 20): "+[n.constructor.name])}},te=function(e){return function(n){return function(t){return A.lessThanOrEq(e)(n)(t)?new k(n,t):U.value}}},re=C.wrap()(d.maxValue),oe=function(e){if(e instanceof k)return{validityStartInterval:t.pure(b.applicativeMaybe)(e.value0),timeToLive:w.map(b.functorMaybe)(C.wrap())(d.add(d.one)(C.unwrap()(e.value1)))};if(e instanceof N)return{validityStartInterval:b.Nothing.value,timeToLive:w.map(b.functorMaybe)(C.wrap())(d.add(d.one)(C.unwrap()(e.value0)))};if(e instanceof L)return{validityStartInterval:t.pure(b.applicativeMaybe)(e.value0),timeToLive:b.Nothing.value};if(e instanceof _)return{validityStartInterval:b.Nothing.value,timeToLive:b.Nothing.value};if(e instanceof U)return{validityStartInterval:t.pure(b.applicativeMaybe)(re),timeToLive:t.pure(b.applicativeMaybe)(C.wrap()(d.zero))};throw new Error("Failed pattern match at Ctl.Internal.Types.Interval (line 1089, column 1 - line 1091, column 29): "+[e.constructor.name])},ae=function(e){return C.unwrap()(C.unwrap()(e.parameters).slotLength)};n.always=function(e){return _.value},n.from=function(e){return function(e){return new L(e)}},n.intersection=function(e){return function(n){return function(t){for(var r,o,a,u,i=e,c=n,l=!1;!l;)o=i,u=t,r=(a=c)instanceof k&&u instanceof k?(l=!0,te(o)(A.max(o)(a.value0)(u.value0))(A.min(o)(a.value1)(u.value1))):a instanceof k&&u instanceof N?(l=!0,te(o)(a.value0)(A.min(o)(a.value1)(u.value0))):a instanceof k&&u instanceof L?(l=!0,te(o)(A.max(o)(a.value0)(u.value0))(a.value1)):a instanceof N&&u instanceof N?(l=!0,new N(A.min(o)(a.value0)(u.value0))):a instanceof N&&u instanceof L?(l=!0,te(o)(u.value0)(a.value0)):a instanceof L&&u instanceof L?(l=!0,new L(A.max(o)(a.value0)(u.value0))):a instanceof _?(l=!0,u):a instanceof U?(l=!0,U.value):(i=o,c=u,void(t=a));return r}}},n.isEmpty=function(e){return function(n){return n instanceof k?A.lessThan(e)(n.value1)(n.value0):n instanceof U}},n.posixTimeRangeToTransactionValidity=function(e){return function(n){var i,s=w.map(E.functorEffect)(w.map(g.functorEither)(oe)),f=(i=e,function(e){return function(n){return w.map(E.functorEffect)(ne(g.applicativeEither))(ne(E.applicativeEffect)(w.map($)(function(e){return function(n){return function(i){return u.runExceptT(o.bind(u.bindExceptT(E.monadEffect))(c.liftM(u.monadErrorExceptT(E.monadEffect))(V.value)(v.sysStartUnixTime(n)))((function(n){return o.discard(o.discardUnit)(u.bindExceptT(E.monadEffect))(t.unless(u.applicativeExceptT(E.monadEffect))(A.lessThanOrEq(p.ordBigInt)(n)(i))(a.throwError(u.monadThrowExceptT(E.monadEffect))(new q(i))))((function(){var s=C.wrap()(S.sub(p.ringBigInt)(i)(n));return o.bind(u.bindExceptT(E.monadEffect))(c.liftEither(u.monadErrorExceptT(E.monadEffect))(function(e){return function(n){return g.note(new H(n))(m.find((function(e){var t,r,o,a,u=p.toNumber(n);return C.unwrap()(C.unwrap()(e.start).time)*l.slotLengthFactor<=u&&b.maybe(!0)((t=A.lessThan(A.ordNumber)(u),r=I.mul(I.semiringNumber)(l.slotLengthFactor),o=C.unwrap(),a=C.unwrap(),function(e){return t(r(o(a(e).time)))}))(e.end)}))(e))}}(e)(s)))((function(e){return o.bind(u.bindExceptT(E.monadEffect))(c.liftEither(u.monadErrorExceptT(E.monadEffect))(function(e){return function(n){var r=C.unwrap()(C.unwrap()(e.start).time)*l.slotLengthFactor;return o.discard(o.discardUnit)(g.bindEither)(t.unless(g.applicativeEither)(r<=p.toNumber(n))(a.throwError(a.monadThrowEither)(new O(n))))((function(){var e=p.toNumber(n)-r;return w.map(g.functorEither)(C.wrap())(g.note(V.value)(p.fromNumber(x.trunc(e))))}))}}(e)(s)))((function(n){return o.bind(u.bindExceptT(E.monadEffect))(c.liftM(u.monadErrorExceptT(E.monadEffect))(V.value)((i=e,function(e){var n=ae(i),t=w.map(b.functorMaybe)(C.wrap())(p.fromNumber(x.trunc(p.toNumber(e)/n))),o=w.map(b.functorMaybe)(C.wrap())(p.fromNumber(x.remainder(p.toNumber(e))(n)));return r.apply(b.applyMaybe)(w.map(b.functorMaybe)(F.Tuple.create)(t))(o)})(n)))((function(n){return c.liftEither(u.monadErrorExceptT(E.monadEffect))(function(e){return function(n){var r,u,i=d.toBigInt(C.unwrap()(C.unwrap()(e.start).slot)),l=I.add(p.semiringBigInt)(i)(n.value0),s=b.maybe(I.add(p.semiringBigInt)(l)(I.one(p.semiringBigInt)))((r=C.unwrap(),u=C.unwrap(),function(e){return d.toBigInt(r(u(e).slot))}))(e.end);return o.bind(g.bindEither)(c.liftM(a.monadErrorEither)(K.value)(d.fromBigInt(l)))((function(e){return o.discard(o.discardUnit)(g.bindEither)(t.unless(g.applicativeEither)(A.lessThan(p.ordBigInt)(l)(s)||y.eq(p.eqBigInt)(l)(s)&&y.eq(p.eqBigInt)(n.value1)(I.zero(p.semiringBigInt)))(a.throwError(a.monadThrowEither)(new W(C.wrap()(e),n.value1))))((function(){return t.pure(g.applicativeEither)(C.wrap()(e))}))}))}}(e)(n))}));var i}))}))}))})))}}}(i)(e))(n)))}})(n);return function(e){return s(f(e))}}},n.slotToPosixTime=function(e){return function(n){return function(r){var i;return I.mul(p.semiringBigInt)(p.fromInt(1e3)),u.runExceptT(o.bind(u.bindExceptT(E.monadEffect))(c.liftEither(u.monadErrorExceptT(E.monadEffect))((i=e,function(e){var n=d.toBigInt(C.unwrap()(e));return g.note(new M(e))(m.find((function(e){return A.lessThanOrEq(p.ordBigInt)(d.toBigInt(C.unwrap()(C.unwrap()(e.start).slot)))(n)&&b.maybe(!0)((t=A.lessThan(p.ordBigInt)(n),r=C.unwrap(),o=C.unwrap(),function(e){return t(d.toBigInt(r(o(e).slot)))}))(e.end);var t,r,o}))(i))})(r)))((function(e){return o.bind(u.bindExceptT(E.monadEffect))(c.liftEither(u.monadErrorExceptT(E.monadEffect))(function(e){return function(n){var r=d.toBigInt(C.unwrap()(C.unwrap()(e.start).slot)),u=d.toBigInt(n);return o.discard(o.discardUnit)(g.bindEither)(t.unless(g.applicativeEither)(A.lessThanOrEq(p.ordBigInt)(r)(u))(a.throwError(a.monadThrowEither)(new R(n))))((function(){return t.pure(g.applicativeEither)(C.wrap()(S.sub(p.ringBigInt)(u)(r)))}))}}(e)(r)))((function(r){return o.bind(u.bindExceptT(E.monadEffect))(c.liftM(u.monadErrorExceptT(E.monadEffect))(B.value)((i=e,function(e){var n=ae(i);return w.map(b.functorMaybe)(C.wrap())(p.fromNumber(p.toNumber(e)*n))})(r)))((function(r){return o.bind(u.bindExceptT(E.monadEffect))(c.liftEither(u.monadErrorExceptT(E.monadEffect))(function(e){return function(n){var r,u,i,s=C.unwrap()(C.unwrap()(e.start).time)*l.slotLengthFactor+p.toNumber(n),f=b.maybe(s+1)((r=I.mul(I.semiringNumber)(l.slotLengthFactor),u=C.unwrap(),i=C.unwrap(),function(e){return r(u(i(e).time))}))(e.end);return o.discard(o.discardUnit)(g.bindEither)(t.unless(g.applicativeEither)(s<=f)(a.throwError(a.monadThrowEither)(new P(s))))((function(){return w.map(g.functorEither)(C.wrap())(c.liftM(a.monadErrorEither)(B.value)(p.fromNumber(s)))}))}}(e)(r)))((function(e){return o.bind(u.bindExceptT(E.monadEffect))(c.liftM(u.monadErrorExceptT(E.monadEffect))(B.value)(v.sysStartUnixTime(n)))((function(n){return t.pure(u.applicativeExceptT(E.monadEffect))(C.wrap()(I.add(p.semiringBigInt)(n)(C.unwrap()(e))))}))}))}));var i}))})))}}},n.showInterval=function(e){return function(n){return function(n){return{show:function(n){if(n instanceof k)return"(FiniteInterval "+T.show(e)(n.value0)+" "+T.show(e)(n.value1)+")";if(n instanceof N)return"(StartAt "+T.show(e)(n.value0)+")";if(n instanceof L)return"(EndAt "+T.show(e)(n.value0)+")";if(n instanceof _)return"AlwaysInterval";if(n instanceof U)return"EmptyInterval";throw new Error("Failed pattern match at Ctl.Internal.Types.Interval (line 264, column 1 - line 271, column 39): "+[n.constructor.name])}}}}},n.ordPOSIXTime=Z,n.semiringPOSIXTime=G,n.fromDataPOSIXTime=ee,n.toDataPOSIXTime=z,n.showPOSIXTime=J,n.showPosixTimeToSlotError=Y}(c),function(e){"use strict";e["Ctl.Internal.Types.TxConstraints"]=e["Ctl.Internal.Types.TxConstraints"]||{};var n=e["Ctl.Internal.Types.TxConstraints"],t=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],r=e["Ctl.Internal.Plutus.Types.Value"],o=e["Data.Array"],a=e["Data.Eq"],u=e["Data.Functor"],i=e["Data.Map.Internal"],c=e["Data.Maybe"],l=e["Data.Monoid"],s=e["Data.Newtype"],f=e["Data.Semigroup"],d=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),v=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),m=function(){function e(){}return e.value=new e,e}(),p=function(){function e(){}return e.value=new e,e}(),g=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),y=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),w=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),h=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),b=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),C=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),A=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),S=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),I=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),T=function(){function e(e,n,t,r,o){this.value0=e,this.value1=n,this.value2=t,this.value3=r,this.value4=o}return e.create=function(n){return function(t){return function(r){return function(o){return function(a){return new e(n,t,r,o,a)}}}}},e}(),D=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),F=function(){function e(e,n,t,r,o){this.value0=e,this.value1=n,this.value2=t,this.value3=r,this.value4=o}return e.create=function(n){return function(t){return function(r){return function(o){return function(a){return new e(n,t,r,o,a)}}}}},e}(),E=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),x=function(){function e(e,n,t,r,o,a){this.value0=e,this.value1=n,this.value2=t,this.value3=r,this.value4=o,this.value5=a}return e.create=function(n){return function(t){return function(r){return function(o){return function(a){return function(u){return new e(n,t,r,o,a,u)}}}}}},e}(),M=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),R=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),P=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),B=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),k=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),N=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),L=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),_=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),U=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),H=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),q=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),O=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),W=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),V=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),K=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),z=function(){function e(){}return e.value=new e,e}(),J=function(e){return e},j=f.semigroupRecord()(f.semigroupRecordCons({reflectSymbol:function(){return"constraints"}})()(f.semigroupRecordCons({reflectSymbol:function(){return"ownInputs"}})()(f.semigroupRecordCons({reflectSymbol:function(){return"ownOutputs"}})()(f.semigroupRecordNil)(f.semigroupArray))(f.semigroupArray))(f.semigroupArray)),Q=l.monoidRecord()(l.monoidRecordCons({reflectSymbol:function(){return"constraints"}})(l.monoidArray)()(l.monoidRecordCons({reflectSymbol:function(){return"ownInputs"}})(l.monoidArray)()(l.monoidRecordCons({reflectSymbol:function(){return"ownOutputs"}})(l.monoidArray)()(l.monoidRecordNil)))),G={eq:function(e){return function(n){return e instanceof m&&n instanceof m||e instanceof p&&n instanceof p}}},Z=function(e){return s.over()()(J)((function(n){return{constraints:o.singleton(e),ownInputs:n.ownInputs,ownOutputs:n.ownOutputs}}))(l.mempty(Q))};n.DatumInline=m,n.DatumWitness=p,n.RefInput=d,n.SpendInput=v,n.MustBeSignedBy=w,n.MustDelegateStakePlutusScript=H,n.MustDelegateStakeNativeScript=q,n.MustDelegateStakePubKey=U,n.MustDeregisterStakePlutusScript=k,n.MustDeregisterStakeNativeScript=N,n.MustDeregisterStakePubKey=P,n.MustHashDatum=M,n.MustIncludeDatum=g,n.MustMintValue=T,n.MustMintValueUsingNativeScript=D,n.MustNotBeValid=z,n.MustPayToNativeScript=E,n.MustPayToPubKeyAddress=F,n.MustPayToScript=x,n.MustProduceAtLeast=b,n.MustReferenceOutput=I,n.MustRegisterPool=L,n.MustRegisterStakePubKey=R,n.MustRegisterStakeScript=B,n.MustRetirePool=_,n.MustSatisfyAnyOf=K,n.MustSpendAtLeast=h,n.MustSpendNativeScriptOutput=A,n.MustSpendPubKeyOutput=C,n.MustSpendScriptOutput=S,n.MustValidateIn=y,n.MustWithdrawStakePlutusScript=W,n.MustWithdrawStakeNativeScript=V,n.MustWithdrawStakePubKey=O,n.mustBeSignedBy=function(e){return Z(w.create(e))},n.mustMintCurrencyWithRedeemerUsingScriptRef=function(e){return function(n){return function(t){return function(r){var o=T.create(e)(n)(t)(r);return function(e){return Z(o(c.Just.create(e)))}}}}},n.mustMintValueWithRedeemer=function(e){var n=o.fold(Q),a=u.map(u.functorArray)((function(n){var r,o=t.currencyMPSHash(n.value0);return(r=o,function(e){return function(n){return function(t){return Z(new T(r,e,n,t,c.Nothing.value))}}})(e)(n.value1.value0)(n.value1.value1)}));return function(e){return n(a(r.flattenNonAdaAssets(e)))}},n.mustPayToPubKeyAddress=function(e){return function(n){var t=F.create(e)(new c.Just(n))(c.Nothing.value)(c.Nothing.value);return function(e){return Z(t(e))}}},n.mustPayToScriptAddress=function(e){return function(n){return function(t){return function(r){return function(o){return f.append(j)(Z(new x(e,new c.Just(n),t,r,c.Nothing.value,o)))(l.guard(Q)(a.eq(G)(r)(p.value))(Z(new g(t))))}}}}},n.mustReferenceOutput=function(e){return Z(I.create(e))},n.mustSpendPubKeyOutput=function(e){return Z(C.create(e))},n.mustSpendScriptOutputUsingScriptRef=function(e){return function(n){var t=S.create(e)(n);return function(e){return Z(t(c.Just.create(e)))}}},n.mustValidateIn=function(e){return Z(y.create(e))},n.utxoWithScriptRef=function(e){var n=function(){if(e instanceof d)return e.value0;if(e instanceof v)return e.value0;throw new Error("Failed pattern match at Ctl.Internal.Types.TxConstraints (line 227, column 5 - line 229, column 42): "+[e.constructor.name])}();return i.singleton(n.input)(n.output)},n.eqDatumPresence=G,n.semigroupTxConstraints=j}(c),function(e){"use strict";e["Ctl.Internal.Types.TypedTxOut"]=e["Ctl.Internal.Types.TypedTxOut"]||{};var n=e["Ctl.Internal.Types.TypedTxOut"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Error.Class"],a=e["Control.Monad.Except.Trans"],u=e["Ctl.Internal.Contract.Monad"],i=e["Ctl.Internal.Contract.QueryHandle"],c=e["Ctl.Internal.FromData"],l=e["Ctl.Internal.Hashing"],s=e["Ctl.Internal.Helpers"],f=e["Ctl.Internal.Scripts"],d=e["Ctl.Internal.Serialization.Address"],v=e["Ctl.Internal.ToData"],m=e["Ctl.Internal.Types.OutputDatum"],p=e["Ctl.Internal.Types.PlutusData"],g=e["Ctl.Internal.Types.Transaction"],y=e["Data.Either"],w=e["Data.Eq"],h=e["Data.Functor"],b=e["Data.Generic.Rep"],C=e["Data.Maybe"],A=e["Data.Newtype"],S=e["Data.Show.Generic"],I=e["Effect.Aff"],T=e["Effect.Aff.Class"],D=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),F=function(){function e(){}return e.value=new e,e}(),E=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),x=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),M=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),R=function(){function e(){}return e.value=new e,e}(),P=function(){function e(){}return e.value=new e,e}(),B={to:function(e){if(e instanceof b.Inl)return new D(e.value0.value0,e.value0.value1);if(e instanceof b.Inr&&e.value0 instanceof b.Inl)return F.value;if(e instanceof b.Inr&&e.value0 instanceof b.Inr&&e.value0.value0 instanceof b.Inl)return new E(e.value0.value0.value0);if(e instanceof b.Inr&&e.value0 instanceof b.Inr&&e.value0.value0 instanceof b.Inr&&e.value0.value0.value0 instanceof b.Inl)return new x(e.value0.value0.value0.value0);if(e instanceof b.Inr&&e.value0 instanceof b.Inr&&e.value0.value0 instanceof b.Inr&&e.value0.value0.value0 instanceof b.Inr&&e.value0.value0.value0.value0 instanceof b.Inl)return new M(e.value0.value0.value0.value0.value0);if(e instanceof b.Inr&&e.value0 instanceof b.Inr&&e.value0.value0 instanceof b.Inr&&e.value0.value0.value0 instanceof b.Inr&&e.value0.value0.value0.value0 instanceof b.Inr&&e.value0.value0.value0.value0.value0 instanceof b.Inl)return R.value;if(e instanceof b.Inr&&e.value0 instanceof b.Inr&&e.value0.value0 instanceof b.Inr&&e.value0.value0.value0 instanceof b.Inr&&e.value0.value0.value0.value0 instanceof b.Inr&&e.value0.value0.value0.value0.value0 instanceof b.Inr)return P.value;throw new Error("Failed pattern match at Ctl.Internal.Types.TypedTxOut (line 209, column 1 - line 209, column 41): "+[e.constructor.name])},from:function(e){if(e instanceof D)return new b.Inl(new b.Product(e.value0,e.value1));if(e instanceof F)return new b.Inr(new b.Inl(b.NoArguments.value));if(e instanceof E)return new b.Inr(new b.Inr(new b.Inl(e.value0)));if(e instanceof x)return new b.Inr(new b.Inr(new b.Inr(new b.Inl(e.value0))));if(e instanceof M)return new b.Inr(new b.Inr(new b.Inr(new b.Inr(new b.Inl(e.value0)))));if(e instanceof R)return new b.Inr(new b.Inr(new b.Inr(new b.Inr(new b.Inr(new b.Inl(b.NoArguments.value))))));if(e instanceof P)return new b.Inr(new b.Inr(new b.Inr(new b.Inr(new b.Inr(new b.Inr(b.NoArguments.value))))));throw new Error("Failed pattern match at Ctl.Internal.Types.TypedTxOut (line 209, column 1 - line 209, column 41): "+[e.constructor.name])}},k={show:S.genericShow(B)(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsProduct(S.genericShowArgsArgument(d.showAddress))(S.genericShowArgsArgument(d.showAddress)))({reflectSymbol:function(){return"WrongValidatorAddress"}}))(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsNoArguments)({reflectSymbol:function(){return"ExpectedScriptGotPubkey"}}))(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsArgument(p.showPlutusData))({reflectSymbol:function(){return"WrongRedeemerType"}}))(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsArgument(p.showPlutusData))({reflectSymbol:function(){return"WrongDatumType"}}))(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsArgument(g.showDataHash))({reflectSymbol:function(){return"CannotQueryDatum"}}))(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsNoArguments)({reflectSymbol:function(){return"CannotMakeTypedTxOut"}}))(S.genericShowConstructor(S.genericShowArgsNoArguments)({reflectSymbol:function(){return"UnknownRef"}}))))))))},N=function(){return function(e){return function(n){return function(t){return function(r){return function(o){var a,u=l.datumHash(v.toData(e)(r)),i=f.typedValidatorEnterpriseAddress(n)(t);return(a=r,function(e){return{txOut:e,data:a}})(A.wrap()({address:i,amount:o,datum:new m.OutputDatumHash(u),scriptRef:C.Nothing.value}))}}}}}};n.mkTypedTxOut=N,n.typeTxOutRef=function(){return function(e){return function(n){return function(l){return function(v){return function(p){return a.runExceptT(r.bind(a.bindExceptT(u.monadContract))(s.liftM(a.monadErrorExceptT(u.monadContract))(P.value)(l(p)))((function(l){return r.bind(a.bindExceptT(u.monadContract))(function(e){return function(n){return function(l){return function(v){return r.bind(u.bindContract)(i.getQueryHandle)((function(i){return a.runExceptT(r.bind(a.bindExceptT(u.monadContract))(s.liftM(a.monadErrorExceptT(u.monadContract))(F.value)(m.outputDatumDataHash(v.datum)))((function(m){return r.discard(r.discardUnit)(a.bindExceptT(u.monadContract))(h.void(a.functorExceptT(u.functorContract))((p=a.monadExceptT(u.monadContract),function(e){return function(n){return function(r){return a.runExceptT((u=f.typedValidatorEnterpriseAddress(e)(n),t.unless(a.applicativeExceptT(p))(w.eq(d.eqAddress)(u)(r))(o.throwError(a.monadThrowExceptT(p))(new D(u,r)))));var u}}})(n)(l)(v.address)))((function(){return r.bind(a.bindExceptT(u.monadContract))(T.liftAff(u.monadAffContract)(h.mapFlipped(I.functorAff)(i.getDatumByHash(m))((o=y.note(new M(m)),f=r.join(C.bindMaybe),function(e){return o(f(y.hush(e)))}))))((function(o){return r.bind(a.bindExceptT(u.monadContract))(function(e){return function(){return function(n){return function(t){return function(t){return a.runExceptT(s.liftM(a.monadErrorExceptT(e))(new x(t))(c.fromData(n)(t)))}}}}}(u.monadContract)()(e.FromData0())(l)(o))((function(r){return t.pure(a.applicativeExceptT(u.monadContract))(N()(e.ToData1())(n)(l)(r)(v.amount))}))}));var o,f}));var p})))}))}}}}(e)(n)(v)(l))((function(e){return t.pure(a.applicativeExceptT(u.monadContract))({txOutRef:p,typedTxOut:e})}))})))}}}}}},n.typedTxOutDatumHash=function(){return function(e){return m.outputDatumDataHash(A.unwrap()(e.txOut).datum)}},n.typedTxOutRefValue=function(){return function(e){return function(e){return A.unwrap()(e.txOut).amount}(e.typedTxOut)}},n.typedTxOutTxOut=function(){return function(e){return e.txOut}},n.showTypeCheckError=k}(c),function(e){"use strict";e["Ctl.Internal.Types.UnbalancedTransaction"]=e["Ctl.Internal.Types.UnbalancedTransaction"]||{};var n=e["Ctl.Internal.Types.UnbalancedTransaction"],t=e["Ctl.Internal.Cardano.Types.Transaction"],r=e["Ctl.Internal.Types.Transaction"],o=e["Data.Lens.Lens"],a=e["Data.Map.Internal"],u=e["Data.Monoid"],i=e["Data.Show"],c=e["Data.Show.Generic"],l=e["Data.Tuple"],s={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(i.showRecord()(i.showRecordFieldsCons({reflectSymbol:function(){return"transaction"}})(i.showRecordFieldsCons({reflectSymbol:function(){return"utxoIndex"}})(i.showRecordFieldsNil)(a.showMap(r.showTransactionInput)(t.showTransactionOutput)))(t.showTransaction))))({reflectSymbol:function(){return"UnbalancedTx"}}))},f={transaction:u.mempty(t.monoidTransaction),utxoIndex:a.empty};n._transaction=function(e){return o["lens'"]((function(e){return new l.Tuple(e.transaction,(function(n){return{transaction:n,utxoIndex:e.utxoIndex}}))}))(e)},n._utxoIndex=function(e){return o["lens'"]((function(e){return new l.Tuple(e.utxoIndex,(function(n){return{transaction:e.transaction,utxoIndex:n}}))}))(e)},n.emptyUnbalancedTx=f,n.showUnbalancedTx=s}(c),function(e){"use strict";e["Data.Lens.Getter"]=e["Data.Lens.Getter"]||{};var n=e["Data.Lens.Getter"],t=e["Control.Category"],r=e["Control.Monad.State.Class"],o=e["Data.Newtype"],a=function(e){return o.unwrap()(e(t.identity(t.categoryFn)))},u=function(e){return function(n){return a(n)(e)}};n.viewOn=u,n.view=a,n.to=function(e){return function(n){var t=o.unwrap()(n);return function(n){return t(e(n))}}},n.use=function(e){return function(n){return r.gets(e)((function(e){return u(e)(n)}))}}}(c),function(e){"use strict";e["Data.Lens.Internal.Forget"]=e["Data.Lens.Internal.Forget"]||{};var n=e["Data.Lens.Internal.Forget"],t=e["Data.Tuple"],r={dimap:function(e){return function(n){return function(n){return function(t){return n(e(t))}}}}},o={first:function(e){return function(n){return e(t.fst(n))}},second:function(e){return function(n){return e(t.snd(n))}},Profunctor0:function(){return r}};n.profunctorForget=r,n.strongForget=o}(c),function(e){"use strict";e["Ctl.Internal.Types.ScriptLookups"]=e["Ctl.Internal.Types.ScriptLookups"]||{};var n,t,r,o=e["Ctl.Internal.Types.ScriptLookups"],a=e["Control.Applicative"],u=e["Control.Apply"],i=e["Control.Bind"],c=e["Control.Monad.Error.Class"],l=e["Control.Monad.Except.Trans"],s=e["Control.Monad.Reader.Class"],f=e["Control.Monad.State.Class"],d=e["Control.Monad.State.Trans"],v=e["Control.Monad.Trans.Class"],m=e["Ctl.Internal.Address"],p=e["Ctl.Internal.Cardano.Types.ScriptRef"],g=e["Ctl.Internal.Cardano.Types.Transaction"],y=e["Ctl.Internal.Cardano.Types.Value"],w=e["Ctl.Internal.Contract"],h=e["Ctl.Internal.Contract.Monad"],b=e["Ctl.Internal.Contract.QueryHandle"],C=e["Ctl.Internal.Hashing"],A=e["Ctl.Internal.Helpers"],S=e["Ctl.Internal.NativeScripts"],I=e["Ctl.Internal.Plutus.Conversion"],T=e["Ctl.Internal.Plutus.Conversion.Value"],D=e["Ctl.Internal.Plutus.Types.Credential"],F=e["Ctl.Internal.QueryM.Pools"],E=e["Ctl.Internal.Scripts"],x=e["Ctl.Internal.Serialization.Address"],M=e["Ctl.Internal.Serialization.Hash"],R=e["Ctl.Internal.Service.Error"],P=e["Ctl.Internal.Transaction"],B=e["Ctl.Internal.Types.Datum"],k=e["Ctl.Internal.Types.Interval"],N=e["Ctl.Internal.Types.OutputDatum"],L=e["Ctl.Internal.Types.PubKeyHash"],_=e["Ctl.Internal.Types.RedeemerTag"],U=e["Ctl.Internal.Types.RewardAddress"],H=e["Ctl.Internal.Types.Scripts"],q=e["Ctl.Internal.Types.TokenName"],O=e["Ctl.Internal.Types.Transaction"],W=e["Ctl.Internal.Types.TxConstraints"],V=e["Ctl.Internal.Types.TypedTxOut"],K=e["Ctl.Internal.Types.UnbalancedTransaction"],z=e["Data.Array"],J=e["Data.Bifunctor"],j=e["Data.BigInt"],Q=e["Data.Either"],G=e["Data.Eq"],Z=e["Data.Foldable"],X=e["Data.Function"],Y=e["Data.Functor"],$=e["Data.Generic.Rep"],ee=e["Data.Lattice"],ne=e["Data.Lens.Getter"],te=e["Data.Lens.Internal.Forget"],re=e["Data.Lens.Iso"],oe=e["Data.Lens.Iso.Newtype"],ae=e["Data.Lens.Record"],ue=e["Data.Lens.Setter"],ie=e["Data.List.Types"],ce=e["Data.Map.Internal"],le=e["Data.Maybe"],se=e["Data.Monoid"],fe=e["Data.Newtype"],de=e["Data.Ord"],ve=e["Data.Profunctor"],me=e["Data.Profunctor.Strong"],pe=e["Data.Ring"],ge=e["Data.Semigroup"],ye=e["Data.Semiring"],we=e["Data.Set"],he=e["Data.Show"],be=e["Data.Show.Generic"],Ce=e["Data.Symbol"],Ae=e["Data.Traversable"],Se=e["Data.Tuple"],Ie=e["Data.Unfoldable"],Te=e["Data.Unit"],De=e.Effect,Fe=e["Effect.Aff"],Ee=e["Effect.Aff.Class"],xe=e["Effect.Class"],Me=e["Effect.Exception"],Re=e["Type.Proxy"],Pe=function(e){return e},Be=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),ke=function(){function e(){}return e.value=new e,e}(),Ne=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Le=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),_e=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),Ue=function(){function e(){}return e.value=new e,e}(),He=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),qe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Oe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),We=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ve=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),Ke=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),ze=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Je=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),je=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Qe=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),Ge=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ze=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Xe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ye=function(){function e(){}return e.value=new e,e}(),$e=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),en=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),nn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),tn=function(){function e(){}return e.value=new e,e}(),rn=function(){function e(){}return e.value=new e,e}(),on=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),an=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),un=function(){function e(){}return e.value=new e,e}(),cn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),ln=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),sn={append:function(e){return function(n){return{required:ee.join(y.joinSemilatticeValue)(e.required)(n.required),provided:ee.join(y.joinSemilatticeValue)(e.provided)(n.provided)}}}},fn={append:function(e){return function(n){return{mps:z.union(H.eqMintingPolicy)(e.mps)(n.mps),txOutputs:ce.union(O.ordTransactionInput)(e.txOutputs)(n.txOutputs),scripts:z.union(H.eqValidator)(e.scripts)(n.scripts),datums:ce.union(O.ordDataHash)(e.datums)(n.datums),paymentPubKeyHashes:ce.union(L.ordPaymentPubKeyHash)(e.paymentPubKeyHashes)(n.paymentPubKeyHashes),typedValidator:A.appendFirstMaybe(e.typedValidator)(n.typedValidator),ownPaymentPubKeyHash:A.appendFirstMaybe(e.ownPaymentPubKeyHash)(n.ownPaymentPubKeyHash),ownStakePubKeyHash:A.appendFirstMaybe(e.ownStakePubKeyHash)(n.ownStakePubKeyHash)}}}},dn={mempty:{mps:se.mempty(se.monoidArray),txOutputs:ce.empty,scripts:se.mempty(se.monoidArray),datums:ce.empty,paymentPubKeyHashes:ce.empty,typedValidator:le.Nothing.value,ownPaymentPubKeyHash:le.Nothing.value,ownStakePubKeyHash:le.Nothing.value},Semigroup0:function(){return fn}},vn={show:be.genericShow({to:function(e){return e},from:function(e){return e}})(be.genericShowConstructor(be.genericShowArgsArgument(he.showRecord()(he.showRecordFieldsCons({reflectSymbol:function(){return"datums"}})(he.showRecordFieldsCons({reflectSymbol:function(){return"redeemersTxIns"}})(he.showRecordFieldsCons({reflectSymbol:function(){return"unbalancedTx"}})(he.showRecordFieldsNil)(K.showUnbalancedTx))(he.showArray(Se.showTuple(g.showRedeemer)(le.showMaybe(O.showTransactionInput)))))(he.showArray(B.showDatum)))))({reflectSymbol:function(){return"UnattachedUnbalancedTx"}}))},mn={to:function(e){if(e instanceof $.Inl)return new Be(e.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inl)return ke.value;if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inl)return new Ne(e.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inl)return new Le(e.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value1);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inl)return new _e(e.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value1);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inl)return Ue.value;if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new He(e.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new qe(e.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Oe(e.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new We(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Ve(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1.value1);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Ke(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new ze(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Je(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new je(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Qe(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Ge(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Ze(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Xe(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return Ye.value;if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new $e(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new en(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new nn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return tn.value;if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return rn.value;if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new on(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new an(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return un.value;if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new cn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr)return new ln(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1);throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 922, column 1 - line 922, column 46): "+[e.constructor.name])},from:function(e){if(e instanceof Be)return new $.Inl(e.value0);if(e instanceof ke)return new $.Inr(new $.Inl($.NoArguments.value));if(e instanceof Ne)return new $.Inr(new $.Inr(new $.Inl(e.value0)));if(e instanceof Le)return new $.Inr(new $.Inr(new $.Inr(new $.Inl(new $.Product(e.value0,e.value1)))));if(e instanceof _e)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(new $.Product(e.value0,e.value1))))));if(e instanceof Ue)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl($.NoArguments.value))))));if(e instanceof He)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))));if(e instanceof qe)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))));if(e instanceof Oe)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))));if(e instanceof We)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))))));if(e instanceof Ve)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(new $.Product(e.value0,new $.Product(e.value1,e.value2)))))))))))));if(e instanceof Ke)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))))))));if(e instanceof ze)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))));if(e instanceof Je)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))))))))));if(e instanceof je)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))));if(e instanceof Qe)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(new $.Product(e.value0,e.value1)))))))))))))))));if(e instanceof Ge)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))))));if(e instanceof Ze)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))))))))))))));if(e instanceof Xe)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))))))));if(e instanceof Ye)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl($.NoArguments.value))))))))))))))))))));if(e instanceof $e)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))))))))));if(e instanceof en)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))))))))))))))))));if(e instanceof nn)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))))))))))));if(e instanceof tn)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl($.NoArguments.value))))))))))))))))))))))));if(e instanceof rn)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl($.NoArguments.value)))))))))))))))))))))))));if(e instanceof on)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))))))))))))))))))))));if(e instanceof an)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))))))))))))))));if(e instanceof un)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl($.NoArguments.value))))))))))))))))))))))))))));if(e instanceof cn)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))))))))))))))))));if(e instanceof ln)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Product(e.value0,e.value1))))))))))))))))))))))))))))));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 922, column 1 - line 922, column 46): "+[e.constructor.name])}},pn={show:be.genericShow(mn)(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(L.showPaymentPubKeyHash))({reflectSymbol:function(){return"CannotConvertPaymentPubKeyHash"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsNoArguments)({reflectSymbol:function(){return"CannotFindDatum"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(O.showDataHash))({reflectSymbol:function(){return"CannotQueryDatum"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsProduct(be.genericShowArgsArgument(k.showInterval(k.showPOSIXTime)(k.ordPOSIXTime)(k.semiringPOSIXTime)))(be.genericShowArgsArgument(k.showPosixTimeToSlotError)))({reflectSymbol:function(){return"CannotConvertPOSIXTimeRange"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsProduct(be.genericShowArgsArgument(k.showInterval(k.showPOSIXTime)(k.ordPOSIXTime)(k.semiringPOSIXTime)))(be.genericShowArgsArgument(k.showInterval(k.showPOSIXTime)(k.ordPOSIXTime)(k.semiringPOSIXTime))))({reflectSymbol:function(){return"CannotSolveTimeConstraints"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsNoArguments)({reflectSymbol:function(){return"CannotGetMintingPolicyScriptIndex"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(x.showAddress))({reflectSymbol:function(){return"CannotGetValidatorHashFromAddress"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(B.showDatum))({reflectSymbol:function(){return"CannotHashDatum"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(H.showMintingPolicy))({reflectSymbol:function(){return"CannotHashMintingPolicy"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(H.showValidator))({reflectSymbol:function(){return"CannotHashValidator"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsProduct(be.genericShowArgsArgument(y.showCurrencySymbol))(be.genericShowArgsProduct(be.genericShowArgsArgument(q.showTokenName))(be.genericShowArgsArgument(j.showBigInt))))({reflectSymbol:function(){return"CannotMakeValue"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(L.showStakePubKeyHash))({reflectSymbol:function(){return"CannotWithdrawRewardsPubKey"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(H.showPlutusScriptStakeVali))({reflectSymbol:function(){return"CannotWithdrawRewardsPlutusScript"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(H.showNativeScriptStakeVali))({reflectSymbol:function(){return"CannotWithdrawRewardsNativeScript"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(O.showDataHash))({reflectSymbol:function(){return"DatumNotFound"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsProduct(be.genericShowArgsArgument(O.showDataHash))(be.genericShowArgsArgument(B.showDatum)))({reflectSymbol:function(){return"DatumWrongHash"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(H.showMintingPolicyHash))({reflectSymbol:function(){return"MintingPolicyHashNotCurrencySymbol"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(H.showMintingPolicyHash))({reflectSymbol:function(){return"MintingPolicyNotFound"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(P.showModifyTxError))({reflectSymbol:function(){return"ModifyTx"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsNoArguments)({reflectSymbol:function(){return"OwnPubKeyAndStakeKeyMissing"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(O.showTransactionInput))({reflectSymbol:function(){return"TxOutRefNotFound"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(O.showTransactionInput))({reflectSymbol:function(){return"TxOutRefWrongType"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(V.showTypeCheckError))({reflectSymbol:function(){return"TypeCheckFailed"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsNoArguments)({reflectSymbol:function(){return"TypedTxOutHasNoDatumHash"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsNoArguments)({reflectSymbol:function(){return"TypedValidatorMissing"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(H.showValidatorHash))({reflectSymbol:function(){return"ValidatorHashNotFound"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(le.showMaybe(M.showScriptHash)))({reflectSymbol:function(){return"WrongRefScriptHash"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsNoArguments)({reflectSymbol:function(){return"CannotSatisfyAny"}}))(be.genericShowSum(be.genericShowConstructor(be.genericShowArgsArgument(H.showMintingPolicyHash))({reflectSymbol:function(){return"ExpectedPlutusScriptGotNativeScript"}}))(be.genericShowConstructor(be.genericShowArgsProduct(be.genericShowArgsArgument(y.showCurrencySymbol))(be.genericShowArgsArgument(q.showTokenName)))({reflectSymbol:function(){return"CannotMintZero"}})))))))))))))))))))))))))))))))},gn=function(e){return{required:e,provided:se.mempty(y.monoidValue)}},yn=function(e){return{provided:e,required:se.mempty(y.monoidValue)}},wn=function(e){var n=ge.append(y.semigroupValue)(e.required)(y.negation(y.negateValue)(e.provided));return y.split(y.splitValue)(n).value1},hn=function(e){if(e instanceof D.PubKeyCredential)return x.keyHashCredential(fe.unwrap()(e.value0));if(e instanceof D.ScriptCredential)return x.scriptHashCredential(fe.unwrap()(e.value0));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1453, column 36 - line 1455, column 74): "+[e.constructor.name])},bn=function(e){return ae.prop({reflectSymbol:function(){return"valueSpentBalancesOutputs"}})()()(Ce.SProxy.value)(e)},Cn=function(e){return ae.prop({reflectSymbol:function(){return"valueSpentBalancesInputs"}})()()(Ce.SProxy.value)(e)},An=function(e){return ae.prop({reflectSymbol:function(){return"unbalancedTx"}})()()(Ce.SProxy.value)(e)},Sn=function(e){return function(n){return i.bind(d.bindStateT(h.monadContract))(ne.use(d.monadStateStateT(h.monadContract))((t=An(te.strongForget),r=K._transaction(te.strongForget),function(e){return t(r(e))})))((function(t){return i.bind(d.bindStateT(h.monadContract))(xe.liftEffect(d.monadEffectState(h.monadEffectContract))(Y.mapFlipped(De.functorEffect)(e(n)(t))(J.lmap(J.bifunctorEither)(Xe.create))))((function(e){return Q.either((u=a.pure(d.applicativeStateT(h.monadContract)),i=c.throwError(c.monadThrowEither),function(e){return u(i(e))}))((r=Y.map(d.functorStateT(h.functorContract))(Q.Right.create),o=ue.assign(d.monadStateStateT(h.monadContract))((n=An(me.strongFn),t=K._transaction(me.strongFn),function(e){return n(t(e))})),function(e){return r(o(e))}))(e);var n,t,r,o,u,i}))}));var t,r}},In=function(e){return ae.prop({reflectSymbol:function(){return"refScriptsUtxoMap"}})()()(Ce.SProxy.value)(e)},Tn=function(e){return ae.prop({reflectSymbol:function(){return"redeemersTxIns"}})()()(Ce.SProxy.value)(e)},Dn=function(e){return ae.prop({reflectSymbol:function(){return"mintRedeemers"}})()()(Ce.SProxy.value)(e)},Fn=function(e){return ae.prop({reflectSymbol:function(){return"lookups"}})()()(Ce.SProxy.value)(e)},En=function(e){return ae.prop({reflectSymbol:function(){return"datums"}})()()(Ce.SProxy.value)(e)},xn=function(e){return l.runExceptT(i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(Sn(P.attachDatum)(e))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(ge.semigroupArray)(En(me.strongFn))(z.singleton(e))})))},Mn=function(e){var n=An(e),t=K._transaction(e);return function(e){return n(t(e))}},Rn=function(e){var n=Mn(e),t=g._body(e);return function(e){return n(t(e))}},Pn=function(e){return i.bind(d.bindStateT(h.monadContract))(f.gets(d.monadStateStateT(h.monadContract))(ne.view((n=Rn(te.strongForget),t=g._certs(te.strongForget),r=re.non(G.eqArray(g.eqCertificate))([])(te.profunctorForget),o=ne.to(z.length),function(e){return n(t(r(o(e))))}))))((function(n){return i.discard(i.discardUnit)(d.bindStateT(h.monadContract))(ue.modifying(d.monadStateStateT(h.monadContract))((t=Rn(me.strongFn),r=g._certs(me.strongFn),o=re.non(G.eqArray(g.eqCertificate))([])(ve.profunctorFn),function(e){return t(r(o(e)))}))(z.cons(e)))((function(){return a.pure(d.applicativeStateT(h.monadContract))(n)}));var t,r,o}));var n,t,r,o},Bn=i.bind(d.bindStateT(h.monadContract))(ne.use(d.monadStateStateT(h.monadContract))((n=Rn(te.strongForget),t=g._networkId(te.strongForget),function(e){return n(t(e))})))(le.maybe(s.asks(d.monadAskStateT(h.monadAskContractEnvContra))((function(e){return e.networkId})))(a.pure(d.applicativeStateT(h.monadContract)))),kn=i.bind(d.bindStateT(h.monadContract))(f.gets(d.monadStateStateT(h.monadContract))((function(e){return ee.join(y.joinSemilatticeValue)(wn(e.valueSpentBalancesInputs))(wn(e.valueSpentBalancesOutputs))})))((function(e){return i.bind(d.bindStateT(h.monadContract))(Bn)((function(n){return y.isZero(e)?a.pure(d.applicativeStateT(h.monadContract))(new Q.Right(Te.unit)):l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(Y.mapFlipped(l.functorExceptT(d.functorStateT(h.functorContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(Fn(te.strongForget)))(fe.unwrap()))((function(t){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(function(){if(t.ownPaymentPubKeyHash instanceof le.Nothing&&t.ownStakePubKeyHash instanceof le.Nothing)return c.throwError(l.monadThrowExceptT(d.monadStateT(h.monadContract)))(Ye.value);if(t.ownPaymentPubKeyHash instanceof le.Just&&t.ownStakePubKeyHash instanceof le.Just)return a.pure(l.applicativeExceptT(d.monadStateT(h.monadContract)))({address:L.payPubKeyHashBaseAddress(n)(t.ownPaymentPubKeyHash.value0)(t.ownStakePubKeyHash.value0),amount:e,datum:N.NoOutputDatum.value,scriptRef:le.Nothing.value});if(t.ownPaymentPubKeyHash instanceof le.Just&&t.ownStakePubKeyHash instanceof le.Nothing)return a.pure(l.applicativeExceptT(d.monadStateT(h.monadContract)))({address:L.payPubKeyHashEnterpriseAddress(n)(t.ownPaymentPubKeyHash.value0),amount:e,datum:N.NoOutputDatum.value,scriptRef:le.Nothing.value});if(t.ownPaymentPubKeyHash instanceof le.Nothing&&t.ownStakePubKeyHash instanceof le.Just)return a.pure(l.applicativeExceptT(d.monadStateT(h.monadContract)))({address:L.stakePubKeyHashRewardAddress(n)(t.ownStakePubKeyHash.value0),amount:e,datum:N.NoOutputDatum.value,scriptRef:le.Nothing.value});throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 763, column 14 - line 782, column 10): "+[t.ownPaymentPubKeyHash.constructor.name,t.ownStakePubKeyHash.constructor.name])}())((function(e){return ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((n=Rn(me.strongFn),t=g._outputs(me.strongFn),function(e){return n(t(e))}))(z.cons(e));var n,t}))})))}))})),Nn=function(e){var n=function(e){return Y.map(d.functorStateT(h.functorContract))(X.flip(I.fromPlutusTxOutputWithRefScript)(e))(Bn)};return function(t){if(t instanceof le.Just)return le.maybe(Nn(e)(le.Nothing.value))((r=Y.map(d.functorStateT(h.functorContract))(Q.Right.create),function(e){return r(n(e))}))(ce.lookup(O.ordTransactionInput)(e)(W.utxoWithScriptRef(t.value0)));var r,o;if(t instanceof le.Nothing)return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(Y.mapFlipped(l.functorExceptT(d.functorStateT(h.functorContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(Fn(te.strongForget)))((o=fe.unwrap(),function(e){return o(e).txOutputs})))((function(t){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(h.monadContract)))(new $e(e))(ce.lookup(O.ordTransactionInput)(e)(t)))((function(e){return v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(n(e))}))})));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 933, column 23 - line 941, column 38): "+[t.constructor.name])}},Ln=l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(Y.mapFlipped(l.functorExceptT(d.functorStateT(h.functorContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(Fn(te.strongForget)))((r=fe.unwrap(),function(e){return r(e).txOutputs})))((function(e){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(In(te.strongForget)))((function(n){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(Bn))((function(t){var r,o,a=Y.mapFlipped(ce.functorMap)(ce.union(O.ordTransactionInput)(e)(n))(I.fromPlutusTxOutputWithRefScript(t));return ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((r=An(me.strongFn),o=K._utxoIndex(me.strongFn),function(e){return r(o(e))}))(X.flip(ce.union(O.ordTransactionInput))(a))}))}))}))),_n=function(){return function(e){return function(n){return i.bind(d.bindStateT(h.monadContract))(function(){if(n instanceof W.SpendInput)return i.discard(i.discardUnit)(d.bindStateT(h.monadContract))(ue.modifying(d.monadStateStateT(h.monadContract))((e=Rn(me.strongFn),t=g._inputs(me.strongFn),function(n){return e(t(n))}))(we.insert(O.ordTransactionInput)(fe.unwrap()(n.value0).input)))((function(){return a.pure(d.applicativeStateT(h.monadContract))(n.value0)}));var e,t,r,o;if(n instanceof W.RefInput){var u=fe.unwrap()(n.value0).input;return i.discard(i.discardUnit)(d.bindStateT(h.monadContract))(ue.modifying(d.monadStateStateT(h.monadContract))((r=Rn(me.strongFn),o=g._referenceInputs(me.strongFn),function(e){return r(o(e))}))(we.insert(O.ordTransactionInput)(u)))((function(){return a.pure(d.applicativeStateT(h.monadContract))(n.value0)}))}throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 989, column 17 - line 996, column 22): "+[n.constructor.name])}())((function(n){return i.discard(i.discardUnit)(d.bindStateT(h.monadContract))((t=n,ue.modifying(d.monadStateStateT(h.monadContract))(In(me.strongFn))(ce.insert(O.ordTransactionInput)(t.input)(t.output))))((function(){return function(n){var t=fe.unwrap()(fe.unwrap()(n.output).output).referenceScript,r=a.pure(d.applicativeStateT(h.monadContract))(c.throwError(c.monadThrowEither)(new an(t)));return G.notEq(le.eqMaybe(M.eqScriptHash))(new le.Just(fe.unwrap()(e)))(t)?r:a.pure(d.applicativeStateT(h.monadContract))(new Q.Right(Te.unit))}(n)}));var t}))}}},Un=function(e){return function(n){return function(t){var r=function(e){return function(n){if(n instanceof W.DatumInline)return new N.OutputDatum(e);if(n instanceof W.DatumWitness)return new N.OutputDatumHash(C.datumHash(e));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1448, column 21 - line 1450, column 60): "+[n.constructor.name])}};return i.bind(d.bindStateT(h.monadContract))(v.lift(d.monadTransStateT)(h.monadContract)(b.getQueryHandle))((function(o){if(t instanceof W.MustIncludeDatum)return xn(t.value0);if(t instanceof W.MustValidateIn)return i.bind(d.bindStateT(h.monadContract))(s.asks(d.monadAskStateT(h.monadAskContractEnvContra))((function(e){return e.ledgerConstants})))((function(e){return i.bind(d.bindStateT(h.monadContract))(Ee.liftAff(Ee.monadAffState(h.monadAffContract))(i.bind(Fe.bindAff)(o.getEraSummaries)(Q.either((n=xe.liftEffect(Fe.monadEffectAff),r=he.show(R.showClientError),function(e){return n(Me.throw(r(e)))}))(a.pure(Fe.applicativeAff)))))((function(n){return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(xe.liftEffect(d.monadEffectState(h.monadEffectContract))(Y.mapFlipped(De.functorEffect)(k.posixTimeRangeToTransactionValidity(n)(e.systemStart)(t.value0))(J.lmap(J.bifunctorEither)(Le.create(t.value0)))))((function(e){return ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((n=Rn(me.strongFn),t=oe._Newtype()()(ve.profunctorFn),function(e){return n(t(e))}))((function(n){var t={};for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t.ttl=e.timeToLive,t.validityStartInterval=e.validityStartInterval,t}));var n,t})))}));var n,r}));if(t instanceof W.MustBeSignedBy)return l.runExceptT(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(le.semigroupMaybe(ge.semigroupArray))((w=Rn(me.strongFn),b=g._requiredSigners(me.strongFn),function(e){return w(b(e))}))(new le.Just([fe.wrap()(fe.unwrap()(fe.unwrap()(t.value0)))])));var w,b,I,D,M,B,q,V,K,X,$;if(t instanceof W.MustSpendAtLeast){var ee=T.fromPlutusValue(t.value0);return l.runExceptT(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(sn)(Cn(me.strongFn))(gn(ee)))}if(t instanceof W.MustProduceAtLeast)return ee=T.fromPlutusValue(t.value0),l.runExceptT(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(sn)(bn(me.strongFn))(gn(ee)));if(t instanceof W.MustSpendPubKeyOutput)return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(Nn(t.value0)(le.Nothing.value))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((n=Rn(me.strongFn),r=g._inputs(me.strongFn),function(e){return n(r(e))}))(we.insert(O.ordTransactionInput)(t.value0)))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(sn)(Cn(me.strongFn))(yn(e.amount))}));var n,r})));if(t instanceof W.MustSpendScriptOutput)return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(Nn(t.value0)(t.value2))((function(e){return e.datum instanceof N.NoOutputDatum?c.throwError(l.monadThrowExceptT(d.monadStateT(h.monadContract)))(new en(t.value0)):i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(h.monadContract)))(new He(e.address))(m.addressPaymentValidatorHash(e.address)))((function(r){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(function(){if(t.value2 instanceof le.Nothing)return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(l.except(d.applicativeStateT(h.monadContract))(Y.map(Q.functorEither)(fe.unwrap())((e=r,function(n){return Q.note(new on(e))(ce.lookup(H.ordValidatorHash)(e)(n))})(n))))((function(e){return Sn(P.attachPlutusScript)(e)}));var e;if(t.value2 instanceof le.Just)return _n()(r)(t.value2.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1096, column 13 - line 1102, column 80): "+[t.value2.constructor.name])}())((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(function(){if(e.datum instanceof N.OutputDatumHash)return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(i.bind(d.bindStateT(h.monadContract))((n=e.datum.value0,i.bind(d.bindStateT(h.monadContract))(Y.mapFlipped(d.functorStateT(h.functorContract))(ne.use(d.monadStateStateT(h.monadContract))(Fn(te.strongForget)))((t=fe.unwrap(),function(e){return t(e).datums})))((function(e){return a.pure(d.applicativeStateT(h.monadContract))(Q.note(new je(n))(ce.lookup(O.ordDataHash)(n)(e)))}))))((function(n){var t,r;return Q.isRight(n)?a.pure(d.applicativeStateT(h.monadContract))(n):Ee.liftAff(Ee.monadAffState(h.monadAffContract))(Y.mapFlipped(Fe.functorAff)(o.getDatumByHash(e.datum.value0))((t=Q.note(new Ne(e.datum.value0)),r=i.join(le.bindMaybe),function(e){return t(r(Q.hush(e)))})))})))((function(e){return xn(e)}));var n,t;if(e.datum instanceof N.OutputDatum)return a.pure(l.applicativeExceptT(d.monadStateT(h.monadContract)))(Te.unit);if(e.datum instanceof N.NoOutputDatum)return c.throwError(l.monadThrowExceptT(d.monadStateT(h.monadContract)))(ke.value);throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1105, column 13 - line 1118, column 58): "+[e.datum.constructor.name])}())((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((n=Rn(me.strongFn),r=g._inputs(me.strongFn),function(e){return n(r(e))}))(we.insert(O.ordTransactionInput)(t.value0)))((function(){var n={tag:_.Spend.value,index:ye.zero(j.semiringBigInt),data:fe.unwrap()(t.value1),exUnits:ye.zero(ye.semiringRecord()(ye.semiringRecordCons({reflectSymbol:function(){return"mem"}})()(ye.semiringRecordCons({reflectSymbol:function(){return"steps"}})()(ye.semiringRecordNil)(j.semiringBigInt))(j.semiringBigInt)))};return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(sn)(Cn(me.strongFn))(yn(e.amount)))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(ge.semigroupArray)(Tn(me.strongFn))(z.singleton(new Se.Tuple(n,new le.Just(t.value0)))))((function(){return Sn(P.attachRedeemer)(n)}))}))}));var n,r}))}))}))})));if(t instanceof W.MustSpendNativeScriptOutput)return l.runExceptT(i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((I=Rn(me.strongFn),D=g._inputs(me.strongFn),function(e){return I(D(e))}))(we.insert(O.ordTransactionInput)(t.value0)))((function(){return Sn(P.attachNativeScript)(t.value1)})));if(t instanceof W.MustReferenceOutput)return l.runExceptT(ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((M=Rn(me.strongFn),B=g._referenceInputs(me.strongFn),function(e){return M(B(e))}))(we.insert(O.ordTransactionInput)(t.value0)));if(t instanceof W.MustMintValue)return l.runExceptT(i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(function(){if(t.value4 instanceof le.Nothing)return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(l.except(d.applicativeStateT(h.monadContract))((n=t.value0,function(e){return Q.note(new Ze(n))(ce.lookup(H.ordMintingPolicyHash)(n)(e))})(e)))((function(e){if(e instanceof H.PlutusMintingPolicy)return Sn(P.attachPlutusScript)(e.value0);if(e instanceof H.NativeMintingPolicy)return c.throwError(l.monadThrowExceptT(d.monadStateT(h.monadContract)))(new cn(t.value0));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1145, column 13 - line 1152, column 60): "+[e.constructor.name])}));var n,r,o,u;if(t.value4 instanceof le.Just)return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))((r=t.value4.value0,u=function(){if(r instanceof W.RefInput)return r.value0;if(r instanceof W.SpendInput)return r.value0;throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1034, column 10 - line 1036, column 28): "+[r.constructor.name])}(),a.pure(d.applicativeStateT(h.monadContract))(Q.note(new an(le.Nothing.value))((o=fe.unwrap()(fe.unwrap()(u).output).scriptRef,i.bind(le.bindMaybe)(o)((function(e){return e instanceof p.NativeScriptRef?a.pure(le.applicativeMaybe)(!0):a.pure(le.applicativeMaybe)(!1)})))))))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(a.when(l.applicativeExceptT(d.monadStateT(h.monadContract)))(e)(c.throwError(l.monadThrowExceptT(d.monadStateT(h.monadContract)))(new cn(t.value0))))((function(){return _n()(t.value0)(t.value4.value0)}))}));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1142, column 7 - line 1158, column 78): "+[t.value4.constructor.name])}())((function(){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(h.monadContract)))(new Ge(t.value0))(y.mpsSymbol(t.value0)))((function(e){var n=y["mkSingletonValue'"](e)(t.value2);return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(de.lessThan(j.ordBigInt)(t.value3)(ye.zero(j.semiringBigInt))?i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(h.monadContract)))(new Ve(e,t.value2,t.value3))(n(pe.negate(j.ringBigInt)(t.value3))))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(sn)(Cn(me.strongFn))(yn(e)))((function(){return a.pure(l.applicativeExceptT(d.monadStateT(h.monadContract)))(Y.map(le.functorMaybe)(y.getNonAdaAsset)(n(t.value3)))}))})):G.eq(j.eqBigInt)(t.value3)(ye.zero(j.semiringBigInt))?c.throwError(l.monadThrowExceptT(d.monadStateT(h.monadContract)))(new ln(e,t.value2)):i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(h.monadContract)))(new Ve(e,t.value2,t.value3))(n(t.value3)))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(sn)(bn(me.strongFn))(yn(e)))((function(){return a.pure(l.applicativeExceptT(d.monadStateT(h.monadContract)))(Y.map(le.functorMaybe)(y.getNonAdaAsset)(n(t.value3)))}))})))((function(e){var n={tag:_.Mint.value,index:ye.zero(j.semiringBigInt),data:fe.unwrap()(t.value1),exUnits:ye.zero(ye.semiringRecord()(ye.semiringRecordCons({reflectSymbol:function(){return"mem"}})()(ye.semiringRecordCons({reflectSymbol:function(){return"steps"}})()(ye.semiringRecordNil)(j.semiringBigInt))(j.semiringBigInt)))};return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(Tn(me.strongFn))(z.filter((function(e){return G.notEq(_.eqRedeemerTag)(e.value0.tag)(_.Mint.value)}))))((function(){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))((r=t.value0,function(e){return i.discard(i.discardUnit)(d.bindStateT(h.monadContract))(ue.modifying(d.monadStateStateT(h.monadContract))(Dn(me.strongFn))(ce.insert(H.ordMintingPolicyHash)(r)(e)))((function(){return i.bind(d.bindStateT(h.monadContract))(Y.mapFlipped(d.functorStateT(h.functorContract))(ne.use(d.monadStateStateT(h.monadContract))(Dn(te.strongForget)))(ce.toUnfoldable(Ie.unfoldableArray)))((function(e){return a.pure(d.applicativeStateT(h.monadContract))(z.mapWithIndex((function(e){return function(n){return{tag:n.value1.tag,index:j.fromInt(e),data:n.value1.data,exUnits:n.value1.exUnits}}}))(e))}))}))})(n)))((function(n){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(ge.semigroupArray)(Tn(me.strongFn))(Y.map(Y.functorArray)((function(e){return new Se.Tuple(e,le.Nothing.value)}))(n)))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(le.semigroupMaybe(g.semigroupMint))((n=Rn(me.strongFn),t=g._mint(me.strongFn),function(e){return n(t(e))}))(Y.map(le.functorMaybe)(fe.wrap())(e));var n,t}))}));var r}))}))}))})));if(t instanceof W.MustMintValueUsingNativeScript)return l.runExceptT((q=fe.wrap()(fe.unwrap()(S.nativeScriptHash(t.value0))),i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(Sn(P.attachNativeScript)(t.value0))((function(){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(h.monadContract)))(new Ge(q))(y.mpsSymbol(q)))((function(e){var n=y["mkSingletonValue'"](e)(t.value1);return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(de.lessThan(j.ordBigInt)(t.value2)(ye.zero(j.semiringBigInt))?i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(h.monadContract)))(new Ve(e,t.value1,t.value2))(n(pe.negate(j.ringBigInt)(t.value2))))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(sn)(Cn(me.strongFn))(yn(e)))((function(){return a.pure(l.applicativeExceptT(d.monadStateT(h.monadContract)))(Y.map(le.functorMaybe)(y.getNonAdaAsset)(n(t.value2)))}))})):i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(h.monadContract)))(new Ve(e,t.value1,t.value2))(n(t.value2)))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(sn)(bn(me.strongFn))(yn(e)))((function(){return a.pure(l.applicativeExceptT(d.monadStateT(h.monadContract)))(Y.map(le.functorMaybe)(y.getNonAdaAsset)(n(t.value2)))}))})))((function(e){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(le.semigroupMaybe(g.semigroupMint))((n=Rn(me.strongFn),t=g._mint(me.strongFn),function(e){return n(t(e))}))(Y.map(le.functorMaybe)(fe.wrap())(e));var n,t}))}))}))));if(t instanceof W.MustPayToPubKeyAddress)return i.bind(d.bindStateT(h.monadContract))(Bn)((function(e){var n=T.fromPlutusValue(t.value4);return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(Ae.for(l.applicativeExceptT(d.monadStateT(h.monadContract)))(Ae.traversableMaybe)(t.value2)((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(a.when(l.applicativeExceptT(d.monadStateT(h.monadContract)))(G.eq(W.eqDatumPresence)(e.value1)(W.DatumWitness.value))(xn(e.value0)))((function(){return a.pure(l.applicativeExceptT(d.monadStateT(h.monadContract)))(r(e.value0)(e.value1))}))})))((function(r){var o,a,u={address:function(){if(t.value1 instanceof le.Just)return L.payPubKeyHashBaseAddress(e)(t.value0)(t.value1.value0);if(t.value1 instanceof le.Nothing)return L.payPubKeyHashEnterpriseAddress(e)(t.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1234, column 21 - line 1236, column 68): "+[t.value1.constructor.name])}(),amount:n,datum:le.fromMaybe(N.NoOutputDatum.value)(r),scriptRef:t.value3};return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((o=Rn(me.strongFn),a=g._outputs(me.strongFn),function(e){return o(a(e))}))(z.cons(u)))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(sn)(bn(me.strongFn))(yn(n))}))})))}));if(t instanceof W.MustPayToScript)return i.bind(d.bindStateT(h.monadContract))(Bn)((function(e){var n,o,a,u,c=T.fromPlutusValue(t.value5);return l.runExceptT((a=r(t.value2)(t.value3),u={address:function(){if(t.value1 instanceof le.Nothing)return E.validatorHashEnterpriseAddress(e)(t.value0);if(t.value1 instanceof le.Just)return x.baseAddressToAddress(x.baseAddress({network:e,paymentCred:x.scriptHashCredential(fe.unwrap()(t.value0)),delegationCred:hn(t.value1.value0)}));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1252, column 24 - line 1258, column 20): "+[t.value1.constructor.name])}(),amount:c,datum:a,scriptRef:t.value4},i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((n=Rn(me.strongFn),o=g._outputs(me.strongFn),function(e){return n(o(e))}))(z.cons(u)))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(sn)(bn(me.strongFn))(yn(c))}))))}));if(t instanceof W.MustPayToNativeScript)return i.bind(d.bindStateT(h.monadContract))(Bn)((function(e){var n,r,o,a=T.fromPlutusValue(t.value2);return l.runExceptT((o={address:function(){if(t.value1 instanceof le.Nothing)return E.validatorHashEnterpriseAddress(e)(fe.wrap()(fe.unwrap()(t.value0)));if(t.value1 instanceof le.Just)return x.baseAddressToAddress(x.baseAddress({network:e,paymentCred:x.scriptHashCredential(fe.unwrap()(t.value0)),delegationCred:hn(t.value1.value0)}));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1273, column 24 - line 1280, column 20): "+[t.value1.constructor.name])}(),amount:a,datum:N.NoOutputDatum.value,scriptRef:le.Nothing.value},i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((n=Rn(me.strongFn),r=g._outputs(me.strongFn),function(e){return n(r(e))}))(z.cons(o)))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(sn)(bn(me.strongFn))(yn(a))}))))}));if(t instanceof W.MustHashDatum){var ae=C.datumHash(t.value1);return G.eq(O.eqDataHash)(ae)(t.value0)?xn(t.value1):a.pure(d.applicativeStateT(h.monadContract))(c.throwError(c.monadThrowEither)(new Qe(t.value0,t.value1)))}if(t instanceof W.MustRegisterStakePubKey)return l.runExceptT(Y.void(l.functorExceptT(d.functorStateT(h.functorContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(Pn(new g.StakeRegistration(x.keyHashCredential(fe.unwrap()(fe.unwrap()(t.value0))))))));if(t instanceof W.MustDeregisterStakePubKey)return l.runExceptT(Y.void(l.functorExceptT(d.functorStateT(h.functorContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(Pn(new g.StakeDeregistration(x.keyHashCredential(fe.unwrap()(fe.unwrap()(t.value0))))))));if(t instanceof W.MustRegisterStakeScript)return l.runExceptT(Y.void(l.functorExceptT(d.functorStateT(h.functorContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(Pn(new g.StakeRegistration(x.scriptHashCredential(fe.unwrap()(t.value0)))))));if(t instanceof W.MustDeregisterStakePlutusScript)return l.runExceptT((V=new g.StakeDeregistration(x.scriptHashCredential(fe.unwrap()(E.plutusScriptStakeValidatorHash(t.value0)))),i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(Pn(V)))((function(e){var n={tag:_.Cert.value,index:j.fromInt(e),data:fe.unwrap()(t.value1),exUnits:ye.zero(ye.semiringRecord()(ye.semiringRecordCons({reflectSymbol:function(){return"mem"}})()(ye.semiringRecordCons({reflectSymbol:function(){return"steps"}})()(ye.semiringRecordNil)(j.semiringBigInt))(j.semiringBigInt)))};return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(Sn(P.attachPlutusScript)(fe.unwrap()(t.value0)))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(Sn(P.attachRedeemer)(n))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(ge.semigroupArray)(Tn(me.strongFn))(z.singleton(new Se.Tuple(n,le.Nothing.value)))}))}))}))));if(t instanceof W.MustDeregisterStakeNativeScript)return i.discard(i.discardUnit)(d.bindStateT(h.monadContract))(Y.void(d.functorStateT(h.functorContract))(Pn(new g.StakeDeregistration(x.scriptHashCredential(fe.unwrap()(E.nativeScriptStakeValidatorHash(t.value0)))))))((function(){return Sn(P.attachNativeScript)(fe.unwrap()(t.value0))}));if(t instanceof W.MustRegisterPool)return l.runExceptT(Y.void(l.functorExceptT(d.functorStateT(h.functorContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(Pn(new g.PoolRegistration(t.value0)))));if(t instanceof W.MustRetirePool)return l.runExceptT(Y.void(l.functorExceptT(d.functorStateT(h.functorContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(Pn(new g.PoolRetirement({poolKeyHash:t.value0,epoch:t.value1})))));if(t instanceof W.MustDelegateStakePubKey)return l.runExceptT(Y.void(l.functorExceptT(d.functorStateT(h.functorContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(Pn(new g.StakeDelegation(x.keyHashCredential(fe.unwrap()(fe.unwrap()(t.value0))),t.value1)))));if(t instanceof W.MustDelegateStakePlutusScript)return l.runExceptT(function(){var e=new g.StakeDelegation(x.scriptHashCredential(fe.unwrap()(E.plutusScriptStakeValidatorHash(t.value0))),t.value2);return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(Pn(e)))((function(e){var n={tag:_.Cert.value,index:j.fromInt(e),data:fe.unwrap()(t.value1),exUnits:ye.zero(ye.semiringRecord()(ye.semiringRecordCons({reflectSymbol:function(){return"mem"}})()(ye.semiringRecordCons({reflectSymbol:function(){return"steps"}})()(ye.semiringRecordNil)(j.semiringBigInt))(j.semiringBigInt)))};return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(Sn(P.attachPlutusScript)(fe.unwrap()(t.value0)))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(Sn(P.attachRedeemer)(n))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(ge.semigroupArray)(Tn(me.strongFn))(z.singleton(new Se.Tuple(n,le.Nothing.value)))}))}))}))}());if(t instanceof W.MustDelegateStakeNativeScript)return i.discard(i.discardUnit)(d.bindStateT(h.monadContract))(Y.void(d.functorStateT(h.functorContract))(Pn(new g.StakeDelegation(x.scriptHashCredential(fe.unwrap()(E.nativeScriptStakeValidatorHash(t.value0))),t.value1))))((function(){return Sn(P.attachNativeScript)(fe.unwrap()(t.value0))}));if(t instanceof W.MustWithdrawStakePubKey)return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(Bn))((function(e){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(v.lift(d.monadTransStateT)(h.monadContract)(h.wrapQueryM(F.getPubKeyHashDelegationsAndRewards(t.value0)))))((function(n){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(a.pure(d.applicativeStateT(h.monadContract))(Q.note(new Ke(t.value0))(n)))((function(n){var r,o,a,u=U.stakePubKeyHashRewardAddress(e)(t.value0);return ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((r=Rn(me.strongFn),o=g._withdrawals(me.strongFn),a=re.non(ce.eqMap(U.eqRewardAddress)(y.eqCoin))(ce.empty)(ve.profunctorFn),function(e){return r(o(a(e)))}))(ce.union(U.ordRewardAddress)(ce.singleton(u)(le.fromMaybe(ye.zero(j.semiringBigInt))(n.rewards))))}))}))})));if(t instanceof W.MustWithdrawStakePlutusScript)return l.runExceptT((K=E.plutusScriptStakeValidatorHash(t.value0),i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(Bn))((function(e){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(v.lift(d.monadTransStateT)(h.monadContract)(h.wrapQueryM(F.getValidatorHashDelegationsAndRewards(K)))))((function(n){var r=U.stakeValidatorHashRewardAddress(e)(K);return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(a.pure(d.applicativeStateT(h.monadContract))(Q.note(new ze(t.value0))(n)))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((n=Rn(me.strongFn),o=g._withdrawals(me.strongFn),a=re.non(ce.eqMap(U.eqRewardAddress)(y.eqCoin))(ce.empty)(ve.profunctorFn),function(e){return n(o(a(e)))}))(ce.union(U.ordRewardAddress)(ce.singleton(r)(le.fromMaybe(ye.zero(j.semiringBigInt))(e.rewards)))))((function(){var e={tag:_.Reward.value,index:ye.zero(j.semiringBigInt),data:fe.unwrap()(t.value1),exUnits:ye.zero(ye.semiringRecord()(ye.semiringRecordCons({reflectSymbol:function(){return"mem"}})()(ye.semiringRecordCons({reflectSymbol:function(){return"steps"}})()(ye.semiringRecordNil)(j.semiringBigInt))(j.semiringBigInt)))};return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(Sn(P.attachPlutusScript)(fe.unwrap()(t.value0)))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(Sn(P.attachRedeemer)(e))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(ge.semigroupArray)(Tn(me.strongFn))(z.singleton(new Se.Tuple(e,le.Nothing.value)))}))}))}));var n,o,a}))}))}))));if(t instanceof W.MustWithdrawStakeNativeScript)return l.runExceptT(function(){var e=E.nativeScriptStakeValidatorHash(t.value0);return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(Bn))((function(n){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(v.lift(d.monadTransStateT)(h.monadContract)(h.wrapQueryM(F.getValidatorHashDelegationsAndRewards(e)))))((function(r){var o=U.stakeValidatorHashRewardAddress(n)(e);return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(a.pure(d.applicativeStateT(h.monadContract))(Q.note(new Je(t.value0))(r)))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((n=Rn(me.strongFn),r=g._withdrawals(me.strongFn),a=re.non(ce.eqMap(U.eqRewardAddress)(y.eqCoin))(ce.empty)(ve.profunctorFn),function(e){return n(r(a(e)))}))(ce.union(U.ordRewardAddress)(ce.singleton(o)(le.fromMaybe(ye.zero(j.semiringBigInt))(e.rewards)))))((function(){return Sn(P.attachNativeScript)(fe.unwrap()(t.value0))}));var n,r,a}))}))}))}());if(t instanceof W.MustSatisfyAnyOf)return i.bind(d.bindStateT(h.monadContract))(f.get(d.monadStateStateT(h.monadContract)))((function(r){var o=function(t){if(t instanceof ie.Nil)return a.pure(d.applicativeStateT(h.monadContract))(c.throwError(c.monadThrowEither)(un.value));if(t instanceof ie.Cons)return Z.foldM(ie.foldableList)(d.monadStateT(h.monadContract))((function(a){return function(a){return l.runExceptT((i=u.applySecond(d.applyStateT(h.monadContract))(f.put(d.monadStateStateT(h.monadContract))(r))(o(t.value1)),c.catchError(l.monadErrorExceptT(d.monadStateT(h.monadContract)))(c.catchError(d.monadErrorStateT(h.monadErrorErrorContract))(Un(e)(n)(a))((function(e){return i})))((function(e){return i}))));var i}}))(new Q.Right(Te.unit))(t.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1423, column 9 - line 1425, column 62): "+[t.constructor.name])};return o(z.toUnfoldable(ie.unfoldableList)(Y.map(Y.functorArray)(z.toUnfoldable(ie.unfoldableList))(t.value0)))}));if(t instanceof W.MustNotBeValid)return l.runExceptT(ue.assign(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((X=Mn(me.strongFn),$=g._isValid(me.strongFn),function(e){return X($(e))}))(!1));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1049, column 3 - line 1442, column 46): "+[t.constructor.name])}))}}},Hn=l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(En(te.strongForget)))((function(e){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((n=te.strongForget,ae.prop({reflectSymbol:function(){return"costModels"}})()()(Ce.SProxy.value)(n))))((function(n){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((t=Tn(te.strongForget),r=ne.to(Y.map(Y.functorArray)(Se.fst)),function(e){return t(r(e))})))((function(t){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((r=An(te.strongForget),o=K._transaction(te.strongForget),function(e){return r(o(e))})))((function(r){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(xe.liftEffect(d.monadEffectState(h.monadEffectContract))(Y.mapFlipped(De.functorEffect)(P.setScriptDataHash(n)(t)(e)(r))(Q.Right.create)))((function(e){return ue.assign(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(Mn(me.strongFn))(e)}))}));var r,o}));var t,r}));var n})));o.mintingPolicy=function(e){return fe.over()()(Pe)((function(n){return{mps:z.singleton(e),datums:n.datums,ownPaymentPubKeyHash:n.ownPaymentPubKeyHash,ownStakePubKeyHash:n.ownStakePubKeyHash,paymentPubKeyHashes:n.paymentPubKeyHashes,scripts:n.scripts,txOutputs:n.txOutputs,typedValidator:n.typedValidator}}))(se.mempty(dn))},o.mkUnbalancedTx=function(){return function(e){return function(n){return function(t){return function(r){return Y.mapFlipped(h.functorContract)(function(e){return function(n){return function(t){return function(r){return i.bind(h.bindContract)(Y.map(h.functorContract)(fe.unwrap())(w.getProtocolParameters))((function(o){var u={unbalancedTx:K.emptyUnbalancedTx,valueSpentBalancesInputs:{required:se.mempty(y.monoidValue),provided:se.mempty(y.monoidValue)},valueSpentBalancesOutputs:{required:se.mempty(y.monoidValue),provided:se.mempty(y.monoidValue)},datums:se.mempty(se.monoidArray),redeemersTxIns:se.mempty(se.monoidArray),mintRedeemers:ce.empty,lookups:t,refScriptsUtxoMap:ce.empty,costModels:o.costModels};return Y.map(h.functorContract)((function(e){return e.value0 instanceof Q.Left?new Q.Left(e.value0.value0):new Q.Right(e.value1)}))(X.flip(d.runStateT)(u)(function(e){return function(n){return function(t){var r=function(e){var n=Z.traverse_(l.applicativeExceptT(d.monadStateT(h.monadContract)))(Z.foldableArray)((function(n){return l.ExceptT(e(n))}));return function(e){return l.runExceptT(n(e))}};return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(Y.mapFlipped(l.functorExceptT(d.functorStateT(h.functorContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(Fn(te.strongForget)))(fe.unwrap()))((function(o){var u=Y.map(Y.functorArray)(E.validatorHash)(o.scripts),c=ce.fromFoldable(H.ordValidatorHash)(Z.foldableArray)(z.zip(u)(o.scripts)),s=Y.map(Y.functorArray)(E.mintingPolicyHash)(o.mps),f=ce.fromFoldable(H.ordMintingPolicyHash)(Z.foldableArray)(z.zip(s)(o.mps));return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(l.except(d.applicativeStateT(h.monadContract))(function(e){var n=z.partition((function(e){return e instanceof W.MustValidateIn}))(e),t=z.mapMaybe((function(e){return e instanceof W.MustValidateIn?new le.Just(e.value0):le.Nothing.value}))(n.yes);return i.bind(Q.bindEither)(Z.foldM(Z.foldableArray)(Q.monadEither)((function(e){return function(n){var t=k.intersection(k.ordPOSIXTime)(e)(n);return k.isEmpty(k.ordPOSIXTime)(t)?new Q.Left(new _e(e,n)):a.pure(Q.applicativeEither)(t)}}))(k.always(k.ordPOSIXTime))(t))((function(e){return a.pure(Q.applicativeEither)(z.cons(new W.MustValidateIn(e))(n.no))}))}(t.constraints)))((function(o){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(r(Un(f)(c))(o))((function(){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(Y.mapFlipped(l.functorExceptT(d.functorStateT(h.functorContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(Dn(te.strongForget)))(ce.toUnfoldable(Ie.unfoldableArray)))((function(o){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(h.monadContract))(Z.traverse_(d.applicativeStateT(h.monadContract))(Z.foldableArray)((a=Sn(P.attachRedeemer),function(e){return a(Se.snd(e))}))(o)))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(r(function(e){return function(n){return function(n){return function(n){return i.bind(d.bindStateT(h.monadContract))(Bn)((function(t){return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(Fn(te.strongForget)))((function(r){var o=Y.map(ce.functorMap)(I.fromPlutusTxOutputWithRefScript(t))(r.txOutputs);return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(h.monadContract)))(rn.value)(r.typedValidator))((function(r){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(v.lift(d.monadTransStateT)(h.monadContract)(Y.mapFlipped(h.functorContract)(V.typeTxOutRef()(e)(t)(X.flip(ce.lookup(O.ordTransactionInput))(o))(r)(n.txOutRef))(J.lmap(J.bifunctorEither)(nn.create))))((function(e){var t,r,o=V.typedTxOutRefValue()(e);return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((t=Rn(me.strongFn),r=g._inputs(me.strongFn),function(e){return t(r(e))}))(we.insert(O.ordTransactionInput)(n.txOutRef)))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(sn)(Cn(me.strongFn))(yn(o))}))}))}))})))}))}}}}(e)(n)(Re.Proxy.value))(t.ownInputs))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(r((n=e.ToData1(),function(e){return i.bind(d.bindStateT(h.monadContract))(v.lift(d.monadTransStateT)(h.monadContract)(b.getQueryHandle))((function(t){return i.bind(d.bindStateT(h.monadContract))(Bn)((function(r){return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(Fn(te.strongForget)))((function(o){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(h.monadContract)))(rn.value)(o.typedValidator))((function(o){var a=T.fromPlutusValue(e.value),u=V.mkTypedTxOut()(n)(r)(o)(e.datum)(a),c=V.typedTxOutTxOut()(u);return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(h.monadContract)))(tn.value)(V.typedTxOutDatumHash()(u)))((function(e){return i.bind(l.bindExceptT(d.monadStateT(h.monadContract)))(Ee.liftAff(Ee.monadAffState(h.monadAffContract))(Y.mapFlipped(Fe.functorAff)(t.getDatumByHash(e))((n=Q.note(new Ne(e)),r=i.join(le.bindMaybe),function(e){return n(r(Q.hush(e)))}))))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))((n=Rn(me.strongFn),t=g._outputs(me.strongFn),function(e){return n(t(e))}))(z.cons(c)))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(xn(e))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(h.monadContract)))(sn)(bn(me.strongFn))(yn(a))}))}));var n,t}));var n,r}))}))})))}))}))}))(t.ownOutputs))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(Hn)((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(h.monadContract)))(kn)((function(){return Ln}))}))}));var n}))}));var a}))}))}))})))}}}(e)(n)(r)))}))}}}}(e)(n)(t)(r))(Y.map(Q.functorEither)((function(e){var n,t,r,o,a=function(e){return ue.over((n=K._transaction(me.strongFn),t=g._witnessSet(me.strongFn),function(e){return n(t(e))}))(fe.over()()(g.TransactionWitnessSet)((function(e){return{plutusData:le.Nothing.value,redeemers:le.Nothing.value,bootstraps:e.bootstraps,nativeScripts:e.nativeScripts,plutusScripts:e.plutusScripts,vkeys:e.vkeys}})))(e);var n,t}((n=e.unbalancedTx,ue.set((t=K._transaction(me.strongFn),r=g._body(me.strongFn),o=g._scriptDataHash(me.strongFn),function(e){return t(r(o(e)))}))(le.Nothing.value)(n)));return fe.wrap()({unbalancedTx:a,datums:e.datums,redeemersTxIns:e.redeemersTxIns})})))}}}}},o.unspentOutputs=function(e){return fe.over()()(Pe)((function(n){return{txOutputs:e,datums:n.datums,mps:n.mps,ownPaymentPubKeyHash:n.ownPaymentPubKeyHash,ownStakePubKeyHash:n.ownStakePubKeyHash,paymentPubKeyHashes:n.paymentPubKeyHashes,scripts:n.scripts,typedValidator:n.typedValidator}}))(se.mempty(dn))},o.semigroupScriptLookups=fn,o.showUnattachedUnbalancedT=vn,o.showMkUnbalancedTxError=pn}(c),function(e){"use strict";e["Contract.ScriptLookups"]=e["Contract.ScriptLookups"]||{};var n=e["Contract.ScriptLookups"],t=e["Ctl.Internal.Types.ScriptLookups"];n.mkUnbalancedTx=function(){return function(e){return function(n){return t.mkUnbalancedTx()(e)(n)}}}}(c),function(e){"use strict";e["Ctl.Internal.ReindexRedeemers"]=e["Ctl.Internal.ReindexRedeemers"]||{};var n=e["Ctl.Internal.ReindexRedeemers"],t=e["Control.Bind"],r=e["Ctl.Internal.Cardano.Types.Transaction"],o=e["Ctl.Internal.Types.RedeemerTag"],a=e["Ctl.Internal.Types.Transaction"],u=e["Data.Array"],i=e["Data.BigInt"],c=e["Data.Either"],l=e["Data.Functor"],s=e["Data.Maybe"],f=e["Data.Show.Generic"],d=e["Data.Traversable"],v=e["Data.Tuple"],m=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),p={to:function(e){return new m(e)},from:function(e){return e.value0}},g={show:f.genericShow(p)(f.genericShowConstructor(f.genericShowArgsArgument(r.showRedeemer))({reflectSymbol:function(){return"CannotGetTxOutRefIndexForRedeemer"}}))};n["reindexSpentScriptRedeemers'"]=function(e){return function(n){var r;return d.traverse(d.traversableArray)(c.applicativeEither)((r=e,function(e){return e.value0.tag instanceof o.Spend&&e.value1 instanceof s.Just?t.bind(c.bindEither)(c.note(new m(e.value0))(l.map(s.functorMaybe)(i.fromInt)(u.elemIndex(a.eqTransactionInput)(e.value1.value0)(r))))((function(n){return new c.Right(new v.Tuple({tag:e.value0.tag,index:n,data:e.value0.data,exUnits:e.value0.exUnits},new s.Just(e.value1.value0)))})):new c.Right(new v.Tuple(e.value0,e.value1))}))(n)}},n.showReindexErrors=g}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.Error"]=e["Ctl.Internal.BalanceTx.Error"]||{};var n=e["Ctl.Internal.BalanceTx.Error"],t=e["Control.Bind"],r=e["Control.Category"],o=e["Ctl.Internal.Plutus.Types.Value"],a=e["Ctl.Internal.QueryM.Ogmios"],u=e["Ctl.Internal.ReindexRedeemers"],i=e["Ctl.Internal.Types.Natural"],c=e["Ctl.Internal.Types.PlutusData"],l=e["Ctl.Internal.Types.RedeemerTag"],s=e["Ctl.Internal.Types.ScriptLookups"],f=e["Ctl.Internal.Types.Transaction"],d=e["Data.Array"],v=e["Data.Bifunctor"],m=e["Data.BigInt"],p=e["Data.Either"],g=e["Data.Eq"],y=e["Data.EuclideanRing"],w=e["Data.Foldable"],h=e["Data.FoldableWithIndex"],b=e["Data.Function"],C=e["Data.Functor"],A=e["Data.Generic.Rep"],S=e["Data.Int"],I=e["Data.Map.Internal"],T=e["Data.Maybe"],D=e["Data.Monoid"],F=e["Data.Semigroup"],E=e["Data.Semiring"],x=e["Data.Show"],M=e["Data.Show.Generic"],R=e["Data.String.CodePoints"],P=e["Data.String.Common"],B=e["Data.String.Utils"],k=e["Data.Tuple"],N=function(){function e(){}return e.value=new e,e}(),L=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),_=function(){function e(){}return e.value=new e,e}(),U=function(){function e(){}return e.value=new e,e}(),H=function(){function e(){}return e.value=new e,e}(),q=function(){function e(){}return e.value=new e,e}(),O=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),W=function(){function e(){}return e.value=new e,e}(),V=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),K=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),z=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),J=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),j=function(){function e(){}return e.value=new e,e}(),Q={show:M.genericShow({to:function(e){return e},from:function(e){return e}})(M.genericShowConstructor(M.genericShowArgsArgument(o.showValue))({reflectSymbol:function(){return"InvalidInContext"}}))},G={to:function(e){return N.value},from:function(e){return A.NoArguments.value}},Z={show:M.genericShow(G)(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"Impossible"}}))},X={show:M.genericShow({to:function(e){return e},from:function(e){return e}})(M.genericShowConstructor(M.genericShowArgsArgument(o.showValue))({reflectSymbol:function(){return"Expected"}}))},Y={to:function(e){if(e instanceof A.Inl)return new L(e.value0.value0,e.value0.value1.value0,e.value0.value1.value1);if(e instanceof A.Inr&&e.value0 instanceof A.Inl)return _.value;if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inl)return U.value;if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inl)return H.value;if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inl)return q.value;if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inl)return new O(e.value0.value0.value0.value0.value0.value0);if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof A.Inl)return W.value;if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inl)return new V(e.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value1);if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inl)return new K(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1);if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inl)return new z(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inl)return new J(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr)return j.value;throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Error (line 84, column 1 - line 84, column 41): "+[e.constructor.name])},from:function(e){if(e instanceof L)return new A.Inl(new A.Product(e.value0,new A.Product(e.value1,e.value2)));if(e instanceof _)return new A.Inr(new A.Inl(A.NoArguments.value));if(e instanceof U)return new A.Inr(new A.Inr(new A.Inl(A.NoArguments.value)));if(e instanceof H)return new A.Inr(new A.Inr(new A.Inr(new A.Inl(A.NoArguments.value))));if(e instanceof q)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(A.NoArguments.value)))));if(e instanceof O)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(e.value0))))));if(e instanceof W)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(A.NoArguments.value)))))));if(e instanceof V)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(new A.Product(e.value0,e.value1)))))))));if(e instanceof K)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(new A.Product(e.value0,e.value1))))))))));if(e instanceof z)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(e.value0))))))))));if(e instanceof J)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(e.value0)))))))))));if(e instanceof j)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(A.NoArguments.value)))))))))));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Error (line 84, column 1 - line 84, column 41): "+[e.constructor.name])}},$={show:M.genericShow({to:function(e){return e},from:function(e){return e}})(M.genericShowConstructor(M.genericShowArgsArgument(o.showValue))({reflectSymbol:function(){return"Actual"}}))},ee=function(e){return C.map(C.functorArray)(p.either(p.Right.create)(p.Right.create))(e)},ne=function(e){var n=C.map(C.functorArray)((function(e){return p.Left.create(function(e){return e+"\n"}(e))}))(P.split("\n")(e)),t=d.uncons(n);if(t instanceof T.Nothing)return[];if(t instanceof T.Just)return F.append(F.semigroupArray)([t.value0.head])(ee(t.value0.tail));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Error (line 140, column 3 - line 142, column 51): "+[t.constructor.name])},te=function(e){return ee(C.map(C.functorArray)(v.bimap(v.bifunctorEither)((function(e){return"- "+e}))((function(e){return" "+e})))(e))},re=function(e){return function(n){var o,u=function(n){return F.append(F.semigroupArray)(function(e){return ne(x.show(l.showRedeemerTag)(e.redeemerTag)+":"+m.toString(i.toBigInt(e.redeemerIndex)))}(n))(te(function(n){var r=function(n){return b.flip(w.find(w.foldableArray))(e.redeemersTxIns)((function(e){return g.eq(l.eqRedeemerTag)(e.value0.tag)(n.redeemerTag)&&g.eq(m.eqBigInt)(e.value0.index)(i.toBigInt(n.redeemerIndex))}))}(n),o=C.mapFlipped(T.functorMaybe)(t.bind(T.bindMaybe)(r)(k.snd))((function(e){return"Input: "+x.show(f.showTransactionInput)(e)})),a=C.mapFlipped(T.functorMaybe)(r)((function(e){return"Redeemer: "+x.show(c.showPlutusData)(e.value0.data)}));return w.foldMap(w.foldableArray)(D.monoidArray)(ne)(d.catMaybes([a,o]))}(n)))},s=function(e){if(e instanceof a.ExtraRedeemers)return F.append(F.semigroupArray)(ne("Extra redeemers:"))(te(w.foldMap(w.foldableArray)(D.monoidArray)(u)(e.value0)));if(e instanceof a.MissingRequiredDatums)return F.append(F.semigroupArray)(ne("Supplied with datums:"))(F.append(F.semigroupArray)(te(w.foldMap(w.foldableMaybe)(D.monoidArray)(w.foldMap(w.foldableArray)(D.monoidArray)(ne))(e.value0.provided)))(F.append(F.semigroupArray)(ne("But missing required datums:"))(te(w.foldMap(w.foldableArray)(D.monoidArray)(ne)(e.value0.missing)))));if(e instanceof a.MissingRequiredScripts)return F.append(F.semigroupArray)(ne("Supplied with scripts:"))(F.append(F.semigroupArray)(te(h.foldMapWithIndex(I.foldableWithIndexMap)(D.monoidArray)((function(e){return function(n){return F.append(F.semigroupArray)(u(e))(ne("Script: "+n))}}))(e.value0.resolved)))(F.append(F.semigroupArray)(ne("But missing required scripts:"))(te(w.foldMap(w.foldableArray)(D.monoidArray)(ne)(e.value0.missing)))));if(e instanceof a.ValidatorFailed)return F.append(F.semigroupArray)(ne(e.value0.error))(F.append(F.semigroupArray)(ne("Trace:"))((n=w.foldMap(w.foldableArray)(D.monoidArray)(ne)(e.value0.traces),t=S.toStringAs(S.decimal)(w.length(w.foldableArray)(E.semiringInt)(d.filter(p.isLeft)(n)))+". ",r=2*S.ceil(S.toNumber(R.length(t))/2)|0,o=b.applyN((function(e){return" "+e}))(y.div(y.euclideanRingInt)(r)(2)),ee(w.foldl(w.foldableArray)((function(e){return function(n){return F.append(F.semigroupArray)(e)([v.bimap(v.bifunctorEither)((t=w.length(w.foldableArray)(E.semiringInt)(e),function(e){return B.padEnd(r)(S.toStringAs(S.decimal)(t+1|0)+". ")+e}))(o)(n)]);var t}}))([])(n)))));var n,t,r,o;if(e instanceof a.UnknownInputReferencedByRedeemer)return ne("Unknown input referenced by redeemer: "+x.show(x.showRecord()(x.showRecordFieldsCons({reflectSymbol:function(){return"index"}})(x.showRecordFieldsCons({reflectSymbol:function(){return"txId"}})(x.showRecordFieldsNil)(x.showString))(x.showInt)))(e.value0));if(e instanceof a.NonScriptInputReferencedByRedeemer)return ne("Non script input referenced by redeemer: "+x.show(x.showRecord()(x.showRecordFieldsCons({reflectSymbol:function(){return"index"}})(x.showRecordFieldsCons({reflectSymbol:function(){return"txId"}})(x.showRecordFieldsNil)(x.showString))(x.showInt)))(e.value0));if(e instanceof a.IllFormedExecutionBudget&&e.value0 instanceof T.Nothing)return ne("Ill formed execution budget: Execution budget missing");if(e instanceof a.IllFormedExecutionBudget&&e.value0 instanceof T.Just)return F.append(F.semigroupArray)(ne("Ill formed execution budget:"))(te(F.append(F.semigroupArray)(ne("Memory: "+m.toString(i.toBigInt(e.value0.value0.memory))))(ne("Steps: "+m.toString(i.toBigInt(e.value0.value0.steps))))));if(e instanceof a.NoCostModelForLanguage)return ne('No cost model for language "'+e.value0+'"');throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Error (line 209, column 24 - line 242, column 60): "+[e.constructor.name])},A=function(e){return function(n){return F.append(F.semigroupArray)(u(e))(te(w.foldMap(w.foldableArray)(D.monoidArray)(s)(n)))}};return o=function(){if(n instanceof a.UnparsedError)return ne("Unknown error: "+n.value0);if(n instanceof a.ScriptFailures)return F.append(F.semigroupArray)(ne("Script failures:"))(te(h.foldMapWithIndex(I.foldableWithIndexMap)(D.monoidArray)(A)(n.value0)));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Error (line 173, column 21 - line 176, column 48): "+[n.constructor.name])}(),P.joinWith("")(C.map(C.functorArray)(p.either(r.identity(r.categoryFn))(r.identity(r.categoryFn)))(o))}},oe={show:function(e){return e instanceof V?"ExUnitsEvaluationFailed: "+re(e.value0)(e.value1):M.genericShow(Y)(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsProduct(M.genericShowArgsArgument(X))(M.genericShowArgsProduct(M.genericShowArgsArgument($))(M.genericShowArgsArgument(Q))))({reflectSymbol:function(){return"BalanceInsufficientError"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"CouldNotConvertScriptOutputToTxInput"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"CouldNotGetChangeAddress"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"CouldNotGetCollateral"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"CouldNotGetUtxos"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsArgument(x.showString))({reflectSymbol:function(){return"CollateralReturnError"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"CollateralReturnMinAdaValueCalcError"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsProduct(M.genericShowArgsArgument(s.showUnattachedUnbalancedT))(M.genericShowArgsArgument(a.showTxEvaluationFailure)))({reflectSymbol:function(){return"ExUnitsEvaluationFailed"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsProduct(M.genericShowArgsArgument(Z))(M.genericShowArgsArgument(x.showString)))({reflectSymbol:function(){return"InsufficientUtxoBalanceToCoverAsset"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsArgument(u.showReindexErrors))({reflectSymbol:function(){return"ReindexRedeemersError"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsArgument(f.showTransactionInput))({reflectSymbol:function(){return"UtxoLookupFailedFor"}}))(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"UtxoMinAdaValueCalculationFailed"}})))))))))))))(e)}};n.BalanceInsufficientError=L,n.CouldNotGetChangeAddress=U,n.CouldNotGetCollateral=H,n.CouldNotGetUtxos=q,n.CollateralReturnError=O,n.CollateralReturnMinAdaValueCalcError=W,n.ExUnitsEvaluationFailed=V,n.InsufficientUtxoBalanceToCoverAsset=K,n.ReindexRedeemersError=z,n.UtxoLookupFailedFor=J,n.UtxoMinAdaValueCalculationFailed=j,n.Impossible=N,n.showBalanceTxError=oe}(c),function(e){"use strict";e.random=Math.random}(c["Effect.Random"]=c["Effect.Random"]||{}),function(e){"use strict";e["Effect.Random"]=e["Effect.Random"]||{};var n=e["Effect.Random"],t=e["Effect.Random"],r=e["Data.Int"];n.randomInt=function(e){return function(n){return function(){var o=t.random(),a=(r.toNumber(n)-r.toNumber(e)+1)*o+r.toNumber(e);return r.floor(a)}}}}(c),function(e){"use strict";e["Ctl.Internal.CoinSelection.UtxoIndex"]=e["Ctl.Internal.CoinSelection.UtxoIndex"]||{};var n,t,r,o,a=e["Ctl.Internal.CoinSelection.UtxoIndex"],u=e["Control.Applicative"],i=e["Ctl.Internal.Cardano.Types.Value"],c=e["Ctl.Internal.Types.Transaction"],l=e["Data.Array"],s=e["Data.Boolean"],f=e["Data.Eq"],d=e["Data.Foldable"],v=e["Data.Function"],m=e["Data.Functor"],p=e["Data.Lens.Getter"],g=e["Data.Lens.Internal.Forget"],y=e["Data.Lens.Iso"],w=e["Data.Lens.Record"],h=e["Data.Lens.Setter"],b=e["Data.Map.Internal"],C=e["Data.Maybe"],A=e["Data.Newtype"],S=e["Data.Ord"],I=e["Data.Ordering"],T=e["Data.Profunctor.Strong"],D=e["Data.Set"],F=e["Data.Tuple"],E=e["Data.Unfoldable"],x=e["Effect.Class"],M=e["Effect.Random"],R=e["Type.Proxy"],P=function(){function e(){}return e.value=new e,e}(),B=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),k=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),N=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),L=function(){function e(){}return e.value=new e,e}(),_=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),U=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),H=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),q=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),O=function(e){return e},W={eq:function(e){return function(n){return e instanceof L&&n instanceof L||e instanceof _&&n instanceof _&&f.eq(i.eqAssetClass)(e.value0)(n.value0)}}},V={compare:function(e){return function(n){if(e instanceof L&&n instanceof L)return I.EQ.value;if(e instanceof L)return I.LT.value;if(n instanceof L)return I.GT.value;if(e instanceof _&&n instanceof _)return S.compare(i.ordAssetClass)(e.value0)(n.value0);throw new Error("Failed pattern match at Ctl.Internal.CoinSelection.UtxoIndex (line 116, column 1 - line 116, column 26): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return W}},K=(n=D.fromFoldable(d.foldableArray)(i.ordAssetClass),t=A.unwrap(),function(e){return n(i.valueAssetClasses(t(e).amount))}),z={indexAnyWith:b.empty,indexSingletons:b.empty,indexPairs:b.empty,utxos:b.empty},J=function(e){return y.iso((function(e){return e}))(O)(e)},j=function(e){var n=J(e.Profunctor0()),t=w.prop({reflectSymbol:function(){return"indexAnyWith"}})()()(R.Proxy.value)(e);return function(e){return n(t(e))}},Q=function(e){var n=J(e.Profunctor0()),t=w.prop({reflectSymbol:function(){return"indexPairs"}})()()(R.Proxy.value)(e);return function(e){return n(t(e))}},G=function(e){var n=J(e.Profunctor0()),t=w.prop({reflectSymbol:function(){return"indexSingletons"}})()()(R.Proxy.value)(e);return function(e){return n(t(e))}},Z=function(e){return function(n){var t=function(e){var n=K(e),t=D.toUnfoldable(E.unfoldableArray)(n);return 0===t.length?P.value:1===t.length?new B(t[0]):2===t.length?new k(t[0],t[1]):new N(n)}(e);if(t instanceof P)return h.over(G(T.strongFn))(n(L.value));if(t instanceof B){var r=h.over(Q(T.strongFn))(n(L.value)),o=h.over(G(T.strongFn))(n(new _(t.value0)));return function(e){return r(o(e))}}if(t instanceof k){var a=h.over(j(T.strongFn))(n(L.value)),u=h.over(Q(T.strongFn))(n(new _(t.value0))),i=h.over(Q(T.strongFn))(n(new _(t.value1)));return function(e){return a(u(i(e)))}}if(t instanceof N){var c=h.over(j(T.strongFn))(v.flip(d.foldl(D.foldableSet)(v.flip((function(e){return n(_.create(e))}))))(t.value0)),l=h.over(j(T.strongFn))(n(L.value));return function(e){return c(l(e))}}throw new Error("Failed pattern match at Ctl.Internal.CoinSelection.UtxoIndex (line 204, column 3 - line 216, column 57): "+[t.constructor.name])}},X=function(e){var n=J(e.Profunctor0()),t=w.prop({reflectSymbol:function(){return"utxos"}})()()(R.Proxy.value)(e);return function(e){return n(t(e))}},Y=function(e){var n,t=b.update(V)((n=b.delete(c.ordTransactionInput)(e.value0),function(e){return C.Just.create(n(e))})),r=h.over(X(T.strongFn))(b.delete(c.ordTransactionInput)(e.value0)),o=Z(e.value1)(t);return function(e){return r(o(e))}},$=(r=l.foldl(v.flip((function(e){var n,t=b.alter(V)((n=C.maybe(b.singleton(e.value0)(e.value1))(b.insert(c.ordTransactionInput)(e.value0)(e.value1)),function(e){return C.Just.create(n(e))})),r=h.over(X(T.strongFn))(b.insert(c.ordTransactionInput)(e.value0)(e.value1)),o=Z(e.value1)(t);return function(e){return r(o(e))}})))(z),o=b.toUnfoldable(E.unfoldableArray),function(e){return r(o(e))}),ee=p.view(X(g.strongForget));a.Asset=_,a.AssetLovelace=L,a.SelectAnyWith=q,a.SelectPairWith=H,a.SelectSingleton=U,a.buildUtxoIndex=$,a.emptyUtxoIndex=z,a.selectRandomWithFilter=function(e){return function(n){return function(t){var r=function(){var e=function(e){return function(t){return C.fromMaybe(b.empty)(b.lookup(V)(e)(p.viewOn(n)(t(g.strongForget))))}};if(t instanceof U)return e(t.value0)((function(e){return G(e)}));if(t instanceof H)return e(t.value0)((function(e){return Q(e)}));if(t instanceof q)return e(t.value0)((function(e){return j(e)}));throw new Error("Failed pattern match at Ctl.Internal.CoinSelection.UtxoIndex (line 281, column 5 - line 287, column 41): "+[t.constructor.name])}();return m.mapFlipped(e.Monad0().Bind1().Apply0().Functor0())(function(e){return function(n){if(b.isEmpty(n))return u.pure(e.Monad0().Applicative0())(C.Nothing.value);if(s.otherwise)return x.liftEffect(e)((function(){var e=M.randomInt(0)(b.size(n)-1|0)();return l.index(b.toUnfoldable(E.unfoldableArray)(n))(e)}));throw new Error("Failed pattern match at Ctl.Internal.CoinSelection.UtxoIndex (line 322, column 1 - line 326, column 24): "+[n.constructor.name])}}(e)(r))(m.map(C.functorMaybe)((function(e){return new F.Tuple(e,Y(e)(n))})))}}},a.utxoIndexDeleteEntry=Y,a.utxoIndexUniverse=ee}(c),function(e){"use strict";e["Data.Map"]=e["Data.Map"]||{};var n,t=e["Data.Map"],r=e["Data.Functor"],o=e["Data.Map.Internal"],a=e["Data.Set"],u=(n=r.void(o.functorMap),function(e){return a.fromMap(n(e))});t.keys=u}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.CoinSelection"]=e["Ctl.Internal.BalanceTx.CoinSelection"]||{};var n,t,r,o,a,u=e["Ctl.Internal.BalanceTx.CoinSelection"],i=e["Control.Applicative"],c=e["Control.Bind"],l=e["Control.Monad.Error.Class"],s=e["Ctl.Internal.BalanceTx.Error"],f=e["Ctl.Internal.Cardano.Types.Value"],d=e["Ctl.Internal.CoinSelection.UtxoIndex"],v=e["Ctl.Internal.Plutus.Conversion.Value"],m=e["Ctl.Internal.Types.ByteArray"],p=e["Ctl.Internal.Types.TokenName"],g=e["Ctl.Internal.Types.Transaction"],y=e["Data.Array"],w=e["Data.Array.NonEmpty"],h=e["Data.Array.NonEmpty.Internal"],b=e["Data.BigInt"],C=e["Data.Boolean"],A=e["Data.Foldable"],S=e["Data.Function"],I=e["Data.Functor"],T=e["Data.Lens.Getter"],D=e["Data.Lens.Internal.Forget"],F=e["Data.Lens.Iso.Newtype"],E=e["Data.Lens.Record"],x=e["Data.Lens.Setter"],M=e["Data.Map"],R=e["Data.Map.Internal"],P=e["Data.Maybe"],B=e["Data.Monoid"],k=e["Data.Newtype"],N=e["Data.Ord"],L=e["Data.Profunctor.Strong"],_=e["Data.Ring"],U=e["Data.Semiring"],H=e["Data.Set"],q=e["Data.Show"],O=e["Data.Tuple"],W=e["Type.Proxy"],V=function(){function e(){}return e.value=new e,e}(),K=function(){function e(){}return e.value=new e,e}(),z=function(){function e(){}return e.value=new e,e}(),J=function(){function e(){}return e.value=new e,e}(),j=function(e){return function(n){var t="tn: "+m.byteArrayToHex(p.getTokenName(e.value1))+", ",r="quantity: "+b.toString(n)+"))";return"(Asset (cs: "+m.byteArrayToHex(f.getCurrencySymbol(e.value0))+", "+(t+r)}},Q=function(e){return function(n){return function(t){return function(t){var r,o=w.fromArray(t.tail);if(o instanceof P.Nothing)return d.selectRandomWithFilter(e)(n)(t.head);if(o instanceof P.Just)return c.bindFlipped(e.Monad0().Bind1())(P["maybe'"]((function(t){return Q(e)(n)(o.value0)}))((r=i.pure(e.Monad0().Applicative0()),function(e){return r(P.Just.create(e))})))(d.selectRandomWithFilter(e)(n)(t.head));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 454, column 5 - line 459, column 54): "+[o.constructor.name])}(w.uncons(t))}}},G=function(e){return function(n){return function(t){if(N.lessThan(b.ordBigInt)(n.currentQuantity(t))(n.requiredQuantity)){var r=new s.InsufficientUtxoBalanceToCoverAsset(s.Impossible.value,n.assetDisplayString);return c.bind(e.Monad0().Bind1())(n.selectQuantityCover(t))(P.maybe(l.throwError(e)(r))((o=i.pure(e.Monad0().Applicative0()),function(e){return o(P.Just.create(e))})))}var o,a;if(C.otherwise){var u=function(){if(n.selectionStrategy instanceof K)return 1;if(n.selectionStrategy instanceof V)return 2;throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 381, column 9 - line 383, column 40): "+[n.selectionStrategy.constructor.name])}(),f=U.mul(b.semiringBigInt)(n.requiredQuantity)(b.fromInt(u)),d=(a=_.sub(b.ringBigInt)(f),function(e){return b.abs(a(n.currentQuantity(e)))}),v=function(e){if(N.lessThan(b.ordBigInt)(d(e))(d(t)))return new P.Just(e);if(C.otherwise)return P.Nothing.value;throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 370, column 7 - line 370, column 67): "+[e.constructor.name])};return I.map(e.Monad0().Bind1().Apply0().Functor0())((function(e){return c.bindFlipped(P.bindMaybe)(v)(e)}))(n.selectQuantityImprove(t))}throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 348, column 1 - line 353, column 30): "+[n.constructor.name,t.constructor.name])}}},Z=(n=k.wrap(),function(e){return n({leftoverUtxos:e,selectedUtxos:R.empty})}),X=(Z(d.emptyUtxoIndex),A.foldMap(R.foldableMap)(f.monoidValue)((t=k.unwrap(),function(e){return t(e).amount}))),Y=(r=k.unwrap(),function(e){return X(r(e).selectedUtxos)}),$=function(e){return f["valueToCoin'"](Y(e))},ee=function(e){var n=F._Newtype()()(e.Profunctor0()),t=E.prop({reflectSymbol:function(){return"selectedUtxos"}})()()(W.Proxy.value)(e);return function(e){return n(t(e))}},ne=(o=H.fromFoldable(H.foldableSet)(g.ordTransactionInput),a=T.view(ee(D.strongForget)),function(e){return o(M.keys(a(e)))}),te=function(e){var n=F._Newtype()()(e.Profunctor0()),t=E.prop({reflectSymbol:function(){return"leftoverUtxos"}})()()(W.Proxy.value)(e);return function(e){return n(t(e))}},re=function(e){var n=x.over(ee(L.strongFn))(R.insert(g.ordTransactionInput)(e.value0)(e.value1)),t=x.over(te(L.strongFn))(d.utxoIndexDeleteEntry(e));return function(e){return n(t(e))}},oe=function(e){return function(n){return function(t){return function(r){var o,a=(o=S.flip(re)(r),function(e){return o(O.fst(e))}),u=function(e){return function(n){if(n instanceof z)return I.map(h.functorNonEmptyArray)(S.applyFlipped(e))(w["cons'"](d.SelectSingleton.create)([d.SelectPairWith.create,d.SelectAnyWith.create]));if(n instanceof J)return w.singleton(new d.SelectSingleton(e));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 437, column 3 - line 442, column 48): "+[n.constructor.name])}}(n)(t);return I.map(e.Monad0().Bind1().Apply0().Functor0())(I.map(P.functorMaybe)(a))(Q(e)(T.viewOn(r)(te(D.strongForget)))(u))}}}};u.SelectionStrategyOptimal=V,u._leftoverUtxos=te,u.performMultiAssetSelection=function(e){return function(n){return function(t){return function(r){return function(o){var a,u,m,p,g,w,h=(m=G(n)(function(e){return function(n){return function(t){return{assetDisplayString:q.show(f.showCoin)(t),currentQuantity:$,requiredQuantity:k.unwrap()(t),selectQuantityCover:oe(e)(d.AssetLovelace.value)(z.value),selectQuantityImprove:oe(e)(d.AssetLovelace.value)(J.value),selectionStrategy:n}}}}(e)(t)(f.valueToCoin(o))),p=f.valueAssets(o),a=G(n),u=function(e){return function(n){return function(t){return{assetDisplayString:j(t.value0)(t.value1),currentQuantity:(r=t.value0,o=f.getAssetQuantity(r),function(e){return o(Y(e))}),requiredQuantity:t.value1,selectQuantityCover:oe(e)(new d.Asset(t.value0))(z.value),selectQuantityImprove:oe(e)(new d.Asset(t.value0))(J.value),selectionStrategy:n};var r,o}}}(e)(t),g=function(e){return a(u(e))},y.snoc(I.map(I.functorArray)(g)(p))(m)),b=X(d.utxoIndexUniverse(r)),C=new s.BalanceInsufficientError(v.toPlutusValue(o),v.toPlutusValue(b),v.toPlutusValue(B.mempty(f.monoidValue))),A=f.leq(o)(b);if(A)return(w=e.Monad0(),function(e){return function(n){var t=function(e){return function(n){return function(r){if(0===n.length&&0===r.length)return i.pure(w.Applicative0())(e);var o=y.uncons(n);if(o instanceof P.Nothing)return t(e)(r)([]);if(o instanceof P.Just)return c.bind(w.Bind1())(o.value0.head(e))((function(n){if(n instanceof P.Nothing)return t(e)(o.value0.tail)(r);if(n instanceof P.Just)return t(n.value0)(o.value0.tail)(y.snoc(r)(o.value0.head));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 422, column 17 - line 424, column 49): "+[n.constructor.name])}));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 419, column 5 - line 424, column 49): "+[o.constructor.name])}}};return t(e)(n)([])}})(Z(r))(h);if(!A)return l.throwError(n)(C);throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 134, column 3 - line 138, column 42): "+[A.constructor.name])}}}}},u.selectedInputs=ne}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.Constraints"]=e["Ctl.Internal.BalanceTx.Constraints"]||{};var n,t,r,o,a,u=e["Ctl.Internal.BalanceTx.Constraints"],i=e["Ctl.Internal.BalanceTx.CoinSelection"],c=e["Ctl.Internal.Plutus.Conversion.Address"],l=e["Ctl.Internal.Types.Transaction"],s=e["Data.Function"],f=e["Data.Lens.Iso.Newtype"],d=e["Data.Lens.Record"],v=e["Data.Lens.Setter"],m=e["Data.Map.Internal"],p=e["Data.Maybe"],g=e["Data.Monoid"],y=e["Data.Newtype"],w=e["Data.Profunctor.Strong"],h=e["Data.Set"],b=e["Type.Proxy"],C=(n=y.wrap()({additionalUtxos:m.empty,maxChangeOutputTokenQuantity:p.Nothing.value,nonSpendableInputs:g.mempty(h.monoidSet(l.ordTransactionInput)),srcAddresses:p.Nothing.value,changeAddress:p.Nothing.value,selectionStrategy:i.SelectionStrategyOptimal.value}),t=s.applyFlipped(n),r=y.unwrap(),function(e){return t(r(e))}),A=function(e){var n=f._Newtype()()(e.Profunctor0()),t=d.prop({reflectSymbol:function(){return"changeAddress"}})()()(b.Proxy.value)(e);return function(e){return n(t(e))}},S=(o=y.wrap(),a=v.setJust(A(w.strongFn)),function(e){return o(a(c.fromPlutusAddressWithNetworkTag(e)))});u.buildBalanceTxConstraints=C,u.mustSendChangeToAddress=S,u._additionalUtxos=function(e){var n=f._Newtype()()(e.Profunctor0()),t=d.prop({reflectSymbol:function(){return"additionalUtxos"}})()()(b.Proxy.value)(e);return function(e){return n(t(e))}},u._changeAddress=A,u._maxChangeOutputTokenQuantity=function(e){var n=f._Newtype()()(e.Profunctor0()),t=d.prop({reflectSymbol:function(){return"maxChangeOutputTokenQuantity"}})()()(b.Proxy.value)(e);return function(e){return n(t(e))}},u._nonSpendableInputs=function(e){var n=f._Newtype()()(e.Profunctor0()),t=d.prop({reflectSymbol:function(){return"nonSpendableInputs"}})()()(b.Proxy.value)(e);return function(e){return n(t(e))}},u._selectionStrategy=function(e){var n=f._Newtype()()(e.Profunctor0()),t=d.prop({reflectSymbol:function(){return"selectionStrategy"}})()()(b.Proxy.value)(e);return function(e){return n(t(e))}},u._srcAddresses=function(e){var n=f._Newtype()()(e.Profunctor0()),t=d.prop({reflectSymbol:function(){return"srcAddresses"}})()()(b.Proxy.value)(e);return function(e){return n(t(e))}}}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.Types"]=e["Ctl.Internal.BalanceTx.Types"]||{};var n,t,r,o,a,u,i,c=e["Ctl.Internal.BalanceTx.Types"],l=e["Control.Bind"],s=e["Control.Monad.Except.Trans"],f=e["Control.Monad.Reader.Class"],d=e["Control.Monad.Reader.Trans"],v=e["Control.Monad.Trans.Class"],m=e["Ctl.Internal.BalanceTx.Constraints"],p=e["Ctl.Internal.Cardano.Types.Transaction"],g=e["Ctl.Internal.Contract.Monad"],y=e["Ctl.Internal.Types.Scripts"],w=e["Ctl.Internal.Wallet"],h=e["Data.Function"],b=e["Data.Functor"],C=e["Data.Lens.Getter"],A=e["Data.Lens.Internal.Forget"],S=e["Data.Map.Internal"],I=e["Data.Maybe"],T=e["Data.Newtype"],D=e["Data.Set"],F=(n=v.lift(d.monadTransReaderT)(g.monadContract),function(e){return s.ExceptT(n(e))}),E=(t=v.lift(s.monadTransExceptT)(d.monadReaderT(g.monadContract)),r=v.lift(d.monadTransReaderT)(g.monadContract),function(e){return t(r(e))}),x=(o=v.lift(s.monadTransExceptT)(d.monadReaderT(g.monadContract)),a=v.lift(d.monadTransReaderT)(g.monadContract),u=f.asks(g.monadAskContractEnvContra),function(e){return o(a(u(e)))}),M=x((function(e){return e.networkId})),R=x((i=T.unwrap(),function(e){return function(e){return e.coinsPerUtxoUnit}(i(e.ledgerConstants.pparams))})),P=x(l.composeKleisliFlipped(I.bindMaybe)(w.cip30Wallet)((function(e){return e.wallet})));c.FinalizedTransaction=function(e){return e},c.askCip30Wallet=P,c.askCoinsPerUtxoUnit=R,c.askCostModelsForLanguages=function(e){return b.mapFlipped(s.functorExceptT(d.functorReaderT(g.functorContract)))(x((n=T.unwrap(),function(e){return function(e){return e.costModels}(n(e.ledgerConstants.pparams))})))(T.over()()(p.Costmdls)(S.filterKeys(y.ordLanguage)(h.flip(D.member(y.ordLanguage))(e))));var n},c.askNetworkId=M,c.asksConstraints=function(e){return f.asks(s.monadAskExceptT(d.monadAskReaderT(g.monadContract)))((n=C.view(e(A.strongForget)),function(e){return n(e.constraints)}));var n},c.liftEitherContract=F,c.liftContract=E,c.withBalanceTxConstraints=function(e){var n=m.buildBalanceTxConstraints(e);return h.flip(d.runReaderT)({constraints:n})}}(c),function(e){"use strict";e["Data.Ord.Max"]=e["Data.Ord.Max"]||{};var n=e["Data.Ord.Max"],t=e["Data.Ord"];n.semigroupMax=function(e){return{append:function(n){return function(r){return t.max(e)(n)(r)}}}}}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.Collateral"]=e["Ctl.Internal.BalanceTx.Collateral"]||{};var n,t,r,o,a=e["Ctl.Internal.BalanceTx.Collateral"],u=e["Control.Applicative"],i=e["Control.Bind"],c=e["Control.Monad.Except.Trans"],l=e["Control.Monad.Reader.Trans"],s=e["Ctl.Internal.BalanceTx.Collateral.Select"],f=e["Ctl.Internal.BalanceTx.Error"],d=e["Ctl.Internal.BalanceTx.Types"],v=e["Ctl.Internal.BalanceTx.UtxoMinAda"],m=e["Ctl.Internal.Cardano.Types.Transaction"],p=e["Ctl.Internal.Cardano.Types.Value"],g=e["Ctl.Internal.Contract.Monad"],y=e["Ctl.Internal.Types.BigNum"],w=e["Ctl.Internal.Types.OutputDatum"],h=e["Data.BigInt"],b=e["Data.Either"],C=e["Data.Eq"],A=e["Data.Foldable"],S=e["Data.Functor"],I=e["Data.Lens.Setter"],T=e["Data.Maybe"],D=e["Data.Monoid"],F=e["Data.Newtype"],E=e["Data.Ord"],x=e["Data.Ord.Max"],M=e["Data.Profunctor.Strong"],R=e["Data.Ring"],P=e["Data.Semigroup"],B=e["Data.Semiring"],k=e["Effect.Class"],N=(n=F.unwrap(),t=F.unwrap(),function(e){return p.getNonAdaAsset(n(t(e).output).amount)}),L=(r=F.unwrap(),o=F.unwrap(),function(e){return p["valueToCoin'"](r(o(e).output).amount)}),_=function(e){var n=B.add(h.semiringBigInt)(e);return function(e){return n(L(e))}};a.addTxCollateral=function(e){return function(n){return I.setJust((r=m._body(M.strongFn),o=m._collateral(M.strongFn),function(e){return r(o(e))}))(S.map(S.functorArray)((t=F.unwrap(),function(e){return t(e).input}))(e))(n);var t,r,o}},a.addTxCollateralReturn=function(e){return function(n){return function(t){var r=A.foldMap(A.foldableArray)(p.monoidNonAdaAsset)(N)(e),o=A.foldl(A.foldableArray)(_)(B.zero(h.semiringBigInt))(e),a=E.lessThanOrEq(h.ordBigInt)(o)(s.minRequiredCollateral)&&C.eq(p.eqNonAdaAsset)(r)(D.mempty(p.monoidNonAdaAsset));if(a)return u.pure(c.applicativeExceptT(l.monadReaderT(g.monadContract)))(n);if(!a)return function(e){return function(r){var o=F.wrap()(y.toBigInt(y.maxValue)),a={address:t,amount:p.mkValue(o)(r),datum:w.NoOutputDatum.value,scriptRef:T.Nothing.value};return i.bind(c.bindExceptT(l.monadReaderT(g.monadContract)))(d.askCoinsPerUtxoUnit)((function(t){return i.bind(c.bindExceptT(l.monadReaderT(g.monadContract)))(S.mapFlipped(l.functorReaderT(g.functorContract))(k.liftEffect(l.monadEffectReader(g.monadEffectContract))(v.utxoMinAdaValue(t)(F.wrap()(a))))(b.note(f.CollateralReturnMinAdaValueCalcError.value)))((function(t){var o=F.unwrap()(P.append(x.semigroupMax(h.ordBigInt))(R.sub(h.ringBigInt)(e)(s.minRequiredCollateral))(t)),u=F.wrap()({amount:p.mkValue(F.wrap()(o))(r),address:a.address,datum:a.datum,scriptRef:a.scriptRef}),i=R.sub(h.ringBigInt)(e)(o);return c.except(l.applicativeReaderT(g.applicativeContract))(function(){var e,t,r,o,a=E.greaterThan(h.ordBigInt)(i)(B.zero(h.semiringBigInt));if(a)return new b.Right(I.setJust((r=m._body(M.strongFn),o=m._totalCollateral(M.strongFn),function(e){return r(o(e))}))(F.wrap()(i))(I.setJust((e=m._body(M.strongFn),t=m._collateralReturn(M.strongFn),function(n){return e(t(n))}))(u)(n)));if(!a)return new b.Left(new f.CollateralReturnError("Negative totalCollateral after covering min-utxo-ada requirement."));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Collateral (line 116, column 7 - line 124, column 80): "+[a.constructor.name])}())}))}))}}(o)(r);throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Collateral (line 70, column 5 - line 74, column 59): "+[a.constructor.name])}}}}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.Helpers"]=e["Ctl.Internal.BalanceTx.Helpers"]||{};var n=e["Ctl.Internal.BalanceTx.Helpers"],t=e["Ctl.Internal.Cardano.Types.Transaction"],r=e["Ctl.Internal.Types.UnbalancedTransaction"],o=e["Data.Lens.Getter"],a=e["Data.Lens.Internal.Forget"],u=e["Data.Lens.Lens"],i=e["Data.Lens.Setter"],c=e["Data.Profunctor.Strong"],l=e["Data.Tuple"],s=function(e){return u["lens'"]((function(e){return new l.Tuple(e.unbalancedTx,(function(n){return{unbalancedTx:n,datums:e.datums,redeemersTxIns:e.redeemersTxIns}}))}))(e)},f=function(e){return u["lens'"]((function(e){return new l.Tuple(o.viewOn(e)((n=s(a.strongForget),t=r._transaction(a.strongForget),function(e){return n(t(e))})),(function(n){return i.over(s(c.strongFn))(i.set(r._transaction(c.strongFn))(n))(e)}));var n,t}))(e)};n["_body'"]=function(e){return u["lens'"]((function(e){return new l.Tuple(o.viewOn(e)((n=f(a.strongForget),r=t._body(a.strongForget),function(e){return n(r(e))})),(function(n){return i.over(f(c.strongFn))(i.set(t._body(c.strongFn))(n))(e)}));var n,r}))(e)},n._redeemersTxIns=function(e){return u["lens'"]((function(e){return new l.Tuple(e.redeemersTxIns,(function(n){return{unbalancedTx:e.unbalancedTx,datums:e.datums,redeemersTxIns:n}}))}))(e)},n["_transaction'"]=f,n._unbalancedTx=s}(c),function(e){let n;n=t(1164),n=t(6359)(n),e._minFee=e=>t=>r=>o=>{try{const a=n.LinearFee.new(o,r);return e.just(n.min_fee(t,a))}catch(n){return e.nothing}},e._minScriptFee=e=>t=>n.min_script_fee(t,e)}(c["Ctl.Internal.Serialization.MinFee"]=c["Ctl.Internal.Serialization.MinFee"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.MinFee"]=e["Ctl.Internal.Serialization.MinFee"]||{};var n=e["Ctl.Internal.Serialization.MinFee"],t=e["Ctl.Internal.Serialization.MinFee"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Control.Monad.Error.Class"],u=e["Ctl.Internal.Cardano.Types.NativeScript"],i=e["Ctl.Internal.Cardano.Types.Transaction"],c=e["Ctl.Internal.FfiHelpers"],l=e["Ctl.Internal.NativeScripts"],s=e["Ctl.Internal.Serialization"],f=e["Ctl.Internal.Serialization.Hash"],d=e["Ctl.Internal.Types.BigNum"],v=e["Data.Array"],m=e["Data.BigInt"],p=e["Data.Foldable"],g=e["Data.Functor"],y=e["Data.Lens.Setter"],w=e["Data.Maybe"],h=e["Data.Monoid"],b=e["Data.Newtype"],C=e["Data.Profunctor.Strong"],A=e["Data.Semiring"],S=e["Data.Set"],I=e["Data.Tuple"],T=e["Effect.Class"],D=e["Effect.Exception"],F=new I.Tuple(w.fromJust()(i.mkPublicKey("ed25519_pk1p9sf9wz3t46u9ghht44203gerxt82kzqaqw74fqrmwjmdy8sjxmqknzq8j")),w.fromJust()(i.mkEd25519Signature("ed25519_sig1mr6pm5kanam2wkmae70jx7fjkzepghefj0lmnczu6fra6auf2urgrte5axxhunw4x34l3l8tj9c0t4le39tj8lpjdgxmqnujw07tkzs9m6t6x")));n.calculateMinFeeCsl=function(e){return function(n){return function(I){return function(E){return function(x){var M=function(e){return function(n){var t,r,o,a,c,s,d,m,A,I,T,D,E,x=(t=S.fromFoldable(p.foldableArray)(f.ordEd25519KeyHash),r=g.map(g.functorArray)(b.unwrap()),o=w.fromMaybe(h.mempty(h.monoidArray)),a=b.unwrap(),function(e){return t(r(o(function(e){return e.requiredSigners}(a(e.body)))))})(b.unwrap()(n)),M=l.getMaximumSigners(x)(new u.ScriptAll((c=w.fromMaybe(h.mempty(h.monoidArray)),s=b.unwrap(),function(e){return c(function(e){return e.nativeScripts}(s(e.witnessSet)))})(b.unwrap()(n)))),R=0===(d=S.size(e))?1:d,P=(A=w.fromMaybe(0),I=g.map(w.functorMaybe)((m=g.map(g.functorArray)(b.unwrap()),function(e){return v.length(m(e))})),T=b.unwrap(),function(e){return A(I(function(e){return e.requiredSigners}(T(e.body))))})(b.unwrap()(n));return y.set((D=i._witnessSet(C.strongFn),E=i._vkeys(C.strongFn),function(e){return D(E(e))}))(new w.Just(v.replicate((P+M|0)+R|0)(F)))(n)}}(E)(x);return o.bind(e.Monad0().Bind1())(T.liftEffect(e)(s.convertTransaction(M)))((function(u){return o.bind(e.Monad0().Bind1())(a.liftMaybe(n)(D.error("Unable to calculate min_fee"))(g.map(w.functorMaybe)(d.toBigInt)(t._minFee(c.maybeFfiHelper)(u)(d.fromUInt(I.txFeeFixed))(d.fromUInt(I.txFeePerByte)))))((function(n){return o.bind(e.Monad0().Bind1())(T.liftEffect(e)(s.convertExUnitPrices(I.prices)))((function(o){var a=d.toBigInt(t._minScriptFee(o)(u));return r.pure(e.Monad0().Applicative0())(b.wrap()(A.add(m.semiringBigInt)(n)(a)))}))}))}))}}}}}}(c),function(e){"use strict";e["Ctl.Internal.Contract.MinFee"]=e["Ctl.Internal.Contract.MinFee"]||{};var n=e["Ctl.Internal.Contract.MinFee"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Category"],a=e["Ctl.Internal.Cardano.Types.Transaction"],u=e["Ctl.Internal.Contract"],i=e["Ctl.Internal.Contract.Monad"],c=e["Ctl.Internal.Contract.QueryHandle"],l=e["Ctl.Internal.Contract.Wallet"],s=e["Ctl.Internal.Helpers"],f=e["Ctl.Internal.Serialization.Address"],d=e["Ctl.Internal.Serialization.Hash"],v=e["Ctl.Internal.Serialization.MinFee"],m=e["Ctl.Internal.Types.Transaction"],p=e["Data.Array"],g=e["Data.Either"],y=e["Data.Foldable"],w=e["Data.Functor"],h=e["Data.Lens.Getter"],b=e["Data.Lens.Internal.Forget"],C=e["Data.List.Types"],A=e["Data.Map"],S=e["Data.Map.Internal"],I=e["Data.Maybe"],T=e["Data.Newtype"],D=e["Data.Semigroup"],F=e["Data.Set"],E=e["Data.Show"],x=e["Data.Traversable"],M=e["Data.Tuple"],R=e["Effect.Aff"],P=e["Effect.Aff.Class"],B=e["Effect.Exception"];n.calculateMinFee=function(e){return function(n){return r.bind(i.bindContract)(function(e){return function(n){var u,v,k,N=(v=S.fromFoldable(m.ordTransactionInput)(y.foldableArray),k=w.map(w.functorArray)((u=T.unwrap(),function(e){return n=u(e),new M.Tuple(n.input,n.output);var n})),function(e){return v(k(e))}),L=function(e){return function(n){return function(n){return function(t){return function(r){return w.map(e.Bind1().Apply0().Functor0())(F.fromFoldable(y.foldableArray)(n))(x.for(e.Applicative0())(x.traversableArray)(p.fromFoldable(F.foldableSet)(t))(r))}}}}};return r.bind(i.bindContract)(c.getQueryHandle)((function(u){var c,v,x,M=F.difference(m.ordTransactionInput)(h.viewOn(e)((c=a._body(b.strongForget),v=a._inputs(b.strongForget),function(e){return c(v(e))})))(A.keys(n)),k=F.fromFoldable(C.foldableList)(f.ordAddress)(w.map(C.functorList)((x=T.unwrap(),function(e){return x(e).address}))(S.values(n)));return r.bind(i.bindContract)(L(i.monadContract)(m.ordTransactionInput)(f.ordAddress)(M)((function(e){return s.liftedM(i.monadErrorErrorContract)(B.error("Couldn't get tx output for "+E.show(m.showTransactionInput)(e)))(w.map(i.functorContract)(w.map(I.functorMaybe)((t=T.unwrap(),function(e){return t(e).address})))(P.liftAff(i.monadAffContract)(w.mapFlipped(R.functorAff)(u.getUtxoByOref(e))((n=r.join(I.bindMaybe),function(e){return n(g.hush(e))})))));var n,t})))((function(n){var u,c,v=F.fromFoldable(y.foldableArray)(m.ordTransactionInput)(I.fromMaybe([])(h.viewOn(e)((u=a._body(b.strongForget),c=a._collateral(b.strongForget),function(e){return u(c(e))}))));return r.bind(i.bindContract)(w.map(i.functorContract)(I.maybe(S.empty)(N))(l.getWalletCollateral))((function(e){return r.bind(i.bindContract)(L(i.monadContract)(m.ordTransactionInput)(f.ordAddress)(v)((function(n){return s.liftM(i.monadErrorErrorContract)(B.error("Couldn't get tx output for "+E.show(m.showTransactionInput)(n)))(w.map(I.functorMaybe)((t=T.unwrap(),function(e){return t(e).address}))(S.lookup(m.ordTransactionInput)(n)(e)));var t})))((function(e){return r.bind(i.bindContract)(w.map(i.functorContract)(F.fromFoldable(y.foldableArray)(f.ordAddress))(l.getWalletAddresses))((function(a){var u=F.intersection(f.ordAddress)(a)(F.union(f.ordAddress)(F.union(f.ordAddress)(k)(n))(e));return r.bind(i.bindContract)(w.map(i.functorContract)(F.mapMaybe(d.ordEd25519KeyHash)(o.identity(o.categoryFn)))(L(i.monadContract)(f.ordAddress)(I.ordMaybe(d.ordEd25519KeyHash))(u)((function(e){return r.bind(i.bindContract)(s.liftM(i.monadErrorErrorContract)(B.error("Could not extract payment credential from Address: "+E.show(f.showAddress)(e)))(f.addressPaymentCred(e)))((function(e){return t.pure(i.applicativeContract)(f.stakeCredentialToKeyHash(e))}))}))))((function(e){var n=F.fromFoldable(y.foldableArray)(d.ordEd25519KeyHash)(p.mapMaybe(r.composeKleisliFlipped(I.bindMaybe)(f.stakeCredentialToKeyHash)(f.addressStakeCred))(p.fromFoldable(F.foldableSet)(u)));return t.pure(i.applicativeContract)(D.append(F.semigroupSet(d.ordEd25519KeyHash))(e)(n))}))}))}))}))}))}))}}(e)(n))((function(n){return r.bind(i.bindContract)(u.getProtocolParameters)((function(t){return v.calculateMinFeeCsl(i.monadEffectContract)(i.monadThrowErrorContract)(t)(n)(e)}))}))}}}(c),function(e){"use strict";e["Ctl.Internal.TxOutput"]=e["Ctl.Internal.TxOutput"]||{};var n,t=e["Ctl.Internal.TxOutput"],r=e["Ctl.Internal.Address"],o=e["Ctl.Internal.Serialization.PlutusData"],a=e["Ctl.Internal.Serialization.ToBytes"],u=e["Ctl.Internal.Types.ByteArray"],i=e["Ctl.Internal.Types.OutputDatum"],c=e["Data.Functor"],l=e["Data.Maybe"],s=e["Data.Newtype"],f=function(e){return(n=s.unwrap(),function(e){return u.byteArrayToHex(n(e))})(a.toBytes()(o.convertPlutusData(e)));var n},d=(n=s.unwrap(),function(e){return u.byteArrayToHex(n(e))});t.transactionInputToTxOutRef=function(e){return{txId:u.byteArrayToHex(s.unwrap()(e.transactionId)),index:e.index}},t.transactionOutputToOgmiosTxOut=function(e){return{address:r.addressToOgmiosAddress(e.address),value:e.amount,datumHash:c.map(l.functorMaybe)(d)(i.outputDatumDataHash(e.datum)),datum:c.map(l.functorMaybe)(f)(i.outputDatumDatum(e.datum)),script:e.scriptRef}}}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.ExUnitsAndMinFee"]=e["Ctl.Internal.BalanceTx.ExUnitsAndMinFee"]||{};var n=e["Ctl.Internal.BalanceTx.ExUnitsAndMinFee"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Error.Class"],a=e["Control.Monad.Except.Trans"],u=e["Control.Monad.Reader.Trans"],i=e["Ctl.Internal.BalanceTx.Constraints"],c=e["Ctl.Internal.BalanceTx.Error"],l=e["Ctl.Internal.BalanceTx.Helpers"],s=e["Ctl.Internal.BalanceTx.Types"],f=e["Ctl.Internal.Cardano.Types.ScriptRef"],d=e["Ctl.Internal.Cardano.Types.Transaction"],v=e["Ctl.Internal.Contract.MinFee"],m=e["Ctl.Internal.Contract.Monad"],p=e["Ctl.Internal.Contract.QueryHandle"],g=e["Ctl.Internal.Plutus.Conversion"],y=e["Ctl.Internal.ReindexRedeemers"],w=e["Ctl.Internal.Transaction"],h=e["Ctl.Internal.TxOutput"],b=e["Ctl.Internal.Types.Natural"],C=e["Ctl.Internal.Types.RedeemerTag"],A=e["Ctl.Internal.Types.Scripts"],S=e["Ctl.Internal.Types.Transaction"],I=e["Ctl.Internal.Types.UnbalancedTransaction"],T=e["Data.Array"],D=e["Data.Bifunctor"],F=e["Data.Either"],E=e["Data.Foldable"],x=e["Data.Function"],M=e["Data.Functor"],R=e["Data.Lens.Getter"],P=e["Data.Lens.Internal.Forget"],B=e["Data.Lens.Setter"],k=e["Data.Map.Internal"],N=e["Data.Maybe"],L=e["Data.Monoid"],_=e["Data.Newtype"],U=e["Data.Ord"],H=e["Data.Profunctor.Strong"],q=e["Data.Semigroup"],O=e["Data.Set"],W=e["Data.Traversable"],V=e["Data.Tuple"],K=e["Data.UInt"],z=e["Data.Unfoldable"],J=e.Effect,j=e["Effect.Aff.Class"],Q=e["Effect.Class"],G=function(e){return function(n){return M.mapFlipped(M.functorArray)(e)((function(e){return N.maybe(e)((function(n){return new V.Tuple({tag:e.value0.tag,index:e.value0.index,data:e.value0.data,exUnits:{mem:b.toBigInt(n.memory),steps:b.toBigInt(n.steps)}},e.value1)}))(k.lookup(U.ordRecord()(U.ordRecordCons(U.ordRecordCons(U.ordRecordNil)()({reflectSymbol:function(){return"redeemerTag"}})(C.ordRedeemerTag))()({reflectSymbol:function(){return"redeemerIndex"}})(b.ordNatural)))({redeemerTag:e.value0.tag,redeemerIndex:b["fromBigInt'"](e.value0.index)})(n))}))}},Z=function(e){var n,t,r,o,a=R.viewOn(e.unbalancedTx)(I._transaction(P.strongForget));return B.setJust((r=d._witnessSet(H.strongFn),o=d._redeemers(H.strongFn),function(e){return r(o(e))}))(M.map(M.functorArray)(V.fst)(e.redeemersTxIns))(B.setJust((n=d._witnessSet(H.strongFn),t=d._plutusData(H.strongFn),function(e){return n(t(e))}))(M.map(M.functorArray)(_.unwrap())(e.datums))(a))},X=function(e){return function(n){var t=function(e){return r.bindFlipped(N.bindMaybe)(f.getPlutusScript)(e.scriptRef)},o=Z(e),i=R.viewOn(o)(d._body(P.strongForget)),l=R.viewOn(o)(d._witnessSet(P.strongForget)),v=M.map(M.functorArray)(_.wrap())(N.fromMaybe(L.mempty(L.monoidArray))(_.unwrap()(l).plutusData)),p=N.fromMaybe(L.mempty(L.monoidArray))(_.unwrap()(l).redeemers);return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(a.except(u.applicativeReaderT(m.applicativeContract))(function(e){var r,o=T.fromFoldable(O.foldableSet)(q.append(O.semigroupSet(S.ordTransactionInput))(e.inputs)(e.referenceInputs));return M.map(F.functorEither)((r=M.map(M.functorArray)(t),function(e){return T.catMaybes(r(e))}))(W.for(F.applicativeEither)(W.traversableArray)(o)((function(e){return F.note(new c.UtxoLookupFailedFor(e))(k.lookup(S.ordTransactionInput)(e)(n))})))}(i)))((function(e){var n,t=q.append(q.semigroupArray)(N.fromMaybe(L.mempty(L.monoidArray))(function(e){return e.plutusScripts}(_.unwrap()(l))))(e),i=E.foldMap(E.foldableArray)(O.monoidSet(A.ordLanguage))((n=_.unwrap(),function(e){return O.singleton(V.snd(n(e)))}))(t);return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(s.askCostModelsForLanguages(i))((function(e){return Q.liftEffect(a.monadEffectExceptT(u.monadEffectReader(m.monadEffectContract)))(M.map(J.functorEffect)(s.FinalizedTransaction)(w.setScriptDataHash(e)(p)(v)(o)))}))}))}};n.evalExUnitsAndMinFee=function(e){return function(n){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(o.liftEither(a.monadThrowExceptT(u.monadReaderT(m.monadContract)))(D.lmap(D.bifunctorEither)(c.ReindexRedeemersError.create)(function(e){var n,t,r=T.fromFoldable(O.foldableSet)(R.viewOn(e)((n=l["_body'"](P.strongForget),t=d._inputs(P.strongForget),function(e){return n(t(e))})));return M.mapFlipped(F.functorEither)(y["reindexSpentScriptRedeemers'"](r)(e.redeemersTxIns))((function(n){return B.set(l._redeemersTxIns(H.strongFn))(n)(e)}))}(e))))((function(e){var f,y=Z(e);return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))((f=y,function(e){var n=r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(s.askNetworkId)((function(e){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(M.mapFlipped(a.functorExceptT(u.functorReaderT(m.functorContract)))(s.asksConstraints((function(e){return i._additionalUtxos(e)})))(g.fromPlutusUtxoMap(e)))((function(e){return t.pure(a.applicativeExceptT(u.monadReaderT(m.monadContract)))(_.wrap()(k.fromFoldable(U.ordRecord()(U.ordRecordCons(U.ordRecordCons(U.ordRecordNil)()({reflectSymbol:function(){return"txId"}})(U.ordString))()({reflectSymbol:function(){return"index"}})(K.uintOrd)))(E.foldableArray)(M.map(M.functorArray)(D.bimap(D.bifunctorTuple)(h.transactionInputToTxOutRef)(h.transactionOutputToOgmiosTxOut))(k.toUnfoldable(z.unfoldableArray)(e)))))}))}));return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(s.liftContract(p.getQueryHandle))((function(i){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(n)((function(n){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(M.map(a.functorExceptT(u.functorReaderT(m.functorContract)))(_.unwrap())(s.liftContract(j.liftAff(m.monadAffContract)(i.evaluateTx(f)(n)))))((function(n){if(n instanceof F.Right)return t.pure(a.applicativeExceptT(u.monadReaderT(m.monadContract)))(n.value0);if(n instanceof F.Left&&R.viewOn(f)(d._isValid(P.strongForget)))return o.throwError(a.monadThrowExceptT(u.monadReaderT(m.monadContract)))(new c.ExUnitsEvaluationFailed(e,n.value0));if(n instanceof F.Left)return t.pure(a.applicativeExceptT(u.monadReaderT(m.monadContract)))(_.wrap()(k.empty));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.ExUnitsAndMinFee (line 98, column 3 - line 102, column 36): "+[n.constructor.name])}))}))}))})(e))((function(o){var c,f=(c=e,function(e){return B.over(l._redeemersTxIns(H.strongFn))(x.flip(G)(e))(c)})(o);return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(X(f)(n))((function(e){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(s.askNetworkId)((function(n){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(M.map(a.functorExceptT(u.functorReaderT(m.functorContract)))(g.fromPlutusUtxoMap(n))(s.asksConstraints((function(e){return i._additionalUtxos(e)}))))((function(n){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(s.liftContract(v.calculateMinFee(e)(n)))((function(e){return t.pure(a.applicativeExceptT(u.monadReaderT(m.monadContract)))(new V.Tuple(f,_.unwrap()(e)))}))}))}))}))}))}))}},n.finalizeTransaction=X}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx"]=e["Ctl.Internal.BalanceTx"]||{};var n,t,r=e["Ctl.Internal.BalanceTx"],o=e["Control.Applicative"],a=e["Control.Apply"],u=e["Control.Bind"],i=e["Control.Monad.Error.Class"],c=e["Control.Monad.Except.Trans"],l=e["Control.Monad.Logger.Class"],s=e["Control.Monad.Reader.Trans"],f=e["Control.Parallel"],d=e["Ctl.Internal.BalanceTx.CoinSelection"],v=e["Ctl.Internal.BalanceTx.Collateral"],m=e["Ctl.Internal.BalanceTx.Constraints"],p=e["Ctl.Internal.BalanceTx.Error"],g=e["Ctl.Internal.BalanceTx.ExUnitsAndMinFee"],y=e["Ctl.Internal.BalanceTx.Helpers"],w=e["Ctl.Internal.BalanceTx.Types"],h=e["Ctl.Internal.BalanceTx.UtxoMinAda"],b=e["Ctl.Internal.Cardano.Types.Transaction"],C=e["Ctl.Internal.Cardano.Types.Value"],A=e["Ctl.Internal.CoinSelection.UtxoIndex"],S=e["Ctl.Internal.Contract"],I=e["Ctl.Internal.Contract.Monad"],T=e["Ctl.Internal.Contract.QueryHandle"],D=e["Ctl.Internal.Contract.Wallet"],F=e["Ctl.Internal.Helpers"],E=e["Ctl.Internal.Partition"],x=e["Ctl.Internal.Plutus.Conversion.Value"],M=e["Ctl.Internal.Plutus.Types.Value"],R=e["Ctl.Internal.Types.OutputDatum"],P=e["Ctl.Internal.Types.Scripts"],B=e["Ctl.Internal.Types.Transaction"],k=e["Ctl.Internal.Types.UnbalancedTransaction"],N=e["Data.Array"],L=e["Data.Array.NonEmpty"],_=e["Data.Array.NonEmpty.Internal"],U=e["Data.BigInt"],H=e["Data.Either"],q=e["Data.Eq"],O=e["Data.Foldable"],W=e["Data.Function"],V=e["Data.Functor"],K=e["Data.Lens.Getter"],z=e["Data.Lens.Internal.Forget"],J=e["Data.Lens.Setter"],j=e["Data.Log.Tag"],Q=e["Data.Map.Internal"],G=e["Data.Maybe"],Z=e["Data.Monoid"],X=e["Data.Newtype"],Y=e["Data.Ord"],$=e["Data.Profunctor.Strong"],ee=e["Data.Ring"],ne=e["Data.Semigroup"],te=e["Data.Semiring"],re=e["Data.Set"],oe=e["Data.Show"],ae=e["Data.Traversable"],ue=e["Data.Tuple"],ie=e["Data.Unfoldable"],ce=e.Effect,le=e["Effect.Aff.Class"],se=e["Effect.Class"],fe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),de=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),ve=C.eqValue,me={compare:W.on(Y.compare(Y.ordInt))((n=X.unwrap(),function(e){return N.length(C.valueAssets(n(e)))})),Eq0:function(){return ve}},pe=function(e){return J.over((n=y["_body'"]($.strongFn),t=b._outputs($.strongFn),function(e){return n(t(e))}))(W.flip(ne.append(ne.semigroupArray))(e));var n,t},ge=function(e){return function(n){return X.wrap()({address:e,amount:n,datum:R.NoOutputDatum.value,scriptRef:G.Nothing.value})}},ye=function(e){return G.maybe(Z.mempty(C.monoidValue))((n=C.mkValue(Z.mempty(C.monoidCoin)),t=X.unwrap(),function(e){return n(t(e))}))(K.viewOn(e)(b._mint(z.strongForget)));var n,t},we=function(e){return C.mkValue(K.viewOn(e)(b._fee(z.strongForget)))(Z.mempty(C.monoidNonAdaAsset))},he=(t=X.unwrap(),function(e){return t(e).amount}),be=function(e){return function(n){return V.map(H.functorEither)(O.foldMap(O.foldableArray)(C.monoidValue)(he))(ae.for(H.applicativeEither)(ae.traversableArray)(N.fromFoldable(re.foldableSet)(K.viewOn(n)(b._inputs(z.strongForget))))((function(n){return H.note(new p.UtxoLookupFailedFor(n))(Q.lookup(B.ordTransactionInput)(n)(e))})))}},Ce=function(e){return O.foldMap(O.foldableArray)(C.monoidValue)(he)(K.viewOn(e)(b._outputs(z.strongForget)))},Ae=function(e){return function(n){return function(t){return V.mapFlipped(H.functorEither)(be(n)(t))((function(n){return C.minus(ne.append(C.semigroupValue)(Ce(t))(ne.append(C.semigroupValue)(we(t))(C.coinToValue(e))))(ne.append(C.semigroupValue)(n)(ye(t)))}))}}},Se=function(e){return function(n){return function(t){return function(r){var o,a=K.viewOn(r)(y["_body'"](z.strongForget)),i=function(e){return function(n){var t=j.tag(n),r=oe.show(e);return function(e){return t(r(e))}}};return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(c.except(s.applicativeReaderT(I.applicativeContract))(be(n)(a)))((o=W.flip(l.trace(l.monadLoggerExceptT(l.monadLoggerReaderT(I.monadLoggerContract))))(e+":"),function(e){return o((n=e,j.fromArray(ne.append(ne.semigroupArray)([i(C.showValue)("Input Value")(n),i(C.showValue)("Mint Value")(ye(a)),i(C.showCoin)("Fees")(K.viewOn(a)(b._fee(z.strongForget)))])(function(e){if(e instanceof G.Nothing)return[i(C.showValue)("Output Value")(Ce(a))];if(e instanceof G.Just)return[i(C.showValue)("Output Value without change")(Ce(a)),i(C.showValue)("Change Value")(O.foldMap(O.foldableArray)(C.monoidValue)(he)(e.value0))];throw new Error("Failed pattern match at Ctl.Internal.BalanceTx (line 765, column 5 - line 765, column 74): "+[e.constructor.name])}(t)))));var n}))}}}},Ie=function(e){return function(n){return function(t){return Se(e)(n)(new G.Just(t.changeOutputs))(t.transaction)}}},Te=function(e){return function(n){return function(t){return function(r){var a,i,l,f,d,v,g,y=K.viewOn(r)(b._outputs(z.strongForget)),A=F.fromMaybeFlipped(L.fromArray(V.map(V.functorArray)((a=X.unwrap(),function(e){return C["valueToCoin'"](a(e).amount)}))(y)))(L.singleton(te.zero(U.semiringBigInt))),S=(i=C.minus(ne.append(C.semigroupValue)(n)(ye(r)))(ne.append(C.semigroupValue)(Ce(r))(ne.append(C.semigroupValue)(we(r))(C.coinToValue(t)))),C.mkValue(Y.max(U.ordBigInt)(i.value0)(te.zero(U.semiringBigInt)))(C.posNonAdaAsset(i.value1))),T=C["valueToCoin'"](S),D=C.valueAssets(S),x=O.foldr(O.foldableArray)((l=L.zipWith(ne.append(C.semigroupValue)),f=function(e){return function(n){var t,r,o=V.mapFlipped(V.functorArray)(e)((t=C.getAssetQuantity(n.value0),r=X.unwrap(),function(e){return t(r(e).amount)})),a=F.fromMaybeFlipped(L.fromArray(o))(L.singleton(te.one(U.semiringBigInt)));return V.map(_.functorNonEmptyArray)(C.assetToValue(n.value0))(F.fromMaybeFlipped(E.partition(E.partitionBigInt)(n.value1)(a))(E.equipartition(E.equipartitionBigInt)(n.value1)(O.length(_.foldableNonEmptyArray)(te.semiringInt)(a))))}}(y),function(e){return l(f(e))}))(L.replicate(O.length(O.foldableArray)(te.semiringInt)(y))(Z.mempty(C.monoidValue)))(D),M=L.sortWith(me)((function(e){return ue.fst(e)}))(L.zip(x)(A));return q.eq(C.eqValue)(S)(Z.mempty(C.monoidValue))&&q.notEq(q.eqArray(b.eqTransactionOutput))(K.viewOn(r)(b._outputs(z.strongForget)))(Z.mempty(Z.monoidArray))?o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract)))(Z.mempty(Z.monoidArray)):V.map(c.functorExceptT(s.functorReaderT(I.functorContract)))(V.map(V.functorArray)(ge(e)))(u.bindFlipped(c.bindExceptT(s.monadReaderT(I.monadContract)))(function(e){return function(n){return function(t){var r,o,a=function(e){var t,r=(t=O.null(O.foldableArray),function(e){return t(C.valueAssets(e.value))}),o=function(e){return C.mkValue(X.wrap()(e.minCoin))(e.value.value1)};return function(t){return u=L.uncons(t),i=function(t){var r,a=L["cons'"](u.head)(u.tail),i=V.map(_.functorNonEmptyArray)(o)(a),c=Y.max(U.ordBigInt)(te.zero(U.semiringBigInt))(ee.sub(U.ringBigInt)(n)(e)),l=(r=V.map(_.functorNonEmptyArray)((function(e){return e.outputAda}))(a),function(e){return V.map(_.functorNonEmptyArray)(C.lovelaceValueOf)(F.fromMaybeFlipped(E.partition(E.partitionBigInt)(e)(r))(E.equipartition(E.equipartitionBigInt)(e)(O.length(_.foldableNonEmptyArray)(te.semiringInt)(r))))})(c);return L.toArray(L.zipWith(ne.append(C.semigroupValue))(i)(l))},(c=L.fromArray(u.tail))instanceof G.Just&&Y.lessThan(U.ordBigInt)(n)(e)&&r(u.head)?a(ee.sub(U.ringBigInt)(e)(u.head.minCoin))(c.value0):i();var u,i,c}},i=ae.for(c.applicativeExceptT(s.monadReaderT(I.monadContract)))(_.traversableNonEmptyArray)(t)((function(n){return V.map(c.functorExceptT(s.functorReaderT(I.functorContract)))((function(e){return{value:n.value0,outputAda:n.value1,minCoin:e}}))((t=n.value0,r=ge(e)(t),u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(w.askCoinsPerUtxoUnit)((function(e){return se.liftEffect(s.monadEffectReader(I.monadEffectContract))(V.mapFlipped(ce.functorEffect)(h.utxoMinAdaValue(e)(r))(H.note(p.UtxoMinAdaValueCalculationFailed.value)))}))));var t,r})),l=(r=O.sum(_.foldableNonEmptyArray)(U.semiringBigInt),o=V.map(_.functorNonEmptyArray)((function(e){return e.minCoin})),function(e){return r(o(e))});return V.mapFlipped(c.functorExceptT(s.functorReaderT(I.functorContract)))(i)((function(e){return a(l(e))(e)}))}}}(e)(T))((d=M,v=function(e){return new ue.Tuple(C.mkValue(Z.mempty(C.monoidCoin))(e.value1),X.unwrap()(e.value0))},g=function(e){return C.mkValue(X.wrap()(e.value1))(e.value0.value1)},V.mapFlipped(c.functorExceptT(s.functorReaderT(I.functorContract)))(w.asksConstraints((function(e){return m._maxChangeOutputTokenQuantity(e)})))((function(e){if(e instanceof G.Nothing)return d;if(e instanceof G.Just)return V.map(_.functorNonEmptyArray)(v)(u.bindFlipped(_.bindNonEmptyArray)(C.equipartitionValueWithTokenQuantityUpperBound(e.value0))(V.map(_.functorNonEmptyArray)(g)(d)));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx (line 506, column 67 - line 512, column 12): "+[e.constructor.name])})))))}}}},De=function(e){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(w.askCoinsPerUtxoUnit)((function(n){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(se.liftEffect(s.monadEffectReader(I.monadEffectContract))(V.mapFlipped(ce.functorEffect)(h.utxoMinAdaValue(n)(e))(H.note(p.UtxoMinAdaValueCalculationFailed.value))))((function(n){var t=X.unwrap()(e),r=Y.max(U.ordBigInt)(C["valueToCoin'"](t.amount))(n);return o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract)))(X.wrap()(function(){var e={};for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.amount=C.mkValue(r)(C.getNonAdaAsset(t.amount)),e}()))}))}))};r.balanceTxWithConstraints=function(e){return function(n){var t,r,l,h,F=(l=K.viewOn(e)(y["_transaction'"](z.strongForget)),u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(G.maybe(w.askNetworkId)(o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract))))(K.viewOn(l)((t=b._body(z.strongForget),r=b._networkId(z.strongForget),function(e){return t(r(e))}))))((function(e){return o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract)))(J.setJust((n=b._body($.strongFn),t=b._networkId($.strongFn),function(e){return n(t(e))}))(e)(l));var n,t}))),E=u.bindFlipped(c.bindExceptT(s.monadReaderT(I.monadContract)))(i.liftMaybe(c.monadThrowExceptT(s.monadReaderT(I.monadContract)))(p.CouldNotGetChangeAddress.value))(u.bindFlipped(c.bindExceptT(s.monadReaderT(I.monadContract)))(G.maybe(w.liftContract(D.getChangeAddress))((h=o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract))),function(e){return h(G.Just.create(e))})))(w.asksConstraints((function(e){return m._changeAddress(e)}))));return u.bind(I.bindContract)(S.getProtocolParameters)((function(t){return u.bind(I.bindContract)(T.getQueryHandle)((function(r){return w.withBalanceTxConstraints(n)(c.runExceptT((h=X.unwrap()(t).stakeAddressDeposit,S=(l=K.viewOn(e)(y["_transaction'"](z.strongForget)),function(e){var n,t,r,o,a,u,i=X.unwrap()(O.fold(Q.foldableMap)(C.monoidCoin)(G.fromMaybe(Q.empty)(K.viewOn(l)((n=b._body(z.strongForget),t=b._withdrawals(z.strongForget),function(e){return n(t(e))}))))),c=(a=O.sum(O.foldableArray)(U.semiringBigInt),u=V.map(V.functorArray)((function(n){return n instanceof b.StakeRegistration?X.unwrap()(e):n instanceof b.StakeDeregistration?ee.negate(U.ringBigInt)(X.unwrap()(e)):te.zero(U.semiringBigInt)})),function(e){return a(u(e))})(O.fold(O.foldableMaybe)(Z.monoidArray)(K.viewOn(l)((r=b._body(z.strongForget),o=b._certs(z.strongForget),function(e){return r(o(e))}))));return ee.sub(U.ringBigInt)(c)(i)})(h),u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(w.asksConstraints((function(e){return m._srcAddresses(e)})))(G.maybe(w.liftContract(D.getWalletAddresses))(o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract))))))((function(n){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(E)((function(t){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(w.liftEitherContract(V.mapFlipped(I.functorContract)(f.parTraverse(I.parallelParContractContra)(ae.traversableArray)((T=V.map(I.functorContract)(H.hush),E=le.liftAff(I.monadAffContract),function(e){return T(E(r.utxosAt(e)))}))(n))((l=V.map(H.functorEither)(O.foldr(O.foldableArray)(Q.union(B.ordTransactionInput))(Q.empty)),h=ae.traverse(ae.traversableArray)(H.applicativeEither)(H.note(p.CouldNotGetUtxos.value)),function(e){return l(h(e))}))))((function(n){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(function(){var n=N.null(K.viewOn(e)(y._redeemersTxIns(z.strongForget)));if(n)return F;if(!n)return u.bindFlipped(c.bindExceptT(s.monadReaderT(I.monadContract)))(function(e){return function(n){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(w.liftEitherContract(V.map(I.functorContract)(H.note(p.CouldNotGetCollateral.value))(D.getWalletCollateral)))((function(t){var r=v.addTxCollateral(t)(n);return v.addTxCollateralReturn(t)(r)(e)}))}}(t))(F);throw new Error("Failed pattern match at Ctl.Internal.BalanceTx (line 190, column 7 - line 195, column 76): "+[n.constructor.name])}())((function(r){var l,f,v=Q.union(B.ordTransactionInput)(n)(K.viewOn(e)((l=y._unbalancedTx(z.strongForget),f=k._utxoIndex(z.strongForget),function(e){return l(f(e))})));return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(w.liftContract(I.filterLockedUtxos(v)))((function(n){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(w.asksConstraints((function(e){return m._selectionStrategy(e)})))((function(l){return f={strategy:l,unbalancedTx:J.set(y["_transaction'"]($.strongFn))(r)(e),changeAddress:t,allUtxos:v,utxos:n,certsFee:S},F=function(){var e=K.viewOn(K.viewOn(K.viewOn(f.unbalancedTx)(y["_transaction'"](z.strongForget)))(b._witnessSet(z.strongForget)))(b._plutusScripts(z.strongForget));if(e instanceof G.Just)return W.flip(N.any)(e.value0)((function(e){return e.value1 instanceof P.PlutusV1}));if(e instanceof G.Nothing)return!1;throw new Error("Failed pattern match at Ctl.Internal.BalanceTx (line 288, column 5 - line 292, column 23): "+[e.constructor.name])}(),E=u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(V.map(c.functorExceptT(s.functorReaderT(I.functorContract)))(G.isJust)(w.askCip30Wallet))((function(e){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(e?w.liftContract(V.mapFlipped(I.functorContract)(D.getWalletCollateral)((t=re.fromFoldable(O.foldableArray)(B.ordTransactionInput),r=V.map(V.functorArray)((n=X.unwrap(),function(e){return n(e).input})),o=O.fold(O.foldableMaybe)(Z.monoidArray),function(e){return t(r(o(e)))}))):Z.mempty(c.monoidExceptT(s.monadReaderT(I.monadContract))(re.monoidSet(B.ordTransactionInput))))((function(e){return V.mapFlipped(c.functorExceptT(s.functorReaderT(I.functorContract)))(w.asksConstraints((function(e){return m._nonSpendableInputs(e)})))((n=ne.append(re.semigroupSet(B.ordTransactionInput))(e),function(e){return t=n(e),O.foldr(O.foldableArray)((function(e){return function(n){var r,o,a=!(re.member(B.ordTransactionInput)(e.value0)(t)||re.member(B.ordTransactionInput)(e.value0)(K.viewOn(f.unbalancedTx)((r=y["_body'"](z.strongForget),o=b._referenceInputs(z.strongForget),function(e){return r(o(e))})))),u=G.isJust(X.unwrap()(e.value1).scriptRef),i=X.unwrap()(e.value1).datum instanceof R.OutputDatum,c=!(F&&(i||u));return a&&c?{spendable:Q.insert(B.ordTransactionInput)(e.value0)(e.value1)(n.spendable),invalidInContext:n.invalidInContext}:a&&!c?{invalidInContext:Q.insert(B.ordTransactionInput)(e.value0)(e.value1)(n.invalidInContext),spendable:n.spendable}:n}}))({spendable:Q.empty,invalidInContext:Q.empty})(Q.toUnfoldable(ie.unfoldableArray)(f.utxos));var t}));var n}));var n,t,r,o})),h=function(e){if(e instanceof fe)return u.discard(u.discardUnit)(c.bindExceptT(s.monadReaderT(I.monadContract)))(Ie("Pre-balancing (Stage 1)")(f.allUtxos)(e.value0))((function(){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(function(e){var n,t=(n=K.viewOn(pe(e.changeOutputs)(e.transaction))(y["_body'"](z.strongForget)),u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(c.except(s.applicativeReaderT(I.applicativeContract))(Ae(f.certsFee)(f.allUtxos)(n)))(d.performMultiAssetSelection(c.monadEffectExceptT(s.monadEffectReader(I.monadEffectContract)))(c.monadThrowExceptT(s.monadReaderT(I.monadContract)))(f.strategy)(e.leftoverUtxos)));return V.mapFlipped(c.functorExceptT(s.functorReaderT(I.functorContract)))(t)((function(n){return{transaction:J.over((t=y["_body'"]($.strongFn),r=b._inputs($.strongFn),function(e){return t(r(e))}))(re.union(B.ordTransactionInput)(d.selectedInputs(n)))(e.transaction),leftoverUtxos:K.viewOn(n)(d._leftoverUtxos(z.strongForget)),changeOutputs:e.changeOutputs,minFee:e.minFee};var t,r}))}(e.value0))(T)}));if(e instanceof de)return u.discard(u.discardUnit)(c.bindExceptT(s.monadReaderT(I.monadContract)))(Ie("Balancing change and fees (Stage 2)")(f.allUtxos)(e.value0))((function(){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(function(e){var n=X.wrap()(pe(e.changeOutputs)(e.transaction));return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(g.evalExUnitsAndMinFee(n)(f.allUtxos))((function(n){return o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract)))({transaction:n.value0,minFee:n.value1,changeOutputs:e.changeOutputs,leftoverUtxos:e.leftoverUtxos})}))}(e.value0))((function(n){var t,r,o,i,l=Y.lessThanOrEq(U.ordBigInt)(n.minFee)(e.value0.minFee);if(l)return re.isEmpty(K.viewOn(n.transaction)((t=y["_body'"](z.strongForget),r=b._inputs(z.strongForget),function(e){return t(r(e))})))?u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(d.performMultiAssetSelection(c.monadEffectExceptT(s.monadEffectReader(I.monadEffectContract)))(c.monadThrowExceptT(s.monadReaderT(I.monadContract)))(f.strategy)(e.value0.leftoverUtxos)(C.lovelaceValueOf(te.one(U.semiringBigInt))))((function(t){return T({transaction:J.over((r=y["_body'"]($.strongFn),o=b._inputs($.strongFn),function(e){return r(o(e))}))(re.union(B.ordTransactionInput)(d.selectedInputs(t)))(n.transaction),leftoverUtxos:K.viewOn(t)(d._leftoverUtxos(z.strongForget)),changeOutputs:e.value0.changeOutputs,minFee:e.value0.minFee});var r,o})):a.applySecond(c.applyExceptT(s.monadReaderT(I.monadContract)))(function(e){return Se("Balanced transaction (Done)")(e)(G.Nothing.value)}(f.allUtxos)(n.transaction))(g.finalizeTransaction(n.transaction)(f.allUtxos));if(!l)return T({transaction:J.set((o=y["_body'"]($.strongFn),i=b._fee($.strongFn),function(e){return o(i(e))}))(n.minFee)(e.value0.transaction),leftoverUtxos:e.value0.leftoverUtxos,changeOutputs:e.value0.changeOutputs,minFee:n.minFee});throw new Error("Failed pattern match at Ctl.Internal.BalanceTx (line 353, column 9 - line 373, column 16): "+[l.constructor.name])}))}));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx (line 345, column 5 - line 345, column 62): "+[e.constructor.name])},T=function(e){var n=K.viewOn(e.transaction)(y["_body'"](z.strongForget));return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(c.except(s.applicativeReaderT(I.applicativeContract))(be(f.allUtxos)(n)))((function(t){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(Te(f.changeAddress)(t)(f.certsFee)(n))((function(n){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(c.except(s.applicativeReaderT(I.applicativeContract))(Ae(f.certsFee)(f.allUtxos)(K.viewOn(pe(n)(e.transaction))(y["_body'"](z.strongForget)))))((function(t){return h((q.eq(C.eqValue)(t)(Z.mempty(C.monoidValue))?de.create:fe.create)({changeOutputs:n,leftoverUtxos:e.leftoverUtxos,minFee:e.minFee,transaction:e.transaction}))}))}))}))},k=function(e){return h(fe.create(e))},u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(E)((function(e){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))((n=f.unbalancedTx,V.map(c.functorExceptT(s.functorReaderT(I.functorContract)))((function(e){return J.set((t=y["_body'"]($.strongFn),r=b._outputs($.strongFn),function(e){return t(r(e))}))(e)(n);var t,r}))(ae.traverse(ae.traversableArray)(c.applicativeExceptT(s.monadReaderT(I.monadContract)))(De)(K.viewOn(n)((t=y["_body'"](z.strongForget),r=b._outputs(z.strongForget),function(e){return t(r(e))}))))))((function(n){return(r=O.foldMap(Q.foldableMap)(C.monoidValue)((o=X.unwrap(),function(e){return o(e).amount}))(e.invalidInContext),function(e){return i.catchError(c.monadErrorExceptT(s.monadReaderT(I.monadContract)))(e)((n=i.throwError(c.monadThrowExceptT(s.monadReaderT(I.monadContract))),function(e){return n((t=e)instanceof p.BalanceInsufficientError?new p.BalanceInsufficientError(t.value0,t.value1,ne.append(M.semigroupValue)(t.value2)(x.toPlutusValue(r))):t);var t}));var n})(k((t=n,function(e){return n=A.buildUtxoIndex(e),{transaction:t,leftoverUtxos:n,changeOutputs:Z.mempty(Z.monoidArray),minFee:te.zero(U.semiringBigInt)};var n})(e.spendable)));var t,r,o}));var n,t,r}));var f,h,T,F,E,k}))}))}))}));var l,h,T,E}))})))));var l,h,S}))}))}}}(c),function(e){"use strict";e["Ctl.Internal.Contract.Sign"]=e["Ctl.Internal.Contract.Sign"]||{};var n=e["Ctl.Internal.Contract.Sign"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Reader.Class"],a=e["Ctl.Internal.Cardano.Types.Transaction"],u=e["Ctl.Internal.Contract.Monad"],i=e["Ctl.Internal.Contract.QueryHandle"],c=e["Ctl.Internal.Contract.Wallet"],l=e["Ctl.Internal.Helpers"],s=e["Ctl.Internal.Serialization.Address"],f=e["Ctl.Internal.Types.Transaction"],d=e["Ctl.Internal.Wallet"],v=e["Data.Array"],m=e["Data.Either"],p=e["Data.Foldable"],g=e["Data.Function"],y=e["Data.Functor"],w=e["Data.Lens.Getter"],h=e["Data.Lens.Internal.Forget"],b=e["Data.Lens.Setter"],C=e["Data.Map.Internal"],A=e["Data.Maybe"],S=e["Data.Newtype"],I=e["Data.Profunctor.Strong"],T=e["Data.Set"],D=e["Data.Show"],F=e["Data.Traversable"],E=e["Data.Tuple"],x=e["Effect.Aff"],M=e["Effect.Aff.Class"],R=e["Effect.Class"],P=e["Effect.Exception"];n.signTransaction=function(e){return r.bind(u.bindContract)(o.asks(u.monadAskContractEnvContra)((function(e){return e.hooks})))((function(n){return r.discard(r.discardUnit)(u.bindContract)(p.for_(u.applicativeContract)(p.foldableMaybe)(n.beforeSign)((o=y.void(u.functorContract),B=R.liftEffect(u.monadEffectContract),function(e){return o(B(P.try(e)))})))((function(){return c.withWallet((function(n){if(n instanceof d.Nami)return M.liftAff(u.monadAffContract)(d.callCip30Wallet(n.value0)((function(n){return g.flip(n.signTx)(e)})));if(n instanceof d.Gero)return M.liftAff(u.monadAffContract)(d.callCip30Wallet(n.value0)((function(n){return g.flip(n.signTx)(e)})));if(n instanceof d.Flint)return M.liftAff(u.monadAffContract)(d.callCip30Wallet(n.value0)((function(n){return g.flip(n.signTx)(e)})));if(n instanceof d.Eternl){var o=v.fromFoldable(T.foldableSet)(w.viewOn(e)((B=a._body(h.strongForget),k=a._inputs(h.strongForget),function(e){return B(k(e))})));return r.discard(r.discardUnit)(u.bindContract)(function(e){return r.bind(u.bindContract)(i.getQueryHandle)((function(n){return r.bind(u.bindContract)(c.getWalletAddresses)((function(o){return r.bind(u.bindContract)(y.map(u.functorContract)((w=C.filter(f.ordTransactionInput)((i=g.flip(v.elem(s.eqAddress))(o),d=S.unwrap(),function(e){return i(d(e).address)})),h=C.fromFoldable(f.ordTransactionInput)(p.foldableArray),function(e){return w(h(e))}))(F.traverse(F.traversableArray)(u.applicativeContract)((function(e){return r.bind(u.bindContract)(l.liftedM(u.monadErrorErrorContract)(P.error("Could not get utxo"))(M.liftAff(u.monadAffContract)(y.map(x.functorAff)((o=r.join(A.bindMaybe),function(e){return o(m.hush(e))}))(n.getUtxoByOref(e)))))((function(n){return t.pure(u.applicativeContract)(new E.Tuple(e,n))}));var o}))(e)))((function(e){var n=function(o){return r.bind(u.bindContract)(y.mapFlipped(u.functorContract)(c.getWalletUtxos)(A.fromMaybe(C.empty)))((function(i){return t.unless(u.applicativeContract)(C.isSubmap(f.ordTransactionInput)(a.eqTransactionOutput)(e)(i))(r.discard(r.discardUnit)(u.bindContract)(t.when(u.applicativeContract)(0===o)(R.liftEffect(u.monadEffectContract)(P.throw("walletWaitForInputs: timeout while waiting for wallet UTxO set and CTL query layer UTxO set to synchronize. UTxOs from Ogmios: "+D.show(C.showMap(f.showTransactionInput)(a.showTransactionOutput))(e)+", UTxOs from wallet: "+D.show(C.showMap(f.showTransactionInput)(a.showTransactionOutput))(i)+", UTxOs that didn't appear in the wallet: "+D.show(C.showMap(f.showTransactionInput)(a.showTransactionOutput))(C.difference(f.ordTransactionInput)(e)(i))))))((function(){return r.discard(r.discardUnit)(u.bindContract)(M.liftAff(u.monadAffContract)(x.delay(S.wrap()(1e3))))((function(){return n(o-1|0)}))})))}))};return n(150)}));var i,d,w,h}))}))}(o))((function(){return M.liftAff(u.monadAffContract)(d.callCip30Wallet(n.value0)((function(n){return g.flip(n.signTx)(e)})))}))}var B,k;if(n instanceof d.Lode)return M.liftAff(u.monadAffContract)(d.callCip30Wallet(n.value0)((function(n){return g.flip(n.signTx)(e)})));if(n instanceof d.NuFi)return M.liftAff(u.monadAffContract)(d.callCip30Wallet(n.value0)((function(n){return g.flip(n.signTx)(e)})));if(n instanceof d.KeyWallet)return M.liftAff(u.monadAffContract)(r.bind(x.bindAff)(S.unwrap()(n.value0).signTx(e))((function(n){return t.pure(x.applicativeAff)(new A.Just(b.appendOver(a.semigroupTransactionWitne)(a._witnessSet(I.strongFn))(n)(e)))})));throw new Error("Failed pattern match at Ctl.Internal.Contract.Sign (line 42, column 14 - line 56, column 52): "+[n.constructor.name])}))}));var o,B}))}}(c),function(e){"use strict";e["Contract.Transaction"]=e["Contract.Transaction"]||{};var n=e["Contract.Transaction"],t=e["Contract.Monad"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Control.Monad.Reader.Class"],u=e["Ctl.Internal.BalanceTx"],i=e["Ctl.Internal.Contract.Monad"],c=e["Ctl.Internal.Contract.QueryHandle"],l=e["Ctl.Internal.Contract.Sign"],s=e["Data.Functor"],f=e["Data.Newtype"],d=e["Data.Traversable"],v=e.Effect,m=e["Effect.Aff.Class"],p=e["Effect.Class"],g=e["Effect.Exception"],y=function(e){return e},w=u.balanceTxWithConstraints;n.balanceTxWithConstraints=w,n.signTransaction=function(){var e=s.map(i.functorContract)(y),n=t.liftedM("Error signing the transaction"),r=f.unwrap();return function(t){return e(n(l.signTransaction(r(t))))}},n.submitE=function(e){return o.bind(i.bindContract)(c.getQueryHandle)((function(n){return o.bind(i.bindContract)(m.liftAff(i.monadAffContract)(n.submitTx(f.unwrap()(e))))((function(n){return o.discard(o.discardUnit)(i.bindContract)(s.void(i.functorContract)(o.bind(i.bindContract)(a.asks(i.monadAskContractEnvContra)((function(e){return e.hooks.onSubmit})))(d.traverse(d.traversableMaybe)(i.applicativeContract)((function(n){return p.liftEffect(i.monadEffectContract)(s.void(v.functorEffect)(g.try(n(f.unwrap()(e)))))})))))((function(){return r.pure(i.applicativeContract)(n)}))}))}))}}(c),function(e){"use strict";e["Contract.Utxos"]=e["Contract.Utxos"]||{};var n=e["Contract.Utxos"],t=e["Contract.Monad"],r=e["Control.Bind"],o=e["Control.Monad.Reader.Class"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Contract.QueryHandle"],i=e["Ctl.Internal.Plutus.Conversion"],c=e["Ctl.Internal.Plutus.Conversion.Address"],l=e["Ctl.Internal.Plutus.Types.Address"],s=e["Ctl.Internal.Service.Error"],f=e["Effect.Aff.Class"];n.utxosAt=function(e){return function(n){return r.bind(a.bindContract)(o.asks(a.monadAskContractEnvContra)((function(e){return e.networkId})))((function(o){return r.bind(a.bindContract)(u.getQueryHandle)((function(u){var d=c.fromPlutusAddress(o)(l.getAddress(e)(n));return r.bind(a.bindContract)(t.liftedE(s.showClientError)(f.liftAff(a.monadAffContract)(u.utxosAt(d))))((function(e){return t.liftContractM("utxosAt: failed to convert utxos")(i.toPlutusUtxoMap(e))}))}))}))}}}(c),function(e){let n,r;n=t(1164),r=t(9167),n=t(6359)(n),r=t(6359)(r),e.apply_params_to_script=e=>t=>o=>a=>{let u,i=a.language_version();try{let n=a.bytes(),t=o.to_bytes();try{u=r.apply_params_to_script_no_panic(t,n)}catch(n){return e("Error applying argument to script: ".concat(n.toString()))}}catch(n){return e("Error serializing arguments: ".concat(n.toString()))}return t(n.PlutusScript.new_with_version(u,i))}}(c["Ctl.Internal.ApplyArgs"]=c["Ctl.Internal.ApplyArgs"]||{}),function(e){"use strict";e["Data.Profunctor.Choice"]=e["Data.Profunctor.Choice"]||{};var n=e["Data.Profunctor.Choice"],t=e["Data.Either"],r=e["Data.Functor"],o=e["Data.Profunctor"],a={left:function(e){return function(n){if(n instanceof t.Left)return new t.Left(e(n.value0));if(n instanceof t.Right)return new t.Right(n.value0);throw new Error("Failed pattern match at Data.Profunctor.Choice (line 32, column 1 - line 35, column 16): "+[e.constructor.name,n.constructor.name])}},right:r.map(t.functorEither),Profunctor0:function(){return o.profunctorFn}};n.left=function(e){return e.left},n.choiceFn=a}(c),function(e){"use strict";e["Ctl.Internal.ApplyArgs"]=e["Ctl.Internal.ApplyArgs"]||{};var n=e["Ctl.Internal.ApplyArgs"],t=e["Ctl.Internal.ApplyArgs"],r=e["Control.Bind"],o=e["Ctl.Internal.Deserialization.WitnessSet"],a=e["Ctl.Internal.Serialization.PlutusData"],u=e["Ctl.Internal.Serialization.PlutusScript"],i=e["Ctl.Internal.Types.PlutusData"],c=e["Data.Either"],l=e["Data.Profunctor.Choice"],s=e["Data.Show"],f=e["Data.Show.Generic"],d=function(e){return e},v={show:f.genericShow({to:function(e){return e},from:function(e){return e}})(f.genericShowConstructor(f.genericShowArgsArgument(s.showString))({reflectSymbol:function(){return"ApplyArgsError"}}))},m=t.apply_params_to_script(c.Left.create)(c.Right.create);n.applyArgs=function(e){return function(n){return l.left(l.choiceFn)(d)((t=a.convertPlutusData(new i.List(n)),r.bind(c.bindEither)(m(t)(u.convertPlutusScript(e)))((function(e){return new c.Right(o.convertPlutusScript(e))}))));var t}},n.showApplyArgsError=v}(c),function(e){"use strict";e["Ctl.Internal.Contract.AwaitTxConfirmed"]=e["Ctl.Internal.Contract.AwaitTxConfirmed"]||{};var n,t=e["Ctl.Internal.Contract.AwaitTxConfirmed"],r=e["Contract.Monad"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Control.Monad.Reader.Class"],i=e["Control.Parallel"],c=e["Ctl.Internal.Contract.Monad"],l=e["Ctl.Internal.Contract.QueryBackend"],s=e["Ctl.Internal.Contract.QueryHandle"],f=e["Ctl.Internal.Service.Error"],d=e["Data.Either"],v=e["Data.Foldable"],m=e["Data.Functor"],p=e["Data.Maybe"],g=e["Data.Newtype"],y=e["Data.Number"],w=e["Data.Show"],h=e["Data.Time.Duration"],b=e["Data.UInt"],C=e["Data.Unit"],A=e["Effect.Aff"],S=e["Effect.Aff.Class"],I=e["Effect.Class"],T=e["Effect.Exception"],D=function(e){return function(n){var t=a.bind(c.bindContract)(n)((function(n){return o.unless(c.applicativeContract)(n)(a.discard(a.discardUnit)(c.bindContract)(S.liftAff(c.monadAffContract)(A.delay(e)))((function(){return t})))}));return t}},F=(n=y.infinity,function(e){var t,F=(t=g.wrap()(1e3),a.discard(a.discardUnit)(c.bindContract)(D(t)(function(e){return a.bind(c.bindContract)(s.getQueryHandle)((function(n){return S.liftAff(c.monadAffContract)(a.bind(A.bindAff)(n.doesTxExist(e))(d.either((t=I.liftEffect(A.monadEffectAff),r=w.show(f.showClientError),function(e){return t(T.throw(r(e)))}))(o.pure(A.applicativeAff))));var t,r}))}(e)))((function(){return a.bind(c.bindContract)(m.mapFlipped(c.functorContract)(u.asks(c.monadAskContractEnvContra)((function(e){return e.backend})))(a.composeKleisli(p.bindMaybe)(l.getBlockfrostBackend)((function(e){return e.confirmTxDelay}))))((function(n){return a.bind(c.bindContract)(m.mapFlipped(c.functorContract)(u.asks(c.monadAskContractEnvContra)((function(e){return e.backend})))((function(e){return p.isJust(l.getBlockfrostBackend(e))})))((function(u){return a.discard(a.discardUnit)(c.bindContract)(o.when(c.applicativeContract)(u)(a.discard(a.discardUnit)(c.bindContract)(D(t)(function(e){return a.bind(c.bindContract)(s.getQueryHandle)((function(n){return a.bind(c.bindContract)(r.liftedE(f.showClientError)(S.liftAff(c.monadAffContract)(n.getUtxoByOref({transactionId:e,index:b.fromInt(0)}))))((function(e){return o.pure(c.applicativeContract)(p.isJust(e))}))}))}(e)))((function(){return v.for_(c.applicativeContract)(v.foldableMaybe)(n)((e=S.liftAff(c.monadAffContract),t=h.fromDuration(h.durationSeconds),function(n){return e(A.delay(t(n)))}));var e,t}))))((function(){return o.pure(c.applicativeContract)(!0)}))}))}))}))),E=h.fromDuration(h.durationSeconds)(n),x=a.discard(a.discardUnit)(c.bindContract)(S.liftAff(c.monadAffContract)(A.delay(E)))((function(){return o.pure(c.applicativeContract)(!1)}));return g.unwrap()(n)===y.infinity?m.void(c.functorContract)(F):a.bind(c.bindContract)(i.parOneOf(c.parallelParContractContra)(c.alternativeParContract)(v.foldableArray)(m.functorArray)([F,x]))((function(e){return e?o.pure(c.applicativeContract)(C.unit):I.liftEffect(c.monadEffectContract)(T.throw("awaitTxConfirmedWithTimeout: timeout exceeded, Transaction not confirmed"))}))});t.awaitTxConfirmed=F}(c),function(e){"use strict";e["Ctl.Internal.Contract.WaitUntilSlot"]=e["Ctl.Internal.Contract.WaitUntilSlot"]||{};var n=e["Ctl.Internal.Contract.WaitUntilSlot"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Error.Class"],a=e["Control.Monad.Reader.Class"],u=e["Ctl.Internal.Contract"],i=e["Ctl.Internal.Contract.Monad"],c=e["Ctl.Internal.Contract.QueryHandle"],l=e["Ctl.Internal.Helpers"],s=e["Ctl.Internal.Serialization.Address"],f=e["Ctl.Internal.Service.Error"],d=e["Ctl.Internal.Types.BigNum"],v=e["Ctl.Internal.Types.Chain"],m=e["Ctl.Internal.Types.Interval"],p=e["Data.BigInt"],g=e["Data.Either"],y=e["Data.Functor"],w=e["Data.Maybe"],h=e["Data.Newtype"],b=e["Data.Semiring"],C=e["Data.Show"],A=e.Effect,S=e["Effect.Aff"],I=e["Effect.Aff.Class"],T=e["Effect.Class"],D=e["Effect.Exception"],F=y.mapFlipped(i.functorContract)(u.getChainTip)((function(e){if(e instanceof v.Tip)return e.value0.slot;if(e instanceof v.TipAtGenesis)return s.Slot(d.fromInt(0));throw new Error("Failed pattern match at Ctl.Internal.Contract.WaitUntilSlot (line 164, column 31 - line 166, column 52): "+[e.constructor.name])})),E=r.bind(i.bindContract)(F)((function(e){return r.bind(i.bindContract)(l.liftM(i.monadErrorErrorContract)(D.error("Unable to advance slot"))(y.map(w.functorMaybe)(h.wrap())(d.add(h.unwrap()(e))(d.fromInt(1)))))((function(e){return r.bind(i.bindContract)(a.asks(i.monadAskContractEnvContra)((function(e){return e.ledgerConstants})))((function(n){return r.bind(i.bindContract)(c.getQueryHandle)((function(a){return r.bind(i.bindContract)(I.liftAff(i.monadAffContract)(r.bind(S.bindAff)(a.getEraSummaries)(g.either((u=T.liftEffect(S.monadEffectAff),c=C.show(f.showClientError),function(e){return u(D.throw(c(e)))}))(t.pure(S.applicativeAff)))))((function(a){return r.bind(i.bindContract)(T.liftEffect(i.monadEffectContract)(r.bind(A.bindEffect)(m.slotToPosixTime(a)(n.systemStart)(e))((u=l.liftM(o.monadErrorEffect)(D.error("Unable to convert Slot to POSIXTime")),function(e){return u(g.hush(e))}))))((function(e){return t.pure(i.applicativeContract)(b.add(m.semiringPOSIXTime)(h.wrap()(p.fromInt(-1)))(e))}));var u}));var u,c}))}))}))}));n.currentTime=E}(c),function(e){"use strict";e["Ctl.Internal.IsData"]=e["Ctl.Internal.IsData"]||{},e["Ctl.Internal.IsData"].isData=function(e){return function(n){return{FromData0:function(){return e},ToData1:function(){return n}}}}}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.Transaction"]=e["Ctl.Internal.Plutus.Types.Transaction"]||{};var n=e["Ctl.Internal.Plutus.Types.Transaction"],t=e["Data.Lens.Iso.Newtype"],r=e["Data.Lens.Record"],o=e["Type.Proxy"];n._amount=function(e){var n=t._Newtype()()(e.Profunctor0()),a=r.prop({reflectSymbol:function(){return"amount"}})()()(o.Proxy.value)(e);return function(e){return n(a(e))}},n._datum=function(e){var n=t._Newtype()()(e.Profunctor0()),a=r.prop({reflectSymbol:function(){return"datum"}})()()(o.Proxy.value)(e);return function(e){return n(a(e))}},n._output=function(e){var n=t._Newtype()()(e.Profunctor0()),a=r.prop({reflectSymbol:function(){return"output"}})()()(o.Proxy.value)(e);return function(e){return n(a(e))}},n._scriptRef=function(e){var n=t._Newtype()()(e.Profunctor0()),a=r.prop({reflectSymbol:function(){return"scriptRef"}})()()(o.Proxy.value)(e);return function(e){return n(a(e))}}}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.TransactionUnspentOutput"]=e["Ctl.Internal.Plutus.Types.TransactionUnspentOutput"]||{},e["Ctl.Internal.Plutus.Types.TransactionUnspentOutput"].mkTxUnspentOut=function(e){return function(n){return{input:e,output:n}}}}(c),function(e){"use strict";e["Ctl.Internal.Types.Redeemer"]=e["Ctl.Internal.Types.Redeemer"]||{},e["Ctl.Internal.Types.Redeemer"].Redeemer=function(e){return e}}(c),function(e){"use strict";e.decodeImpl=function(e,n,t,r){var o,a=new TextDecoder(t);try{o=n(a.decode(r))}catch(n){o=e(n)}return o}}(c["Data.TextDecoder"]=c["Data.TextDecoder"]||{}),function(e){"use strict";e["Data.TextDecoder"]=e["Data.TextDecoder"]||{};var n,t=e["Data.TextDecoder"],r=e["Data.TextDecoder"],o=e["Data.Either"],a=e["Data.Show"],u=function(){function e(){}return e.value=new e,e}(),i=function(){function e(){}return e.value=new e,e}(),c=function(){function e(){}return e.value=new e,e}(),l=function(){function e(){}return e.value=new e,e}(),s=function(){function e(){}return e.value=new e,e}(),f=function(){function e(){}return e.value=new e,e}(),d=function(){function e(){}return e.value=new e,e}(),v=function(){function e(){}return e.value=new e,e}(),m=function(){function e(){}return e.value=new e,e}(),p=function(){function e(){}return e.value=new e,e}(),g=function(){function e(){}return e.value=new e,e}(),y=function(){function e(){}return e.value=new e,e}(),w=function(){function e(){}return e.value=new e,e}(),h=function(){function e(){}return e.value=new e,e}(),b=function(){function e(){}return e.value=new e,e}(),C=function(){function e(){}return e.value=new e,e}(),A=function(){function e(){}return e.value=new e,e}(),S=function(){function e(){}return e.value=new e,e}(),I=function(){function e(){}return e.value=new e,e}(),T=function(){function e(){}return e.value=new e,e}(),D=function(){function e(){}return e.value=new e,e}(),F=function(){function e(){}return e.value=new e,e}(),E=function(){function e(){}return e.value=new e,e}(),x=function(){function e(){}return e.value=new e,e}(),M=function(){function e(){}return e.value=new e,e}(),R=function(){function e(){}return e.value=new e,e}(),P=function(){function e(){}return e.value=new e,e}(),B=function(){function e(){}return e.value=new e,e}(),k=function(){function e(){}return e.value=new e,e}(),N=function(){function e(){}return e.value=new e,e}(),L=function(){function e(){}return e.value=new e,e}(),_=function(){function e(){}return e.value=new e,e}(),U=function(){function e(){}return e.value=new e,e}(),H=function(){function e(){}return e.value=new e,e}(),q=function(){function e(){}return e.value=new e,e}(),O=function(){function e(){}return e.value=new e,e}(),W=function(){function e(){}return e.value=new e,e}(),V=function(){function e(){}return e.value=new e,e}(),K=function(){function e(){}return e.value=new e,e}(),z=function(){function e(){}return e.value=new e,e}(),J={show:function(e){if(e instanceof u)return"utf-8";if(e instanceof i)return"ibm866";if(e instanceof c)return"iso-8859-2";if(e instanceof l)return"iso-8859-3";if(e instanceof s)return"iso-8859-4";if(e instanceof f)return"iso-8859-5";if(e instanceof d)return"iso-8859-6";if(e instanceof v)return"iso-8859-7";if(e instanceof m)return"iso-8859-8";if(e instanceof p)return"iso-8859-8-i";if(e instanceof g)return"iso-8859-10";if(e instanceof y)return"iso-8859-13";if(e instanceof w)return"iso-8859-14";if(e instanceof h)return"iso-8859-15";if(e instanceof b)return"iso-8859-16";if(e instanceof C)return"koi8-r";if(e instanceof A)return"koi8-u";if(e instanceof S)return"macintosh";if(e instanceof I)return"windows-874";if(e instanceof T)return"windows-1250";if(e instanceof D)return"windows-1251";if(e instanceof F)return"windows-1252";if(e instanceof E)return"windows-1253";if(e instanceof x)return"windows-1254";if(e instanceof M)return"windows-1255";if(e instanceof R)return"windows-1256";if(e instanceof P)return"windows-1257";if(e instanceof B)return"windows-1258";if(e instanceof k)return"x-max-cyrillic";if(e instanceof N)return"gbk";if(e instanceof L)return"gb18030";if(e instanceof _)return"big5";if(e instanceof U)return"euc-jp";if(e instanceof H)return"iso-2022-jp";if(e instanceof q)return"shift-jis";if(e instanceof O)return"euc-kr";if(e instanceof W)return"iso-2022-kr";if(e instanceof V)return"utf-16be";if(e instanceof K)return"utf-16le";if(e instanceof z)return"x-user-defined";throw new Error("Failed pattern match at Data.TextDecoder (line 87, column 1 - line 127, column 41): "+[e.constructor.name])}},j=(n=u.value,function(e){return r.decodeImpl(o.Left.create,o.Right.create,a.show(J)(n),e)});t.decodeUtf8=j}(c),function(e){"use strict";e["Ext.Contract.Time"]=e["Ext.Contract.Time"]||{};var n=e["Ext.Contract.Time"],t=e["Data.BigInt"],r=e["Data.Semiring"];n.addTimes=function(e){return function(n){return r.add(t.semiringBigInt)(e)(n)}}}(c),function(e){"use strict";e["Ext.Contract.Value"]=e["Ext.Contract.Value"]||{};var n,t=e["Ext.Contract.Value"],r=e["Contract.Monad"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Ctl.Internal.Contract.Monad"],i=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],c=e["Ctl.Internal.Plutus.Types.Value"],l=e["Ctl.Internal.Scripts"],s=e["Ctl.Internal.Types.ByteArray"],f=e["Ctl.Internal.Types.TokenName"],d=e["Data.Array"],v=e["Data.Eq"],m=e["Data.Maybe"],p=e["Data.Tuple"],g=a.composeKleisliFlipped(m.bindMaybe)(f.mkTokenName)(s.byteArrayFromAscii),y=(n=r.liftContractM("Cannot make token name"),function(e){return n(g(e))});t.mkTokenName=g,t.runMkTokenName=y,t.mkCurrencySymbol=function(e){return a.bind(u.bindContract)(e)((function(e){return a.bind(u.bindContract)(r.liftContractM("Cannot get cs")(l.scriptCurrencySymbol(e)))((function(n){return o.pure(u.applicativeContract)(new p.Tuple(e,n))}))}))},t.getCurrencyByTokenName=function(e){return function(n){var t=d.filter((function(e){return v.eq(f.eqTokenName)(e.value1.value0)(n)})),r=t(c.flattenNonAdaAssets(e));return 1===r.length?new m.Just(r[0].value0):m.Nothing.value}},t.currencySymbolToString=function(e){return s.byteArrayToHex(i.getCurrencySymbol(e))},t.mkCurrencySymbolFromString=function(e){return r.liftContractM("Impossible to make currency symbol from String")((n=e,a.bind(m.bindMaybe)(s.hexToByteArray(n))(i.mkCurrencySymbol)));var n}}(c),function(e){"use strict";e["Ext.Data.Either"]=e["Ext.Data.Either"]||{};var n=e["Ext.Data.Either"],t=e["Control.Applicative"],r=e["Ctl.Internal.Contract.Monad"],o=e["Data.Either"],a=e["Data.Show"],u=e["Effect.Class"],i=e["Effect.Exception"];n.eitherContract=function(e){return function(n){return o.either((function(t){return u.liftEffect(r.monadEffectContract)(i.throw(n+a.show(e)(t)))}))(t.pure(r.applicativeContract))}}}(c),function(e){"use strict";e["Ext.Data.Ratio"]=e["Ext.Data.Ratio"]||{};var n=e["Ext.Data.Ratio"],t=e["Data.BigInt"],r=e["Data.Eq"],o=e["Data.Maybe"],a=e["Data.Ratio"],u=e.Math;n.mkBigIntRational=function(e){return r.eq(t.eqBigInt)(e.value1)(t.fromInt(0))?o.Nothing.value:new o.Just(a.reduce(t.ordBigInt)(t.euclideanRingBigInt)(e.value0)(e.value1))},n.roundBigIntRatio=function(e){return t.fromNumber(u.round((n=e,t.toNumber(a.numerator(n))/t.toNumber(a.denominator(n)))));var n}}(c),function(e){"use strict";e["Ext.Seriaization.Key"]=e["Ext.Seriaization.Key"]||{};var n=e["Ext.Seriaization.Key"],t=e["Contract.Monad"],r=e["Ctl.Internal.Serialization.Hash"],o=e["Data.Newtype"];n.pkhToBech32M=function(e){return t.liftContractM("Impossible to serialize pkh")(function(e){return r.ed25519KeyHashToBech32("addr_vkh")(o.unwrap()(o.unwrap()(e)))}(e))}}(c),function(e){"use strict";e["Shared.MinAda"]=e["Shared.MinAda"]||{};var n=e["Shared.MinAda"],t=e["Ctl.Internal.Plutus.Types.Value"],r=e["Data.BigInt"].fromInt(2e6),o=t.lovelaceValueOf(r);n.minAda=r,n.minAdaValue=o}(c),function(e){"use strict";e["Fundraising.Calculations"]=e["Fundraising.Calculations"]||{};var n=e["Fundraising.Calculations"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Data.BigInt"],a=e["Data.Maybe"],u=e["Data.Ord"],i=e["Data.Semiring"],c=e["Data.Tuple"],l=e["Ext.Data.Ratio"],s=e["Shared.MinAda"];n.calcFee=function(e){return function(n){return r.bind(a.bindMaybe)(l.mkBigIntRational(new c.Tuple(i.mul(o.semiringBigInt)(e)(n),o.fromInt(100))))((function(e){return r.bind(a.bindMaybe)(l.roundBigIntRatio(e))((function(e){var n=u.max(o.ordBigInt)(e)(s.minAda);return t.pure(a.applicativeMaybe)(n)}))}))}}}(c),function(e){"use strict";e["Fundraising.Datum"]=e["Fundraising.Datum"]||{};var n=e["Fundraising.Datum"],t=e["Ctl.Internal.FromData"],r=e["Ctl.Internal.Plutus.Types.Address"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.TypeLevel.Nat"],u=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],i=e["Ctl.Internal.Types.Interval"],c=e["Ctl.Internal.Types.PubKeyHash"],l=e["Ctl.Internal.Types.Transaction"],s={to:function(e){return e},from:function(e){return e}},f={toData:o.genericToData(s)(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PFundraisingDatum"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"PFundraisingDatum"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(c.toDataPaymentPubKeyHash)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(i.toDataPOSIXTime)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataByteArray)(o.toDataArgsRLHelperCons(r.toDataAddress)(o.toDataArgsRLHelperCons(l.toDataTransactionInput)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"tokenOrigin"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatS(a.knownNatZ)))()()()({reflectSymbol:function(){return"managerAddress"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))))()()()({reflectSymbol:function(){return"frTitle"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatZ))))()()()({reflectSymbol:function(){return"frFee"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))))()()()({reflectSymbol:function(){return"frDeadline"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))()()()({reflectSymbol:function(){return"frAmount"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))()()()({reflectSymbol:function(){return"creatorPkh"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatZ)))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PFundraisingDatum"}})(a.knownNatZ))(a.knownNatZ))},d={fromData:t.genericFromData(s)(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"PFundraisingDatum"}})()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PFundraisingDatum"}})(a.knownNatZ))(t.fromDataArgsArgumentRecor(t.fromDataArgsRLCons(c.fromDataPaymentPubKeyHash)(t.fromDataArgsRLCons(l.fromDataTransactionInput)(t.fromDataArgsRLCons(t.fromDataByteArray)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(i.fromDataPOSIXTime)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(r.fromDataAddress)(t.fromDataArgsRLNilRow)()()({reflectSymbol:function(){return"managerAddress"}}))()()({reflectSymbol:function(){return"frFee"}}))()()({reflectSymbol:function(){return"frDeadline"}}))()()({reflectSymbol:function(){return"frAmount"}}))()()({reflectSymbol:function(){return"frTitle"}}))()()({reflectSymbol:function(){return"tokenOrigin"}}))()()({reflectSymbol:function(){return"creatorPkh"}}))()()())(a.knownNatZ))};n.titleLength=35,n.toDataPFundraisingDatum=f,n.fromDataPFundraisingDatum=d}(c),function(e){let n;n=t(1761),e.fundraisingValidator=n}(c["Fundraising.FundraisingScript"]=c["Fundraising.FundraisingScript"]||{}),function(e){"use strict";e["Protocol.Models"]=e["Protocol.Models"]||{};var n=e["Protocol.Models"],t=e["Ctl.Internal.Plutus.Types.Address"],r=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.TypeLevel.Nat"],u=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],i=e["Ctl.Internal.Types.TokenName"],c={toData:o.genericToData({to:function(e){return e},from:function(e){return e}})(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"Protocol"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"Protocol"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(r.toDataCurrencySymbol)(o.toDataArgsRLHelperCons(i.toDataTokenName)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"protocolTokenName"}})({reflectSymbol:function(){return"Protocol"}})()()()()(a.knownNatS(a.knownNatZ)))()()()({reflectSymbol:function(){return"protocolCurrency"}})({reflectSymbol:function(){return"Protocol"}})()()()()(a.knownNatZ)))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"Protocol"}})(a.knownNatZ))(a.knownNatZ))},l={toData:o.genericToData({to:function(e){return e},from:function(e){return e}})(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PProtocolConfig"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"PProtocolConfig"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"protocolFee"}})({reflectSymbol:function(){return"PProtocolConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))()()()({reflectSymbol:function(){return"minDuration"}})({reflectSymbol:function(){return"PProtocolConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatZ))))()()()({reflectSymbol:function(){return"minAmount"}})({reflectSymbol:function(){return"PProtocolConfig"}})()()()()(a.knownNatZ))()()()({reflectSymbol:function(){return"maxDuration"}})({reflectSymbol:function(){return"PProtocolConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))()()()({reflectSymbol:function(){return"maxAmount"}})({reflectSymbol:function(){return"PProtocolConfig"}})()()()()(a.knownNatS(a.knownNatZ))))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PProtocolConfig"}})(a.knownNatZ))(a.knownNatZ))},s={toData:o.genericToData({to:function(e){return e},from:function(e){return e}})(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PFundriseConfig"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"PFundriseConfig"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(t.toDataAddress)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(r.toDataCurrencySymbol)(o.toDataArgsRLHelperCons(i.toDataTokenName)(o.toDataArgsRLHelperCons(r.toDataCurrencySymbol)(o.toDataArgsRLHelperCons(i.toDataTokenName)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"verTokenName"}})({reflectSymbol:function(){return"PFundriseConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatZ))))()()()({reflectSymbol:function(){return"verCurrencySymbol"}})({reflectSymbol:function(){return"PFundriseConfig"}})()()()()(a.knownNatS(a.knownNatZ)))()()()({reflectSymbol:function(){return"threadTokenName"}})({reflectSymbol:function(){return"PFundriseConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))()()()({reflectSymbol:function(){return"threadCurrencySymbol"}})({reflectSymbol:function(){return"PFundriseConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))()()()({reflectSymbol:function(){return"startedAt"}})({reflectSymbol:function(){return"PFundriseConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))))()()()({reflectSymbol:function(){return"scriptAddress"}})({reflectSymbol:function(){return"PFundriseConfig"}})()()()()(a.knownNatZ)))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PFundriseConfig"}})(a.knownNatZ))(a.knownNatZ))};n.toDataProtocol=c,n.toDataPProtocolConfig=l,n.toDataPFundriseConfig=s}(c),function(e){"use strict";e["Fundraising.Models"]=e["Fundraising.Models"]||{};var n=e["Fundraising.Models"],t=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],r=e["Ctl.Internal.ToData"],o=e["Ctl.Internal.TypeLevel.Nat"],a=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],u=e["Ctl.Internal.Types.TokenName"],i=e["Protocol.Models"],c={toData:r.genericToData({to:function(e){return e},from:function(e){return e}})(r.toDataWithSchemaConstruct({reflectSymbol:function(){return"Fundraising"}})(r.toDataArgsArgumentRecord(r.toDataArgsRecord({reflectSymbol:function(){return"Fundraising"}})(r.toDataArgsRL(r.toDataArgsRLHelperCons(i.toDataProtocol)(r.toDataArgsRLHelperCons(t.toDataCurrencySymbol)(r.toDataArgsRLHelperCons(u.toDataTokenName)(r.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"verTokenName"}})({reflectSymbol:function(){return"Fundraising"}})()()()()(o.knownNatS(o.knownNatS(o.knownNatZ))))()()()({reflectSymbol:function(){return"verTokenCurrency"}})({reflectSymbol:function(){return"Fundraising"}})()()()()(o.knownNatS(o.knownNatZ)))()()()({reflectSymbol:function(){return"protocol"}})({reflectSymbol:function(){return"Fundraising"}})()()()()(o.knownNatZ)))()))()()(a.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"Fundraising"}})(o.knownNatZ))(o.knownNatZ))};n.toDataFundraising=c}(c),function(e){"use strict";e["Fundraising.FundraisingScript"]=e["Fundraising.FundraisingScript"]||{};var n=e["Fundraising.FundraisingScript"],t=e["Fundraising.FundraisingScript"],r=e["Contract.Monad"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Ctl.Internal.ApplyArgs"],c=e["Ctl.Internal.Cardano.TextEnvelope"],l=e["Ctl.Internal.Contract.Monad"],s=e["Ctl.Internal.Scripts"],f=e["Ctl.Internal.ToData"],d=e["Data.Array"],v=e["Data.Maybe"],m=e["Effect.Exception"],p=e["Ext.Contract.Value"],g=e["Fundraising.Models"],y=function(e){return a.bind(l.bindContract)(u.liftMaybe(l.monadThrowErrorContract)(m.error("Error decoding fundraisingValidator"))(a.bind(v.bindMaybe)(c.decodeTextEnvelope(t.fundraisingValidator))((function(e){return c.plutusScriptV2FromEnvelope(e)}))))((function(n){return a.bind(l.bindContract)(r.liftContractE(i.showApplyArgsError)((t=n,function(e){var n=d.singleton(f.toData(g.toDataFundraising)(e));return i.applyArgs(t)(n)})(e)))((function(e){return o.pure(l.applicativeContract)(e)}));var t}))},w="FundraisingThreadToken",h=p.mkTokenName(w),b=r.liftContractM("Cannot make Fundraising token name")(h);n.fundraisingValidatorScript=y,n.getFundraisingValidatorHash=function(e){return a.bind(l.bindContract)(y(e))((function(e){return o.pure(l.applicativeContract)(s.validatorHash(e))}))},n.getFundraisingTokenName=b,n.fundraisingTokenNameString=w}(c),function(e){let n;n=t(1946),e.nftPolicy=n}(c["MintingPolicy.NftMinting"]=c["MintingPolicy.NftMinting"]||{}),function(e){"use strict";e["MintingPolicy.NftMinting"]=e["MintingPolicy.NftMinting"]||{};var n,t=e["MintingPolicy.NftMinting"],r=e["MintingPolicy.NftMinting"],o=e["Contract.Monad"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Ctl.Internal.ApplyArgs"],c=e["Ctl.Internal.Cardano.TextEnvelope"],l=e["Ctl.Internal.Contract.Monad"],s=e["Ctl.Internal.ToData"],f=e["Ctl.Internal.Types.Scripts"],d=e["Ctl.Internal.Types.Transaction"],v=e["Data.Array"],m=e["Data.Functor"],p=e["Data.Maybe"],g=e["Effect.Exception"],y=(n=m.map(l.functorContract)(f.PlutusMintingPolicy.create),function(e){return n((t=e,a.bind(l.bindContract)(u.liftMaybe(l.monadThrowErrorContract)(g.error("Error decoding nftPolicy"))(a.bind(p.bindMaybe)(c.decodeTextEnvelope(r.nftPolicy))((function(e){return c.plutusScriptV2FromEnvelope(e)}))))((function(e){return o.liftContractE(i.showApplyArgsError)((n=e,function(e){var t=v.singleton(s.toData(d.toDataTransactionInput)(e));return i.applyArgs(n)(t)})(t));var n}))));var t});t.mintingPolicy=y}(c),function(e){"use strict";e["MintingPolicy.NftRedeemer"]=e["MintingPolicy.NftRedeemer"]||{};var n=e["MintingPolicy.NftRedeemer"],t=e["Ctl.Internal.ToData"],r=e["Ctl.Internal.TypeLevel.Nat"],o=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],a=e["Ctl.Internal.Types.TokenName"],u=e["Data.Generic.Rep"],i=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l={to:function(e){if(e instanceof u.Inl)return new i(e.value0);if(e instanceof u.Inr)return new c(e.value0);throw new Error("Failed pattern match at MintingPolicy.NftRedeemer (line 21, column 1 - line 21, column 39): "+[e.constructor.name])},from:function(e){if(e instanceof i)return new u.Inl(e.value0);if(e instanceof c)return new u.Inr(e.value0);throw new Error("Failed pattern match at MintingPolicy.NftRedeemer (line 21, column 1 - line 21, column 39): "+[e.constructor.name])}},s={toData:t.genericToData(l)(t.toDataWithSchemaSum(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PMintNft"}})(t.toDataArgsArgument(a.toDataTokenName)({reflectSymbol:function(){return"PMintNft"}}))()()(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PMintNft"}})(r.knownNatZ))(r.knownNatZ))(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PBurnNft"}})(t.toDataArgsArgument(a.toDataTokenName)({reflectSymbol:function(){return"PBurnNft"}}))()()(o.getIndexWithLabelConsI(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PBurnNft"}})(r.knownNatS(r.knownNatZ)))()()({reflectSymbol:function(){return"PBurnNft"}})(r.knownNatS(r.knownNatZ)))(r.knownNatS(r.knownNatZ))))};n.PMintNft=i,n.PBurnNft=c,n.toDataPNftRedeemer=s}(c),function(e){let n;n=t(615),e.verTokenPolicy=n}(c["MintingPolicy.VerTokenMinting"]=c["MintingPolicy.VerTokenMinting"]||{}),function(e){"use strict";e["MintingPolicy.VerTokenMinting"]=e["MintingPolicy.VerTokenMinting"]||{};var n,t=e["MintingPolicy.VerTokenMinting"],r=e["MintingPolicy.VerTokenMinting"],o=e["Contract.Monad"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Ctl.Internal.ApplyArgs"],c=e["Ctl.Internal.Cardano.TextEnvelope"],l=e["Ctl.Internal.Contract.Monad"],s=e["Ctl.Internal.ToData"],f=e["Ctl.Internal.Types.Scripts"],d=e["Data.Array"],v=e["Data.Functor"],m=e["Data.Maybe"],p=e["Effect.Exception"],g=e["Ext.Contract.Value"],y=e["Protocol.Models"],w=g.runMkTokenName("VerificationToken"),h=(n=v.map(l.functorContract)(f.PlutusMintingPolicy.create),function(e){return n((t=e,a.bind(l.bindContract)(u.liftMaybe(l.monadThrowErrorContract)(p.error("Error decoding nftPolicy"))(a.bind(m.bindMaybe)(c.decodeTextEnvelope(r.verTokenPolicy))((function(e){return c.plutusScriptV2FromEnvelope(e)}))))((function(e){return o.liftContractE(i.showApplyArgsError)((n=e,function(e){var t=d.singleton(s.toData(y.toDataProtocol)(e));return i.applyArgs(n)(t)})(t));var n}))));var t});t.mintingPolicy=h,t.verTokenName=w}(c),function(e){"use strict";e["MintingPolicy.VerTokenRedeemers"]=e["MintingPolicy.VerTokenRedeemers"]||{};var n=e["MintingPolicy.VerTokenRedeemers"],t=e["Ctl.Internal.ToData"],r=e["Ctl.Internal.TypeLevel.Nat"],o=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],a=e["Ctl.Internal.Types.TokenName"],u=e["Data.Generic.Rep"],i=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l={to:function(e){if(e instanceof u.Inl)return new i(e.value0);if(e instanceof u.Inr)return new c(e.value0);throw new Error("Failed pattern match at MintingPolicy.VerTokenRedeemers (line 21, column 1 - line 21, column 44): "+[e.constructor.name])},from:function(e){if(e instanceof i)return new u.Inl(e.value0);if(e instanceof c)return new u.Inr(e.value0);throw new Error("Failed pattern match at MintingPolicy.VerTokenRedeemers (line 21, column 1 - line 21, column 44): "+[e.constructor.name])}},s={toData:t.genericToData(l)(t.toDataWithSchemaSum(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PMintVerToken"}})(t.toDataArgsArgument(a.toDataTokenName)({reflectSymbol:function(){return"PMintVerToken"}}))()()(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PMintVerToken"}})(r.knownNatZ))(r.knownNatZ))(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PBurnVerToken"}})(t.toDataArgsArgument(a.toDataTokenName)({reflectSymbol:function(){return"PBurnVerToken"}}))()()(o.getIndexWithLabelConsI(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PBurnVerToken"}})(r.knownNatS(r.knownNatZ)))()()({reflectSymbol:function(){return"PBurnVerToken"}})(r.knownNatS(r.knownNatZ)))(r.knownNatS(r.knownNatZ))))};n.PMintVerToken=i,n.PBurnVerToken=c,n.toDataPVerTokenRedeemer=s}(c),function(e){"use strict";e["Protocol.Datum"]=e["Protocol.Datum"]||{};var n=e["Protocol.Datum"],t=e["Ctl.Internal.FromData"],r=e["Ctl.Internal.Plutus.Types.Address"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.TypeLevel.Nat"],u=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],i=e["Ctl.Internal.Types.Transaction"],c=e["Data.BigInt"],l=e["Data.Lens.Iso.Newtype"],s=e["Data.Lens.Record"],f=e["Data.Show"],d=e["Type.Proxy"],v=f.showRecord()(f.showRecordFieldsCons({reflectSymbol:function(){return"managerAddress"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"maxAmount"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"maxDuration"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"minAmount"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"minDuration"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"protocolFee"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"tokenOriginRef"}})(f.showRecordFieldsNil)(i.showTransactionInput))(c.showBigInt))(c.showBigInt))(c.showBigInt))(c.showBigInt))(c.showBigInt))(r.showAddress)),m={to:function(e){return e},from:function(e){return e}},p={toData:o.genericToData(m)(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PProtocolDatum"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"PProtocolDatum"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(r.toDataAddress)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(i.toDataTransactionInput)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"tokenOriginRef"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))))()()()({reflectSymbol:function(){return"protocolFee"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))()()()({reflectSymbol:function(){return"minDuration"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatZ))))()()()({reflectSymbol:function(){return"minAmount"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatZ))()()()({reflectSymbol:function(){return"maxDuration"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))()()()({reflectSymbol:function(){return"maxAmount"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatS(a.knownNatZ)))()()()({reflectSymbol:function(){return"managerAddress"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PProtocolDatum"}})(a.knownNatZ))(a.knownNatZ))},g={fromData:t.genericFromData(m)(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"PProtocolDatum"}})()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PProtocolDatum"}})(a.knownNatZ))(t.fromDataArgsArgumentRecor(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(r.fromDataAddress)(t.fromDataArgsRLCons(i.fromDataTransactionInput)(t.fromDataArgsRLNilRow)()()({reflectSymbol:function(){return"tokenOriginRef"}}))()()({reflectSymbol:function(){return"managerAddress"}}))()()({reflectSymbol:function(){return"protocolFee"}}))()()({reflectSymbol:function(){return"maxDuration"}}))()()({reflectSymbol:function(){return"minDuration"}}))()()({reflectSymbol:function(){return"maxAmount"}}))()()({reflectSymbol:function(){return"minAmount"}}))()()())(a.knownNatZ))};n._minAmount=function(e){var n=l._Newtype()()(e.Profunctor0()),t=s.prop({reflectSymbol:function(){return"minAmount"}})()()(d.Proxy.value)(e);return function(e){return n(t(e))}},n._maxAmount=function(e){var n=l._Newtype()()(e.Profunctor0()),t=s.prop({reflectSymbol:function(){return"maxAmount"}})()()(d.Proxy.value)(e);return function(e){return n(t(e))}},n._minDuration=function(e){var n=l._Newtype()()(e.Profunctor0()),t=s.prop({reflectSymbol:function(){return"minDuration"}})()()(d.Proxy.value)(e);return function(e){return n(t(e))}},n._maxDuration=function(e){var n=l._Newtype()()(e.Profunctor0()),t=s.prop({reflectSymbol:function(){return"maxDuration"}})()()(d.Proxy.value)(e);return function(e){return n(t(e))}},n._protocolFee=function(e){var n=l._Newtype()()(e.Profunctor0()),t=s.prop({reflectSymbol:function(){return"protocolFee"}})()()(d.Proxy.value)(e);return function(e){return n(t(e))}},n._managerAddress=function(e){var n=l._Newtype()()(e.Profunctor0()),t=s.prop({reflectSymbol:function(){return"managerAddress"}})()()(d.Proxy.value)(e);return function(e){return n(t(e))}},n.showPProtocolDatum=v,n.toDataPProtocolDatum=p,n.fromDataPProtocolDatum=g}(c),function(e){let n;n=t(2076),e.protocolValidator=n}(c["Protocol.ProtocolScript"]=c["Protocol.ProtocolScript"]||{}),function(e){"use strict";e["Protocol.ProtocolScript"]=e["Protocol.ProtocolScript"]||{};var n=e["Protocol.ProtocolScript"],t=e["Protocol.ProtocolScript"],r=e["Contract.Monad"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Ctl.Internal.ApplyArgs"],c=e["Ctl.Internal.Cardano.TextEnvelope"],l=e["Ctl.Internal.Contract.Monad"],s=e["Ctl.Internal.Scripts"],f=e["Ctl.Internal.ToData"],d=e["Data.Array"],v=e["Data.Maybe"],m=e["Effect.Exception"],p=e["Protocol.Models"],g=function(e){return a.bind(l.bindContract)(u.liftMaybe(l.monadThrowErrorContract)(m.error("Error decoding protocolValidator"))(a.bind(v.bindMaybe)(c.decodeTextEnvelope(t.protocolValidator))((function(e){return c.plutusScriptV2FromEnvelope(e)}))))((function(n){return a.bind(l.bindContract)(r.liftContractE(i.showApplyArgsError)((t=n,function(e){var n=d.singleton(f.toData(p.toDataProtocol)(e));return i.applyArgs(t)(n)})(e)))((function(e){return o.pure(l.applicativeContract)(e)}));var t}))};n.protocolValidatorScript=g,n.getProtocolValidatorHash=function(e){return a.bind(l.bindContract)(g(e))((function(e){return o.pure(l.applicativeContract)(s.validatorHash(e))}))}}(c),function(e){"use strict";e["Protocol.UserData"]=e["Protocol.UserData"]||{};var n=e["Protocol.UserData"],t=e["Contract.Monad"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],i=e["Ctl.Internal.Types.ByteArray"],c=e["Ctl.Internal.Types.TokenName"],l=e["Data.Maybe"];n.getConfigFromProtocolDatum=function(e){return{minAmountParam:e.minAmount,maxAmountParam:e.maxAmount,minDurationParam:e.minDuration,maxDurationParam:e.maxDuration,protocolFeeParam:e.protocolFee}},n.dataToProtocol=function(e){return o.bind(a.bindContract)(t.liftContractM("Impossible to get protocol currency symbol")(o.bind(l.bindMaybe)(i.hexToByteArray(e.protocolCurrency))(u.mkCurrencySymbol)))((function(n){return o.bind(a.bindContract)(t.liftContractM("Impossible to get protocol token name")(o.bind(l.bindMaybe)(i.byteArrayFromAscii(e.protocolTokenName))(c.mkTokenName)))((function(e){return r.pure(a.applicativeContract)({protocolCurrency:n,protocolTokenName:e})}))}))}}(c),function(e){"use strict";e["Shared.Utxo"]=e["Shared.Utxo"]||{};var n=e["Shared.Utxo"],t=e["Contract.Monad"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Cardano.Types.ScriptRef"],u=e["Ctl.Internal.Contract.Monad"],i=e["Ctl.Internal.FromData"],c=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],l=e["Ctl.Internal.Plutus.Types.Transaction"],s=e["Ctl.Internal.Plutus.Types.Value"],f=e["Ctl.Internal.Types.OutputDatum"],d=e["Ctl.Internal.Types.TokenName"],v=e["Data.Array"],m=e["Data.BigInt"],p=e["Data.Eq"],g=e["Data.Lens.Getter"],y=e["Data.Lens.Internal.Forget"],w=e["Data.Map.Internal"],h=e["Data.Maybe"],b=e["Data.Semiring"],C=e["Data.Unfoldable"],A=function(e){return function(n){var t=g.viewOn(g.viewOn(n.value1)(l._output(y.strongForget)))(l._amount(y.strongForget));return p.eq(m.eqBigInt)(s.valueOf(t)(e.value0)(e.value1))(b.one(m.semiringBigInt))}},S=function(e){return v.filter(A(e))},I=s.singleton(c.adaSymbol)(d.adaToken)(m.fromInt(5e6)),T=v.filter((function(e){var n=g.viewOn(g.viewOn(e.value1)(l._output(y.strongForget)))(l._amount(y.strongForget));return p.notEq(s.eqValue)(n)(I)}));n.getNonCollateralUtxo=function(e){var n=T(w.toUnfoldable(C.unfoldableArray)(e));return o.bind(u.bindContract)(t.liftContractM("Failed to get non collateral utxo")(v.head(n)))((function(e){return r.pure(u.applicativeContract)(w.singleton(e.value0)(e.value1))}))},n.checkTokenInUTxO=A,n.filterByToken=S,n.getUtxoByNFT=function(e){return function(n){return function(r){return t.liftContractM(e+" UTxO with given nft not found")(v.head(S(n)(w.toUnfoldable(C.unfoldableArray)(r))))}}},n.getUtxoByScriptRef=function(e){return function(n){return function(r){return t.liftContractM(e+" UTxO with script reference not found")(v.head(function(e){return v.filter(function(e){return function(n){return p.eq(h.eqMaybe(a.eqScriptRef))(g.viewOn(n.value1)(l._scriptRef(y.strongForget)))(new h.Just(e))}}(e))}(n)(w.toUnfoldable(C.unfoldableArray)(r))))}}},n.extractDatumFromUTxO=function(e){return function(n){var t=g.viewOn(g.viewOn(n.value1)(l._output(y.strongForget)))(l._datum(y.strongForget));return t instanceof f.OutputDatum?i.fromData(e)(t.value0):h.Nothing.value}},n.extractValueFromUTxO=function(e){return g.viewOn(g.viewOn(e.value1)(l._output(y.strongForget)))(l._amount(y.strongForget))}}(c),function(e){"use strict";e["Shared.OwnCredentials"]=e["Shared.OwnCredentials"]||{};var n=e["Shared.OwnCredentials"],t=e["Contract.Address"],r=e["Contract.Log"],o=e["Contract.Monad"],a=e["Contract.Utxos"],u=e["Control.Applicative"],i=e["Control.Bind"],c=e["Ctl.Internal.Contract.Monad"],l=e["Ctl.Internal.Plutus.Types.Address"],s=e["Ctl.Internal.Plutus.Types.Credential"],f=e["Ctl.Internal.Types.PubKeyHash"],d=e["Data.Array"],v=e["Data.Eq"],m=e["Data.Functor"],p=e["Data.Map.Internal"],g=e["Data.Maybe"],y=e["Data.Show"],w=e["Data.Tuple"],h=e["Data.Unfoldable"],b=e["Effect.Class"],C=e["Effect.Exception"],A=e["Shared.Utxo"],S=i.bind(c.bindContract)(t.ownPaymentPubKeysHashes)((function(e){return i.bind(c.bindContract)(o.liftContractM("Impossible to get own PaymentPubkeyHash")(d.head(e)))((function(e){return i.discard(i.discardUnit)(c.bindContract)(r["logInfo'"](c.monadLoggerContract)("Own Payment pkh is: "+y.show(f.showPaymentPubKeyHash)(e)))((function(){return i.bind(c.bindContract)(o.liftedM("Failed to get own address")(m.map(c.functorContract)(d.head)(t.getWalletAddressesWithNetworkTag)))((function(n){return u.pure(c.applicativeContract)(new w.Tuple(e,n))}))}))}))})),I=i.bind(c.bindContract)(S)((function(e){return i.bind(c.bindContract)(m.map(c.functorContract)((n=i.join(g.bindMaybe),function(e){return n(d.head(e))}))(t.ownStakePubKeysHashes))((function(n){return i.bind(c.bindContract)(o.liftContractM("Failed to get own SKH")(n))((function(n){return i.bind(c.bindContract)(i.bind(c.bindContract)(a.utxosAt(l.plutusAddressAddressWithN)(e.value1))(A.getNonCollateralUtxo))((function(t){return i.bind(c.bindContract)(o.liftContractM("Utxo set is empty")(m.map(g.functorMaybe)(w.fst)(d.head(p.toUnfoldable(h.unfoldableArray)(t)))))((function(r){return u.pure(c.applicativeContract)({ownPkh:e.value0,ownSkh:n,ownAddressWithNetworkTag:e.value1,ownUtxos:t,nonCollateralORef:r})}))}))}))}));var n}));n.getOwnCreds=I,n.getOwnUserInfo=function(e){return i.bind(c.bindContract)(S)((function(n){return u.pure(c.applicativeContract)({address:t.addressWithNetworkTagToBech32(n.value1),isManager:v.eq(f.eqPaymentPubKeyHash)(n.value0)(e)})}))},n.getPkhSkhFromAddress=function(e){return i.bind(c.bindContract)(o.liftContractM("Impossible to extract payment pkh from script address")(l.toPubKeyHash(e)))((function(n){return i.bind(c.bindContract)(o.liftContractM("Staking creds missed from provided address")(l.toStakingCredential(e)))((function(e){return i.bind(c.bindContract)(e instanceof s.StakingHash?o.liftContractM("Impossible to extract staking pkh")((t=e.value0)instanceof s.PubKeyCredential?new g.Just(t.value0):g.Nothing.value):b.liftEffect(c.monadEffectContract)(C.throw("Unexpected staking credentials")))((function(e){return u.pure(c.applicativeContract)(new w.Tuple(n,e))}));var t}))}))}}(c),function(e){"use strict";e["Shared.NetworkData"]=e["Shared.NetworkData"]||{};var n=e["Shared.NetworkData"],t=e["Ctl.Internal.Serialization.Address"],r=e["Data.Generic.Rep"],o=e["Data.Maybe"],a=e["Data.Show.Generic"],u=e["Data.Tuple"],i=function(){function e(){}return e.value=new e,e}(),c=function(){function e(){}return e.value=new e,e}(),l=function(){function e(){}return e.value=new e,e}(),s=function(){function e(){}return e.value=new e,e}(),f={to:function(e){if(e instanceof r.Inl)return i.value;if(e instanceof r.Inr&&e.value0 instanceof r.Inl)return c.value;if(e instanceof r.Inr&&e.value0 instanceof r.Inr&&e.value0.value0 instanceof r.Inl)return l.value;if(e instanceof r.Inr&&e.value0 instanceof r.Inr&&e.value0.value0 instanceof r.Inr)return s.value;throw new Error("Failed pattern match at Shared.NetworkData (line 17, column 1 - line 17, column 37): "+[e.constructor.name])},from:function(e){if(e instanceof i)return new r.Inl(r.NoArguments.value);if(e instanceof c)return new r.Inr(new r.Inl(r.NoArguments.value));if(e instanceof l)return new r.Inr(new r.Inr(new r.Inl(r.NoArguments.value)));if(e instanceof s)return new r.Inr(new r.Inr(new r.Inr(r.NoArguments.value)));throw new Error("Failed pattern match at Shared.NetworkData (line 17, column 1 - line 17, column 37): "+[e.constructor.name])}},d={show:a.genericShow(f)(a.genericShowSum(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Nami"}}))(a.genericShowSum(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Flint"}}))(a.genericShowSum(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Lode"}}))(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Eternl"}})))))};n.Nami=i,n.Flint=c,n.Lode=l,n.Eternl=s,n.networkParamsToNetworkWallet=function(e){var n=new u.Tuple(e.wallet,e.isMainnet);return"Nami"!==n.value0||n.value1?"Flint"!==n.value0||n.value1?"Lode"!==n.value0||n.value1?"Eternl"!==n.value0||n.value1?"Nami"===n.value0&&n.value1?new o.Just({networkId:t.MainnetId.value,walletType:i.value}):"Flint"===n.value0&&n.value1?new o.Just({networkId:t.MainnetId.value,walletType:c.value}):"Lode"===n.value0&&n.value1?new o.Just({networkId:t.MainnetId.value,walletType:l.value}):"Eternl"===n.value0&&n.value1?new o.Just({networkId:t.MainnetId.value,walletType:s.value}):o.Nothing.value:new o.Just({networkId:t.TestnetId.value,walletType:s.value}):new o.Just({networkId:t.TestnetId.value,walletType:l.value}):new o.Just({networkId:t.TestnetId.value,walletType:c.value}):new o.Just({networkId:t.TestnetId.value,walletType:i.value})},n.showWalletType=d}(c),function(e){"use strict";e["Shared.TestnetConfig"]=e["Shared.TestnetConfig"]||{};var n=e["Shared.TestnetConfig"],t=e["Contract.Config"],r=e["Ctl.Internal.Contract.QueryBackend"],o=e["Ctl.Internal.Serialization.Address"],a=e["Ctl.Internal.Wallet.Spec"],u=e["Data.Log.Level"],i=e["Data.Maybe"],c=e["Data.Show"],l=e["Data.Tuple"],s=e["Data.UInt"],f=e["Effect.Class"],d=e["Effect.Class.Console"],v=e["Effect.Exception"],m=e["Shared.NetworkData"],p={port:s.fromInt(443),host:"ogmios.donat-pool.io",secure:!0,path:i.Nothing.value},g={port:s.fromInt(443),host:"kupo.donat-pool.io",secure:!0,path:i.Nothing.value},y={backendParams:r.mkCtlBackendParams({ogmiosConfig:p,kupoConfig:g}),networkId:t.testnetConfig.networkId,logLevel:u.Debug.value,walletSpec:t.testnetConfig.walletSpec,customLogger:t.testnetConfig.customLogger,suppressLogs:t.testnetConfig.suppressLogs,hooks:t.testnetConfig.hooks},w={backendParams:y.backendParams,networkId:y.networkId,logLevel:y.logLevel,walletSpec:new i.Just(a.ConnectToEternl.value),customLogger:y.customLogger,suppressLogs:y.suppressLogs,hooks:y.hooks},h={backendParams:y.backendParams,networkId:y.networkId,logLevel:y.logLevel,walletSpec:new i.Just(a.ConnectToFlint.value),customLogger:y.customLogger,suppressLogs:y.suppressLogs,hooks:y.hooks},b={backendParams:y.backendParams,networkId:y.networkId,logLevel:y.logLevel,walletSpec:new i.Just(a.ConnectToLode.value),customLogger:y.customLogger,suppressLogs:y.suppressLogs,hooks:y.hooks},C={backendParams:y.backendParams,networkId:y.networkId,logLevel:y.logLevel,walletSpec:new i.Just(a.ConnectToNami.value),customLogger:y.customLogger,suppressLogs:y.suppressLogs,hooks:y.hooks};n.mkNetworkWalletConfig=function(e){return function(){d.log(f.monadEffectEffect)("NetworkId: "+c.show(o.showNetworkId)(e.networkId))(),d.log(f.monadEffectEffect)("WalletType: "+c.show(m.showWalletType)(e.walletType))();var n=new l.Tuple(e.walletType,e.networkId);return n.value0 instanceof m.Nami&&n.value1 instanceof o.TestnetId?C:n.value0 instanceof m.Flint&&n.value1 instanceof o.TestnetId?h:n.value0 instanceof m.Lode&&n.value1 instanceof o.TestnetId?b:n.value0 instanceof m.Eternl&&n.value1 instanceof o.TestnetId?w:v.throw("Wallet/network configuration not implemented")()}}}(c),function(e){"use strict";e["Shared.RunContract"]=e["Shared.RunContract"]||{};var n=e["Shared.RunContract"],t=e["Control.Applicative"],r=e["Ctl.Internal.Contract.Monad"],o=e["Data.Either"],a=e["Data.Maybe"],u=e.Effect,i=e["Effect.Aff"],c=e["Effect.Exception"],l=e["Shared.NetworkData"],s=e["Shared.TestnetConfig"];n.runContractWithResult=function(e){return function(n){return function(f){return function(d){var v=function(t){if(t instanceof o.Right)return e(t.value0);if(t instanceof o.Left)return n(c.message(t.value0));throw new Error("Failed pattern match at Shared.RunContract (line 17, column 3 - line 17, column 43): "+[t.constructor.name])};return function(){var e=a.maybe(c.throw("Impossible to parse Wallet type"))(t.pure(u.applicativeEffect))(l.networkParamsToNetworkWallet(f))(),n=s.mkNetworkWalletConfig(e)();return i.runAff_(v)(r.runContract(n)(d))()}}}}}}(c),function(e){"use strict";e["Info.AppInfo"]=e["Info.AppInfo"]||{};var n=e["Info.AppInfo"],t=e["Contract.Address"],r=e["Contract.Log"],o=e["Contract.Monad"],a=e["Contract.Utxos"],u=e["Control.Applicative"],i=e["Control.Bind"],c=e["Ctl.Internal.Contract.Monad"],l=e["Ctl.Internal.Plutus.Types.Address"],s=e["Data.Newtype"],f=e["Data.Show"],d=e["Data.Tuple"],v=e["Protocol.Datum"],m=e["Protocol.ProtocolScript"],p=e["Protocol.UserData"],g=e["Shared.OwnCredentials"],y=e["Shared.RunContract"],w=e["Shared.Utxo"],h=function(e){return function(n){var t=s.unwrap()(e);return w.getUtxoByNFT("Protocol")(new d.Tuple(t.protocolCurrency,t.protocolTokenName))(n)}};n.runGetAppInfo=function(e){return function(n){return function(d){return function(b){return y.runContractWithResult(e)(n)(b)(function(e){return i.discard(i.discardUnit)(c.bindContract)(r["logInfo'"](c.monadLoggerContract)("Running get protocol info"))((function(){return i.bind(c.bindContract)(p.dataToProtocol(e))((function(e){return i.bind(c.bindContract)(m.getProtocolValidatorHash(e))((function(n){return i.bind(c.bindContract)(t.getNetworkId)((function(d){return i.bind(c.bindContract)(o.liftContractM("Impossible to get Protocol script address")(t.validatorHashBaseAddress(d)(n)))((function(n){return i.bind(c.bindContract)(a.utxosAt(l.plutusAddressAddress)(n))((function(n){return i.bind(c.bindContract)(h(e)(n))((function(e){return i.bind(c.bindContract)(o.liftContractM("Impossible to get Protocol Datum")(w.extractDatumFromUTxO(v.fromDataPProtocolDatum)(e)))((function(e){return i.discard(i.discardUnit)(c.bindContract)(r["logInfo'"](c.monadLoggerContract)("Current datum: "+f.show(v.showPProtocolDatum)(e)))((function(){return i.bind(c.bindContract)(g.getPkhSkhFromAddress(s.unwrap()(e).managerAddress))((function(n){return i.bind(c.bindContract)(g.getOwnUserInfo(n.value0))((function(n){var t={protocolConfig:p.getConfigFromProtocolDatum(e),userInfo:n};return u.pure(c.applicativeContract)(t)}))}))}))}))}))}))}))}))}))}))}))}(d))}}}},n.getProtocolUtxo=h}(c),function(e){"use strict";e["Protocol.ProtocolScriptInfo"]=e["Protocol.ProtocolScriptInfo"]||{};var n=e["Protocol.ProtocolScriptInfo"],t=e["Contract.Address"],r=e["Contract.Monad"],o=e["Contract.Utxos"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.Cardano.Types.ScriptRef"],c=e["Ctl.Internal.Contract.Monad"],l=e["Ctl.Internal.Plutus.Types.Address"],s=e["Ctl.Internal.Plutus.Types.TransactionUnspentOutput"],f=e["Ctl.Internal.Types.Scripts"],d=e["Ctl.Internal.Types.TxConstraints"],v=e["Data.Newtype"],m=e["Data.Tuple"],p=e["Effect.Class"],g=e["Effect.Exception"],y=e["Info.AppInfo"],w=e["MintingPolicy.VerTokenMinting"],h=e["Protocol.Datum"],b=e["Protocol.ProtocolScript"],C=e["Shared.Utxo"];n.getProtocolScriptInfo=function(e){return u.bind(c.bindContract)(b.protocolValidatorScript(e))((function(n){return u.bind(c.bindContract)(b.getProtocolValidatorHash(e))((function(b){return u.bind(c.bindContract)(t.getNetworkId)((function(A){return u.bind(c.bindContract)(r.liftContractM("Impossible to get Protocol script address")(t.validatorHashBaseAddress(A)(b)))((function(t){return u.bind(c.bindContract)(o.utxosAt(l.plutusAddressAddress)(t))((function(o){return u.bind(c.bindContract)(y.getProtocolUtxo(e)(o))((function(l){return u.bind(c.bindContract)(r.liftContractM("Impossible to get Protocol Datum")(C.extractDatumFromUTxO(h.fromDataPProtocolDatum)(l)))((function(r){var y=C.extractValueFromUTxO(l),h=new i.PlutusScriptRef(v.unwrap()(n));return u.bind(c.bindContract)(C.getUtxoByScriptRef("Protocol")(h)(o))((function(v){var h=new d.RefInput(s.mkTxUnspentOut(m.fst(v))(m.snd(v)));return u.bind(c.bindContract)(w.mintingPolicy(e))((function(e){return u.bind(c.bindContract)(e instanceof f.PlutusMintingPolicy?a.pure(c.applicativeContract)(new i.PlutusScriptRef(e.value0)):p.liftEffect(c.monadEffectContract)(g.throw("Unexpected Minting Policy script type")))((function(e){return u.bind(c.bindContract)(C.getUtxoByScriptRef("VerTokenPolicy")(e)(o))((function(e){var u=new d.RefInput(s.mkTxUnspentOut(m.fst(e))(m.snd(e))),i={pScriptRef:v,pRefScriptInput:h,verTokenRef:e,verTokenInput:u};return a.pure(c.applicativeContract)({pValidator:n,pValidatorHash:b,pAddress:t,pUtxos:o,pUtxo:l,pDatum:r,pValue:y,references:i})}))}))}))}))}))}))}))}))}))}))}))}}(c),function(e){"use strict";e["Protocol.Redeemer"]=e["Protocol.Redeemer"]||{};var n=e["Protocol.Redeemer"],t=e["Ctl.Internal.ToData"],r=e["Ctl.Internal.TypeLevel.Nat"],o=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],a=e["Data.Generic.Rep"],u=e["Protocol.Models"],i=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l=function(){function e(){}return e.value=new e,e}(),s={to:function(e){if(e instanceof a.Inl)return new i(e.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inl)return new c(e.value0.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inr)return l.value;throw new Error("Failed pattern match at Protocol.Redeemer (line 13, column 1 - line 13, column 44): "+[e.constructor.name])},from:function(e){if(e instanceof i)return new a.Inl(e.value0);if(e instanceof c)return new a.Inr(new a.Inl(e.value0));if(e instanceof l)return new a.Inr(new a.Inr(a.NoArguments.value));throw new Error("Failed pattern match at Protocol.Redeemer (line 13, column 1 - line 13, column 44): "+[e.constructor.name])}},f={toData:t.genericToData(s)(t.toDataWithSchemaSum(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PUpdateProtocolConfig"}})(t.toDataArgsArgument(u.toDataPProtocolConfig)({reflectSymbol:function(){return"PUpdateProtocolConfig"}}))()()(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PUpdateProtocolConfig"}})(r.knownNatZ))(r.knownNatZ))(t.toDataWithSchemaSum(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PStartFundrise"}})(t.toDataArgsArgument(u.toDataPFundriseConfig)({reflectSymbol:function(){return"PStartFundrise"}}))()()(o.getIndexWithLabelConsI(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PStartFundrise"}})(r.knownNatS(r.knownNatZ)))()()({reflectSymbol:function(){return"PStartFundrise"}})(r.knownNatS(r.knownNatZ)))(r.knownNatS(r.knownNatZ)))(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PCloseProtocol"}})(t.toDataArgsNoArguments({reflectSymbol:function(){return"PCloseProtocol"}}))()()(o.getIndexWithLabelConsI(o.getIndexWithLabelConsI(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PCloseProtocol"}})(r.knownNatS(r.knownNatS(r.knownNatZ))))()()({reflectSymbol:function(){return"PCloseProtocol"}})(r.knownNatS(r.knownNatS(r.knownNatZ))))()()({reflectSymbol:function(){return"PCloseProtocol"}})(r.knownNatS(r.knownNatS(r.knownNatZ))))(r.knownNatS(r.knownNatS(r.knownNatZ))))))};n.PStartFundrise=c,n.toDataPProtocolRedeemer=f}(c),function(e){"use strict";e["Shared.Duration"]=e["Shared.Duration"]||{};var n=e["Shared.Duration"],t=e["Data.BigInt"],r=e["Data.Semiring"],o=t.fromInt(60),a=t.fromInt(1440);n.durationToMinutes=function(e){return r.add(t.semiringBigInt)(r.add(t.semiringBigInt)(r.mul(t.semiringBigInt)(t.fromInt(e.days))(a))(r.mul(t.semiringBigInt)(t.fromInt(e.hours))(o)))(t.fromInt(e.minutes))},n.minutesToPosixTime=function(e){return r.mul(t.semiringBigInt)(r.mul(t.semiringBigInt)(e)(t.fromInt(60)))(t.fromInt(1e3))}}(c),function(e){"use strict";e["Shared.Tx"]=e["Shared.Tx"]||{};var n=e["Shared.Tx"],t=e["Contract.Log"],r=e["Contract.ScriptLookups"],o=e["Contract.Transaction"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.BalanceTx.Constraints"],c=e["Ctl.Internal.BalanceTx.Error"],l=e["Ctl.Internal.Contract.AwaitTxConfirmed"],s=e["Ctl.Internal.Contract.Monad"],f=e["Ctl.Internal.FromData"],d=e["Ctl.Internal.IsData"],v=e["Ctl.Internal.Service.Error"],m=e["Ctl.Internal.ToData"],p=e["Ctl.Internal.Types.ScriptLookups"],g=e["Data.Either"],y=e["Data.Show"],w=e["Effect.Class"],h=e["Effect.Exception"];n.completeTx=function(e){return function(n){return function(b){var C=function(e){return function(n){return function(r){return u.discard(u.discardUnit)(s.bindContract)(t["logError'"](s.monadLoggerContract)(y.show(e)(r)))((function(){return w.liftEffect(s.monadEffectContract)(h.throw(n))}))}}};return u.bind(s.bindContract)(u.bind(s.bindContract)(r.mkUnbalancedTx()(d.isData(f.fromDataVoid)(m.toDataVoid))(d.isData(f.fromDataVoid)(m.toDataVoid))(e)(n))(g.either(C(p.showMkUnbalancedTxError)("An error occured while constructing the transaction"))(a.pure(s.applicativeContract))))((function(e){var n=i.mustSendChangeToAddress(b.ownAddressWithNetworkTag);return u.bind(s.bindContract)(u.bind(s.bindContract)(o.balanceTxWithConstraints(e)(n))(g.either(C(c.showBalanceTxError)("An error occured while balancing the transaction"))(a.pure(s.applicativeContract))))((function(e){return u.bind(s.bindContract)(o.signTransaction()(e))((function(e){return u.bind(s.bindContract)(o.submitE(e))(g.either(C(v.showClientError)("An error occured while submitting the transaction"))(l.awaitTxConfirmed))}))}))}))}}}}(c),function(e){"use strict";e["Fundraising.Create"]=e["Fundraising.Create"]||{};var n=e["Fundraising.Create"],t=e["Contract.Address"],r=e["Contract.Log"],o=e["Contract.Monad"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.Contract.Monad"],c=e["Ctl.Internal.Contract.WaitUntilSlot"],l=e["Ctl.Internal.Plutus.Types.Credential"],s=e["Ctl.Internal.Plutus.Types.Value"],f=e["Ctl.Internal.Scripts"],d=e["Ctl.Internal.ToData"],v=e["Ctl.Internal.Types.ByteArray"],m=e["Ctl.Internal.Types.ScriptLookups"],p=e["Ctl.Internal.Types.TxConstraints"],g=e["Data.BigInt"],y=e["Data.Lens.Getter"],w=e["Data.Lens.Internal.Forget"],h=e["Data.Ord"],b=e["Data.Semigroup"],C=e["Data.Semiring"],A=e["Data.Show"],S=e["Data.String.CodePoints"],I=e["Data.Tuple"],T=e["Effect.Class"],D=e["Effect.Exception"],F=e["Ext.Contract.Time"],E=e["Ext.Contract.Value"],x=e["Ext.Seriaization.Key"],M=e["Fundraising.Datum"],R=e["Fundraising.FundraisingScript"],P=e["MintingPolicy.NftMinting"],B=e["MintingPolicy.NftRedeemer"],k=e["MintingPolicy.VerTokenMinting"],N=e["MintingPolicy.VerTokenRedeemers"],L=e["Protocol.Datum"],_=e["Protocol.ProtocolScriptInfo"],U=e["Protocol.Redeemer"],H=e["Protocol.UserData"],q=e["Shared.Duration"],O=e["Shared.MinAda"],W=e["Shared.OwnCredentials"],V=e["Shared.RunContract"],K=e["Shared.Tx"];n.runCreateFundraising=function(e){return function(n){return function(z){return function(J){return function(j){return V.runContractWithResult(e)(n)(J)(function(e){return function(n){return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Running Create Fundraising contract"))((function(){return u.bind(i.bindContract)(H.dataToProtocol(e))((function(e){return u.bind(i.bindContract)(W.getOwnCreds)((function(H){return u.bind(i.bindContract)(_.getProtocolScriptInfo(e))((function(_){return u.bind(i.bindContract)(E.mkCurrencySymbol(P.mintingPolicy(H.nonCollateralORef)))((function(P){return u.bind(i.bindContract)(R.getFundraisingTokenName)((function(W){return u.bind(i.bindContract)(E.mkCurrencySymbol(k.mintingPolicy(e)))((function(V){return u.bind(i.bindContract)(k.verTokenName)((function(k){var z=f.mintingPolicyHash(V.value0),J=C.mul(g.semiringBigInt)(g.fromInt(n.amount))(g.fromInt(1e6)),j=y.view(L._minAmount(w.strongForget))(_.pDatum),Q=y.view(L._maxAmount(w.strongForget))(_.pDatum);return u.discard(u.discardUnit)(i.bindContract)(a.when(i.applicativeContract)(h.lessThan(g.ordBigInt)(J)(j))(T.liftEffect(i.monadEffectContract)(D.throw("Fundraising amount too small. It must be greater than "+g.toString(j)+"."))))((function(){return u.discard(u.discardUnit)(i.bindContract)(a.when(i.applicativeContract)(h.greaterThan(g.ordBigInt)(J)(Q))(T.liftEffect(i.monadEffectContract)(D.throw("Fundraising amount too big. It must be less than "+g.toString(Q)+"."))))((function(){var f=y.view(L._minDuration(w.strongForget))(_.pDatum),j=y.view(L._maxDuration(w.strongForget))(_.pDatum),Q=q.durationToMinutes(n.duration);return u.discard(u.discardUnit)(i.bindContract)(a.when(i.applicativeContract)(h.lessThan(g.ordBigInt)(Q)(f))(T.liftEffect(i.monadEffectContract)(D.throw("Fundraising duration too short. It must be greater than "+g.toString(f)+"."))))((function(){return u.discard(u.discardUnit)(i.bindContract)(a.when(i.applicativeContract)(h.greaterThan(g.ordBigInt)(Q)(j))(T.liftEffect(i.monadEffectContract)(D.throw("Fundraising duration too long. It must be less than "+g.toString(j)+"."))))((function(){return u.bind(i.bindContract)(c.currentTime)((function(c){var f=F.addTimes(c)(q.minutesToPosixTime(Q));return u.bind(i.bindContract)(o.liftContractM("Impossible to serialize a title")(v.byteArrayFromAscii(S.take(M.titleLength)(n.title))))((function(v){var h={creatorPkh:H.ownPkh,tokenOrigin:H.nonCollateralORef,frTitle:v,frAmount:J,frDeadline:f,frFee:y.view(L._protocolFee(w.strongForget))(_.pDatum),managerAddress:y.view(L._managerAddress(w.strongForget))(_.pDatum)},S={protocol:e,verTokenCurrency:V.value1,verTokenName:k};return u.bind(i.bindContract)(t.getNetworkId)((function(e){return u.bind(i.bindContract)(R.getFundraisingValidatorHash(S))((function(v){return u.bind(i.bindContract)(o.liftContractM("Impossible to get Fundraising script address")(t.validatorHashBaseAddress(e)(v)))((function(e){var o={scriptAddress:e,verCurrencySymbol:V.value1,verTokenName:k,threadCurrencySymbol:P.value1,threadTokenName:W,startedAt:c},y=d.toData(U.toDataPProtocolRedeemer)(new U.PStartFundrise(o)),w=s.singleton(V.value1)(k)(C.one(g.semiringBigInt)),S=s.singleton(P.value1)(W)(C.one(g.semiringBigInt)),T=b.append(s.semigroupValue)(O.minAdaValue)(b.append(s.semigroupValue)(O.minAdaValue)(b.append(s.semigroupValue)(S)(w))),D=b.append(m.semigroupScriptLookups)(m.mintingPolicy(P.value0))(b.append(m.semigroupScriptLookups)(m.unspentOutputs(H.ownUtxos))(m.unspentOutputs(_.pUtxos))),F=b.append(p.semigroupTxConstraints)(p.mustSpendPubKeyOutput(H.nonCollateralORef))(b.append(p.semigroupTxConstraints)(p.mustMintValueWithRedeemer(d.toData(B.toDataPNftRedeemer)(new B.PMintNft(W)))(S))(b.append(p.semigroupTxConstraints)(p.mustMintCurrencyWithRedeemerUsingScriptRef(z)(d.toData(N.toDataPVerTokenRedeemer)(new N.PMintVerToken(k)))(k)(C.one(g.semiringBigInt))(_.references.verTokenInput))(b.append(p.semigroupTxConstraints)(p.mustSpendScriptOutputUsingScriptRef(I.fst(_.pUtxo))(y)(_.references.pRefScriptInput))(b.append(p.semigroupTxConstraints)(p.mustPayToScriptAddress(_.pValidatorHash)(new l.ScriptCredential(_.pValidatorHash))(d.toData(L.toDataPProtocolDatum)(_.pDatum))(p.DatumInline.value)(_.pValue))(b.append(p.semigroupTxConstraints)(p.mustPayToScriptAddress(v)(new l.ScriptCredential(v))(d.toData(M.toDataPFundraisingDatum)(h))(p.DatumInline.value)(T))(b.append(p.semigroupTxConstraints)(p.mustBeSignedBy(H.ownPkh))(b.append(p.semigroupTxConstraints)(p.mustReferenceOutput(I.fst(_.references.pScriptRef)))(p.mustReferenceOutput(I.fst(_.references.verTokenRef))))))))));return u.discard(u.discardUnit)(i.bindContract)(K.completeTx(D)(F)(H))((function(){return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Fundraising created successfully"))((function(){return u.bind(i.bindContract)(t.addressToBech32(e))((function(e){return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Current fundraising address: "+A.show(A.showString)(e)))((function(){return u.bind(i.bindContract)(x.pkhToBech32M(H.ownPkh))((function(e){return a.pure(i.applicativeContract)({creator:e,title:n.title,goal:J,raisedAmt:g.fromInt(0),deadline:f,threadTokenCurrency:E.currencySymbolToString(P.value1),threadTokenName:R.fundraisingTokenNameString,isCompleted:!1})}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}}(z)(j))}}}}}}(c),function(e){"use strict";e["Fundraising.FundraisingScriptInfo"]=e["Fundraising.FundraisingScriptInfo"]||{};var n=e["Fundraising.FundraisingScriptInfo"],t=e["Contract.Address"],r=e["Contract.Monad"],o=e["Contract.Utxos"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.Cardano.Types.ScriptRef"],c=e["Ctl.Internal.Contract.Monad"],l=e["Ctl.Internal.Plutus.Types.Address"],s=e["Ctl.Internal.Plutus.Types.TransactionUnspentOutput"],f=e["Ctl.Internal.Serialization.Address"],d=e["Ctl.Internal.Types.TxConstraints"],v=e["Data.Newtype"],m=e["Data.Tuple"],p=e["Ext.Contract.Value"],g=e["Fundraising.Datum"],y=e["Fundraising.FundraisingScript"],w=e["MintingPolicy.VerTokenMinting"],h=e["Protocol.UserData"],b=e["Shared.Utxo"];n.makeFundraising=function(e){return u.bind(c.bindContract)(h.dataToProtocol(e))((function(e){return u.bind(c.bindContract)(p.mkCurrencySymbol(w.mintingPolicy(e)))((function(n){return u.bind(c.bindContract)(w.verTokenName)((function(t){return a.pure(c.applicativeContract)({protocol:e,verTokenCurrency:n.value1,verTokenName:t})}))}))}))},n.getFundraisingScriptInfo=function(e){return function(n){return function(p){return u.bind(c.bindContract)(y.fundraisingValidatorScript(e))((function(w){return u.bind(c.bindContract)(y.getFundraisingValidatorHash(e))((function(e){return u.bind(c.bindContract)(r.liftContractM("Impossible to get Fundraising script address")(t.validatorHashBaseAddress(f.TestnetId.value)(e)))((function(t){return u.bind(c.bindContract)(o.utxosAt(l.plutusAddressAddress)(t))((function(o){return u.bind(c.bindContract)(b.getUtxoByNFT("Fundraising")(new m.Tuple(n,p))(o))((function(n){return u.bind(c.bindContract)(r.liftContractM("Impossible to get Fundraising Datum")(b.extractDatumFromUTxO(g.fromDataPFundraisingDatum)(n)))((function(r){var l=b.extractValueFromUTxO(n),f=new i.PlutusScriptRef(v.unwrap()(w));return u.bind(c.bindContract)(b.getUtxoByScriptRef("Fundraising")(f)(o))((function(u){var i=new d.RefInput(s.mkTxUnspentOut(m.fst(u))(m.snd(u)));return a.pure(c.applicativeContract)({frValidator:w,frValidatorHash:e,frAddress:t,frUtxos:o,frUtxo:n,frDatum:r,frValue:l,frScriptRef:u,frRefScriptInput:i})}))}))}))}))}))}))}))}}}}(c),function(e){"use strict";e["Fundraising.Redeemer"]=e["Fundraising.Redeemer"]||{};var n=e["Fundraising.Redeemer"],t=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],r=e["Ctl.Internal.ToData"],o=e["Ctl.Internal.TypeLevel.Nat"],a=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],u=e["Ctl.Internal.Types.TokenName"],i=e["Data.Generic.Rep"],c=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),l=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),s={to:function(e){if(e instanceof i.Inl)return new c(e.value0.value0,e.value0.value1.value0,e.value0.value1.value1);if(e instanceof i.Inr)return new l(e.value0.value0,e.value0.value1);throw new Error("Failed pattern match at Fundraising.Redeemer (line 13, column 1 - line 13, column 47): "+[e.constructor.name])},from:function(e){if(e instanceof c)return new i.Inl(new i.Product(e.value0,new i.Product(e.value1,e.value2)));if(e instanceof l)return new i.Inr(new i.Product(e.value0,e.value1));throw new Error("Failed pattern match at Fundraising.Redeemer (line 13, column 1 - line 13, column 47): "+[e.constructor.name])}},f={toData:r.genericToData(s)(r.toDataWithSchemaSum(r.toDataWithSchemaConstruct({reflectSymbol:function(){return"PDonate"}})(r.toDataArgsProduct(r.toDataArgsArgument(t.toDataCurrencySymbol)({reflectSymbol:function(){return"PDonate"}}))(r.toDataArgsProduct(r.toDataArgsArgument(u.toDataTokenName)({reflectSymbol:function(){return"PDonate"}}))(r.toDataArgsArgument(r.toDataBigInt)({reflectSymbol:function(){return"PDonate"}}))))()()(a.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PDonate"}})(o.knownNatZ))(o.knownNatZ))(r.toDataWithSchemaConstruct({reflectSymbol:function(){return"PReceiveFunds"}})(r.toDataArgsProduct(r.toDataArgsArgument(t.toDataCurrencySymbol)({reflectSymbol:function(){return"PReceiveFunds"}}))(r.toDataArgsArgument(u.toDataTokenName)({reflectSymbol:function(){return"PReceiveFunds"}})))()()(a.getIndexWithLabelConsI(a.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PReceiveFunds"}})(o.knownNatS(o.knownNatZ)))()()({reflectSymbol:function(){return"PReceiveFunds"}})(o.knownNatS(o.knownNatZ)))(o.knownNatS(o.knownNatZ))))};n.PDonate=c,n.PReceiveFunds=l,n.toDataPFundraisingRedeeme=f}(c),function(e){"use strict";e["Fundraising.Donate"]=e["Fundraising.Donate"]||{};var n=e["Fundraising.Donate"],t=e["Contract.Log"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Contract.WaitUntilSlot"],i=e["Ctl.Internal.Plutus.Types.Credential"],c=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],l=e["Ctl.Internal.Plutus.Types.Value"],s=e["Ctl.Internal.ToData"],f=e["Ctl.Internal.Types.Interval"],d=e["Ctl.Internal.Types.ScriptLookups"],v=e["Ctl.Internal.Types.TokenName"],m=e["Ctl.Internal.Types.TxConstraints"],p=e["Data.BigInt"],g=e["Data.Ord"],y=e["Data.Ring"],w=e["Data.Semigroup"],h=e["Data.Semiring"],b=e["Data.Tuple"],C=e["Effect.Class"],A=e["Effect.Exception"],S=e["Ext.Contract.Value"],I=e["Fundraising.Datum"],T=e["Fundraising.FundraisingScriptInfo"],D=e["Fundraising.Redeemer"],F=e["Shared.MinAda"],E=e["Shared.OwnCredentials"],x=e["Shared.RunContract"],M=e["Shared.Tx"],R=e["Shared.Utxo"];n.runDonate=function(e){return function(n){return function(P){return function(B){return function(k){return function(N){return x.runContractWithResult(e)(n)(B)(function(e){return function(n){return function(x){return o.discard(o.discardUnit)(a.bindContract)(t["logInfo'"](a.monadLoggerContract)("Running donate"))((function(){return o.bind(a.bindContract)(S.mkCurrencySymbolFromString(n.frThreadTokenCurrency))((function(P){return o.bind(a.bindContract)(S.runMkTokenName(n.frThreadTokenName))((function(n){return o.bind(a.bindContract)(T.makeFundraising(e))((function(e){return o.bind(a.bindContract)(T.getFundraisingScriptInfo(e)(P)(n))((function(S){var T=R.checkTokenInUTxO(new b.Tuple(e.verTokenCurrency,e.verTokenName))(S.frUtxo);return o.discard(o.discardUnit)(a.bindContract)(r.unless(a.applicativeContract)(T)(C.liftEffect(a.monadEffectContract)(A.throw("verToken is not in fundraising utxo"))))((function(){return o.bind(a.bindContract)(u.currentTime)((function(e){var u=h.mul(p.semiringBigInt)(p.fromInt(x))(p.fromInt(1e6)),T=y.sub(p.ringBigInt)(y.sub(p.ringBigInt)(l["valueToCoin'"](S.frValue))(l["valueToCoin'"](F.minAdaValue)))(l["valueToCoin'"](F.minAdaValue));return o.discard(o.discardUnit)(a.bindContract)(r.when(a.applicativeContract)(g.greaterThan(f.ordPOSIXTime)(e)(S.frDatum.frDeadline))(C.liftEffect(a.monadEffectContract)(A.throw("fundraising time is over"))))((function(){return o.discard(o.discardUnit)(a.bindContract)(r.when(a.applicativeContract)(g.greaterThanOrEq(p.ordBigInt)(T)(S.frDatum.frAmount))(C.liftEffect(a.monadEffectContract)(A.throw("fundraising goal is already completed"))))((function(){return o.bind(a.bindContract)(E.getOwnCreds)((function(r){var p=s.toData(I.toDataPFundraisingDatum)(S.frDatum),g=l.singleton(c.adaSymbol)(v.adaToken)(u),y=w.append(l.semigroupValue)(S.frValue)(g),h=s.toData(D.toDataPFundraisingRedeeme)(new D.PDonate(P,n,u)),C=f.from(f.ordPOSIXTime)(e),A=w.append(m.semigroupTxConstraints)(m.mustSpendScriptOutputUsingScriptRef(b.fst(S.frUtxo))(h)(S.frRefScriptInput))(w.append(m.semigroupTxConstraints)(m.mustPayToScriptAddress(S.frValidatorHash)(new i.ScriptCredential(S.frValidatorHash))(p)(m.DatumInline.value)(y))(w.append(m.semigroupTxConstraints)(m.mustBeSignedBy(r.ownPkh))(w.append(m.semigroupTxConstraints)(m.mustValidateIn(C))(m.mustReferenceOutput(b.fst(S.frScriptRef)))))),T=d.unspentOutputs(S.frUtxos);return o.discard(o.discardUnit)(a.bindContract)(M.completeTx(T)(A)(r))((function(){return t["logInfo'"](a.monadLoggerContract)("Donate finished successfully")}))}))}))}))}))}))}))}))}))}))}))}}}(P)(k)(N))}}}}}}}(c),function(e){"use strict";e["Fundraising.ReceiveFunds"]=e["Fundraising.ReceiveFunds"]||{};var n=e["Fundraising.ReceiveFunds"],t=e["Contract.Log"],r=e["Contract.Monad"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Ctl.Internal.Contract.Monad"],i=e["Ctl.Internal.Contract.WaitUntilSlot"],c=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],l=e["Ctl.Internal.Plutus.Types.Value"],s=e["Ctl.Internal.Scripts"],f=e["Ctl.Internal.ToData"],d=e["Ctl.Internal.Types.Interval"],v=e["Ctl.Internal.Types.PubKeyHash"],m=e["Ctl.Internal.Types.Redeemer"],p=e["Ctl.Internal.Types.ScriptLookups"],g=e["Ctl.Internal.Types.TokenName"],y=e["Ctl.Internal.Types.TxConstraints"],w=e["Data.BigInt"],h=e["Data.Eq"],b=e["Data.Ord"],C=e["Data.Ring"],A=e["Data.Semigroup"],S=e["Data.Tuple"],I=e["Effect.Class"],T=e["Effect.Exception"],D=e["Ext.Contract.Value"],F=e["Fundraising.Calculations"],E=e["Fundraising.FundraisingScriptInfo"],x=e["Fundraising.Redeemer"],M=e["MintingPolicy.NftMinting"],R=e["MintingPolicy.NftRedeemer"],P=e["MintingPolicy.VerTokenMinting"],B=e["MintingPolicy.VerTokenRedeemers"],k=e["Protocol.ProtocolScriptInfo"],N=e["Protocol.UserData"],L=e["Shared.MinAda"],_=e["Shared.OwnCredentials"],U=e["Shared.RunContract"],H=e["Shared.Tx"],q=e["Shared.Utxo"];n.runReceiveFunds=function(e){return function(n){return function(O){return function(W){return function(V){return U.runContractWithResult(e)(n)(W)(function(e){return function(n){return a.discard(a.discardUnit)(u.bindContract)(t["logInfo'"](u.monadLoggerContract)("Running receive funds"))((function(){return a.bind(u.bindContract)(N.dataToProtocol(e))((function(N){return a.bind(u.bindContract)(D.mkCurrencySymbolFromString(n.frThreadTokenCurrency))((function(U){return a.bind(u.bindContract)(D.runMkTokenName(n.frThreadTokenName))((function(n){return a.bind(u.bindContract)(E.makeFundraising(e))((function(e){return a.bind(u.bindContract)(E.getFundraisingScriptInfo(e)(U)(n))((function(D){var E=q.checkTokenInUTxO(new S.Tuple(e.verTokenCurrency,e.verTokenName))(D.frUtxo);return a.discard(a.discardUnit)(u.bindContract)(o.unless(u.applicativeContract)(E)(I.liftEffect(u.monadEffectContract)(T.throw("verToken is not in fundraising utxo"))))((function(){return a.bind(u.bindContract)(_.getPkhSkhFromAddress(D.frDatum.managerAddress))((function(E){return a.bind(u.bindContract)(i.currentTime)((function(i){var q=C.sub(w.ringBigInt)(C.sub(w.ringBigInt)(l.valueOf(D.frValue)(c.adaSymbol)(g.adaToken))(L.minAda))(L.minAda);return a.discard(a.discardUnit)(u.bindContract)(o.when(u.applicativeContract)(b.lessThanOrEq(d.ordPOSIXTime)(i)(D.frDatum.frDeadline)&&b.lessThan(w.ordBigInt)(q)(D.frDatum.frAmount))(I.liftEffect(u.monadEffectContract)(T.throw("Can't receive funds while fundraising is in progress"))))((function(){return a.bind(u.bindContract)(_.getOwnCreds)((function(b){return a.discard(a.discardUnit)(u.bindContract)(o.when(u.applicativeContract)(h.notEq(v.eqPaymentPubKeyHash)(b.ownPkh)(D.frDatum.creatorPkh))(I.liftEffect(u.monadEffectContract)(T.throw("Only fundraising creator can receive funds"))))((function(){var o=m.Redeemer(f.toData(x.toDataPFundraisingRedeeme)(new x.PReceiveFunds(U,n))),v=l.singleton(U)(n)(w.fromInt(-1));return a.bind(u.bindContract)(M.mintingPolicy(D.frDatum.tokenOrigin))((function(m){return a.bind(u.bindContract)(P.mintingPolicy(N))((function(h){return a.bind(u.bindContract)(r.liftContractM("Can't create BigInt after round")(F.calcFee(D.frDatum.frFee)(q)))((function(r){var I=s.mintingPolicyHash(h),T=l.lovelaceValueOf(C.sub(w.ringBigInt)(l.valueOf(D.frValue)(c.adaSymbol)(g.adaToken))(r));return a.bind(u.bindContract)(k.getProtocolScriptInfo(N))((function(c){var s=A.append(y.semigroupTxConstraints)(y.mustSpendScriptOutputUsingScriptRef(S.fst(D.frUtxo))(o)(D.frRefScriptInput))(A.append(y.semigroupTxConstraints)(y.mustBeSignedBy(D.frDatum.creatorPkh))(A.append(y.semigroupTxConstraints)(y.mustMintValueWithRedeemer(f.toData(R.toDataPNftRedeemer)(new R.PBurnNft(n)))(v))(A.append(y.semigroupTxConstraints)(y.mustMintCurrencyWithRedeemerUsingScriptRef(I)(f.toData(B.toDataPVerTokenRedeemer)(new B.PBurnVerToken(e.verTokenName)))(e.verTokenName)(w.fromInt(-1))(c.references.verTokenInput))(A.append(y.semigroupTxConstraints)(y.mustPayToPubKeyAddress(b.ownPkh)(b.ownSkh)(T))(A.append(y.semigroupTxConstraints)(y.mustPayToPubKeyAddress(E.value0)(E.value1)(l.lovelaceValueOf(r)))(A.append(y.semigroupTxConstraints)(y.mustValidateIn(d.from(d.ordPOSIXTime)(i)))(A.append(y.semigroupTxConstraints)(y.mustReferenceOutput(S.fst(D.frScriptRef)))(y.mustReferenceOutput(S.fst(c.references.verTokenRef)))))))))),g=A.append(p.semigroupScriptLookups)(p.mintingPolicy(m))(p.unspentOutputs(D.frUtxos));return a.discard(a.discardUnit)(u.bindContract)(H.completeTx(g)(s)(b))((function(){return t["logInfo'"](u.monadLoggerContract)("Receive funds finished successfully")}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}}(O)(V))}}}}}}(c),function(e){"use strict";e["Info.UserData"]=e["Info.UserData"]||{};var n=e["Info.UserData"],t=e["Contract.Monad"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Contract.WaitUntilSlot"],i=e["Ctl.Internal.Plutus.Types.Value"],c=e["Ctl.Internal.Types.Interval"],l=e["Data.Array"],s=e["Data.BigInt"],f=e["Data.Ord"],d=e["Data.Ring"],v=e["Data.Show"],m=e["Data.TextDecoder"],p=e["Effect.Exception"],g=e["Ext.Contract.Value"],y=e["Ext.Data.Either"],w=e["Ext.Seriaization.Key"],h=e["Fundraising.Datum"],b=e["Fundraising.FundraisingScript"],C=e["Shared.MinAda"],A=e["Shared.Utxo"],S=v.showRecord()(v.showRecordFieldsCons({reflectSymbol:function(){return"creator"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"deadline"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"goal"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"isCompleted"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"raisedAmt"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"threadTokenCurrency"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"threadTokenName"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"title"}})(v.showRecordFieldsNil)(v.showString))(v.showString))(v.showString))(s.showBigInt))(v.showBoolean))(s.showBigInt))(c.showPOSIXTime))(v.showString));n.mapToFundraisingInfo=function(e){return o.bind(a.bindContract)(t.liftContractM("Impossible to extract datum from UTxO")(A.extractDatumFromUTxO(h.fromDataPFundraisingDatum)(e)))((function(n){var l=A.extractValueFromUTxO(e),v=d.sub(s.ringBigInt)(d.sub(s.ringBigInt)(i["valueToCoin'"](l))(i["valueToCoin'"](C.minAdaValue)))(i["valueToCoin'"](C.minAdaValue));return o.bind(a.bindContract)(y.eitherContract(p.showError)("Title decoding failed: ")(m.decodeUtf8(n.frTitle)))((function(e){return o.bind(a.bindContract)(b.getFundraisingTokenName)((function(i){return o.bind(a.bindContract)(t.liftContractM("Impossible to get currency by token name")(g.getCurrencyByTokenName(l)(i)))((function(t){return o.bind(a.bindContract)(u.currentTime)((function(u){return o.bind(a.bindContract)(w.pkhToBech32M(n.creatorPkh))((function(o){return r.pure(a.applicativeContract)({creator:o,title:e,goal:n.frAmount,raisedAmt:v,deadline:n.frDeadline,threadTokenCurrency:g.currencySymbolToString(t),threadTokenName:b.fundraisingTokenNameString,isCompleted:f.greaterThan(c.ordPOSIXTime)(u)(n.frDeadline)||f.greaterThanOrEq(s.ordBigInt)(v)(n.frAmount)})}))}))}))}))}))}))},n.filterByPkh=function(e){return l.filter((function(n){return n.creator===e}))},n.showFundraisingInfo=S}(c),function(e){"use strict";e["Info.AllFundraisings"]=e["Info.AllFundraisings"]||{};var n=e["Info.AllFundraisings"],t=e["Contract.Address"],r=e["Contract.Log"],o=e["Contract.Monad"],a=e["Contract.Utxos"],u=e["Control.Applicative"],i=e["Control.Bind"],c=e["Ctl.Internal.Contract.Monad"],l=e["Ctl.Internal.Plutus.Types.Address"],s=e["Ctl.Internal.Serialization.Address"],f=e["Data.Map.Internal"],d=e["Data.Show"],v=e["Data.Traversable"],m=e["Data.Tuple"],p=e["Data.Unfoldable"],g=e["Ext.Contract.Value"],y=e["Fundraising.FundraisingScript"],w=e["Info.UserData"],h=e["MintingPolicy.VerTokenMinting"],b=e["Protocol.UserData"],C=e["Shared.RunContract"],A=e["Shared.Utxo"],S=function(e){return i.bind(c.bindContract)(b.dataToProtocol(e))((function(e){return i.bind(c.bindContract)(g.mkCurrencySymbol(h.mintingPolicy(e)))((function(n){return i.bind(c.bindContract)(h.verTokenName)((function(g){var h={protocol:e,verTokenCurrency:n.value1,verTokenName:g};return i.bind(c.bindContract)(y.getFundraisingValidatorHash(h))((function(e){return i.bind(c.bindContract)(o.liftContractM("Impossible to get Fundraising script address")(t.validatorHashBaseAddress(s.TestnetId.value)(e)))((function(e){return i.bind(c.bindContract)(a.utxosAt(l.plutusAddressAddress)(e))((function(e){return i.bind(c.bindContract)(v.traverse(v.traversableArray)(c.applicativeContract)(w.mapToFundraisingInfo)(A.filterByToken(new m.Tuple(n.value1,g))(f.toUnfoldable(p.unfoldableArray)(e))))((function(e){return i.discard(i.discardUnit)(c.bindContract)(r["logInfo'"](c.monadLoggerContract)("Found UTxOs"+d.show(d.showArray(w.showFundraisingInfo))(e)))((function(){return u.pure(c.applicativeContract)(e)}))}))}))}))}))}))}))}))};n.runGetAllFundraisings=function(e){return function(n){return function(t){return function(r){return C.runContractWithResult(e)(n)(r)(S(t))}}}},n.getAllFundraisings=S}(c),function(e){"use strict";e["Info.UserRelatedFundraisings"]=e["Info.UserRelatedFundraisings"]||{};var n=e["Info.UserRelatedFundraisings"],t=e["Contract.Address"],r=e["Contract.Log"],o=e["Contract.Monad"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.Contract.Monad"],c=e["Ctl.Internal.Types.PubKeyHash"],l=e["Data.Array"],s=e["Data.Show"],f=e["Ext.Seriaization.Key"],d=e["Info.AllFundraisings"],v=e["Info.UserData"],m=e["Shared.RunContract"];n.runGetUserRelatedFundraisings=function(e){return function(n){return function(p){return function(g){return m.runContractWithResult(e)(n)(g)(function(e){return u.bind(i.bindContract)(d.getAllFundraisings(e))((function(e){return u.bind(i.bindContract)(t.ownPaymentPubKeysHashes)((function(n){return u.bind(i.bindContract)(o.liftContractM("Impossible to get own PaymentPubkeyHash")(l.head(n)))((function(n){return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Own Payment pkh is: "+s.show(c.showPaymentPubKeyHash)(n)))((function(){return u.bind(i.bindContract)(f.pkhToBech32M(n))((function(n){var t=v.filterByPkh(n)(e);return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Discovered items: "+s.show(s.showArray(v.showFundraisingInfo))(t)))((function(){return a.pure(i.applicativeContract)(t)}))}))}))}))}))}))}(p))}}}}}(c),function(e){"use strict";e["Scaffold.Main"]=e["Scaffold.Main"]||{};var n=e["Scaffold.Main"],t=e["Fundraising.Create"],r=e["Fundraising.Donate"],o=e["Fundraising.ReceiveFunds"],a=e["Info.AllFundraisings"],u=e["Info.AppInfo"],i=e["Info.UserRelatedFundraisings"],c=new(function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}())({getAppInfo:u.runGetAppInfo,createFundraising:t.runCreateFundraising,donate:r.runDonate,receiveFunds:o.runReceiveFunds,getAllFundraisings:a.runGetAllFundraisings,getUserRelatedFundraisings:i.runGetUserRelatedFundraisings});n.main=c}(c),e.exports=c["Scaffold.Main"]},2244:e=>{function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=()=>[],n.resolve=n,n.id=2244,e.exports=n},1761:e=>{"use strict";e.exports='{\n "cborHex": "59145b591458010000323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232322222323232323232323232323232323232323232323232533305f3370e90010010991919299983119b8733303600e375c60d401e6eb8c1a8c1a003d2002153330623370e66606c01c6eb8c1a8010dd71835183400224004264a6660c80022a6660c666e1cccc0dcdd598359823982d8069bae306b010375c60d660d2020606890010a99983199b87333037375660d6608e60b601a6eb8c1ac014dd718359834802981a240042a6660c66603c6ea4dd718358061bac306b301f305b00d1323253330653370e00200a2a6660ca66e24dd698368068030a4c2646464a6660d06607e0040022930a998388128b182118378071bad3045001306d3046305d00f153306e023163053375660d860d460b80026604403460d660d20122a660d80482c2a660d804a2c2a660d804c2c2a6660c666e1cccc0dcdd598359823982d8069bae306b010375c60d660d2020606890010a99983199b87333037375660d6608e60b601a6eb8c1ac014dd718359834802981a240042a6660c66603c6ea4dd718358061bac306b301f305b00d1323253330653370e00200a2a6660ca66e24dd698368068030a4c2646464a6660d06607e0040022930a998388128b182118378071bad3045001306d3046305d00f153306e023163053375660d860d460b80026604403460d660d20122a660d80482c2a660d804a2c2a660d804c2c60960322a660d69201033431300016153306b491033430390016323303e3374a90011982700083099ba548010184c1a4020cc88cc098c8c00488c8c8cdc0001299983399b873370c0069002240042a6660ce66e20cdc1801a4008002290010a40002a6660ce66e1ccdc1801a4008002266e180092004153330673371000266e0c00d2004148000520023370c00600466e0c008004cc88c00888c00c88c8c8c00488c8c8c8c88cc00400c008cdc100119b830040033370400266e0c0100094ccc1b4cdc380124000290000a99983699b890024800052001148008c8c8ccc1848894ccc1c4cdc3800a4000200426600600266e18008004cc0c80080054ccc1b8cdc480100088010800981e801181e0011911980080100199b820050023253330693371200290000a9983919b9649012a70747279506f7369746976653a206275696c64696e672077697468206e6f6e20706f7369746976653a20003305c223372ca6660d666e20005200014901012d001491003232533306d3370e00490000981900089919b96001303300230040023370a6078004900a19b84303b00148050004584004cdc1001801181a19b82002001303448320040d4dd6983400300099b813370201406406426464646464646464a6660ce660b804000a264a6660d066e1c004cdc00099bad3070306e00715333068337120766eb4c1c0c1b801c54ccc1a0cdc40099bad3070010153330683370e6660780286eb8c1c0054dd71838183700aa40042a6660d066e1cccc0f0020dd7183800a9bae3070306e0154800854ccc1a0cdc399981e00a1bae307000a375c60e000e90010a99983419b8733303c008375c60e00146eb8c1c001d2002132323232533306c33306c0014a094452615330754910334313500163304200200130453072011375a609000260e0609260c00242a660e292103343038001615330714910334303700161533071491033430360016153307149103343035001615330714910334303400161533071491033430330016153307149103343032001630560071533070490103343031001653330663370e900000109919299983419b87371a002901c0991919191919191919191919191919299983b99b89480000044c8c8c8c8c8c8c8c8c8c8c926533308201001149854cc2280420c0458c218040194ccc1fccdc3a4000004264646464646464646464646464932999846008008a4c2a661280211a022c61200200ca6661120266e1d20000021323232323232324994ccc240040045261533098010910116309401006533308d013370e900000109919191919191924ca666128020022930a9984e0084a808b184c0080329998488099b87480000084c8c94ccc24c04cdc39b8d001480e04c8c926533309501001149854cc274042580458c2640400c54cc270042680458dd7000984c808008a9998488099b87480080084c8c94ccc24c04cdc39b8d001480e04c8c926533309501001149854cc274042580458c2640400c54cc270042400458dd7000984c808008a9984d0084d808b184d80801184d808009baa0013095010011533308d013370e900100109919191919191919191924ca66612e020022930a9984f8084c008b184d808019bad001309b01001309801003375a002613002002612a020066eb4004c2540400454cc2580425c0458c25c04008c25c04004dd50009848808008a9998448099b87480080084c926533308a01001149854cc2480422c045854cc2480424c0458c24c04008c24c04004dd500098468080098450080329998418099b87480000084c8c94ccc21404cdc39b8d001480e04c8c926533308701001149854cc23c042200458c22c0400c54cc238042300458dd70009845808008a9998418099b87480080084c8c94ccc21404cdc39b8d001480e04c8c926533308701001149854cc23c042200458c22c0400c54cc238042080458dd70009845808008a9984600846808b1846808011846808009baa001308701001153308801089011630890100230890100137540026106020026100020066eb4004c20004004c1f400c54cc200041d458dd6800983e800983d0019bad001307a0013077003375c00260ee00260e800ca6660da66e1d200000213232533306f3370e60f60029000099299983819baf374e0de6e9cc1d80044c94ccc1c4cdc39b8d001481004c8c8c8c8c9265333076001149854cc1f81dc58c1e800cdd6800983d000983b8028a9983d03a0b1bae3078001153307907416307a001153307807416375400260ea0022a660ec0ee2c60ee00460ee0026ea8004c1c4004c1b800c54cc1c41bc58dd700098370008a998378380b183800118380009baa00132323253330653370e90010010a99837249033330320016153330653370e9002001098368008a99837249033330310016306f002306f001375460d460a060b400660ce0066eacc1a0c198c160004c114c120058c1a4008c1a4004dd500a182998318049830000982f8009823182f0009827808191919299982c99b87480080084c184c14404054cc189240103333033001630630023063001375460bc60b8609c01a6088002646eacc174c16cc134004c8c174c16cc134004cccc114c8dd6182e9826800982e1826005982500590008a9982ea4810333303500163059001304a00c53330513370e90000010991919299982a29982699b87001480004cdc3800a40702646464a6660ae66e24dc6800a40802646464646493299982e0008a4c2a660c80ba2c60c00066eb4004c180004c17400c54cc18014858dd7000982e800982d0020a9982e8280b1b8d001375c00260b20022a6660a266e1d20020021323232533305453304d3370e0029000099b87001480e04c8c8c94ccc15ccdc49b8d001481004c8c9265333059001149854cc18416858c17400c54cc18014858dd7000982e800982d0020a9982e8280b1b8d001375c00260b20022a660b40b62c60b600460b60026ea80194ccc134cdc3a400000426464a66609e66e1cdc6800a40702646464646464646464646464646464a6660bc66e252000001132323232323232323232324994ccc1a4004526153307106a16306d00653330663370e900000109919191919191919191919191924ca6660e60022930a9983d83a0b183b803299983819b87480000084c8c8c8c8c8c8c9265333077001149854cc1fc1e058c1ec0194ccc1d0cdc3a400000426464646464646493299983d8008a4c2a66106020f82c60fe00ca6660f066e1d200000213232533307a3370e6e340052038132324994ccc1f000452615330840107d163080010031533083010810116375c0026100020022a6660f066e1d200200213232533307a3370e6e340052038132324994ccc1f000452615330840107d1630800100315330830107716375c0026100020022a6610202104022c6104020046104020026ea8004c1f000454ccc1d0cdc3a400400426464646464646464646493299983f0008a4c2a6610c020fe2c6104020066eb4004c20804004c1fc00cdd6800983f800983e0019bad001307c001153307d07e16307e002307e001375400260f00022a6660e066e1d20020021324994ccc1c4004526153307907216153307907a16307a002307a001375400260e800260e200ca6660d466e1d200000213232533306c3370e6e340052038132324994ccc1b8004526153307606f163072003153307507316375c00260e40022a6660d466e1d200200213232533306c3370e6e340052038132324994ccc1b8004526153307606f163072003153307506916375c00260e40022a660e60e82c60e800460e80026ea8004c1b800454cc1bc1c058c1c0008c1c0004dd5000983500098338019bad00130670013064003153306705c16375a00260c800260c20066eb4004c184004c17800cdd7000982f000982d803299982a19b87480000084c8c94ccc158cdc39831000a4000264a6660ae66ebcdd382b1ba7305d00113253330583370e6e340052040132323232324994ccc174004526153306505e163061003375a00260c200260bc00a2a660c20b62c6eb8c17c00454cc18016c58c18400454cc17c16c58dd5000982e0008a9982e82f0b182f001182f0009baa00130580013055003153305805616375c00260aa0022a660ac0ae2c60ae00460ae0026ea800c8c0e4894ccc1240045280a99982419baf305000100314a226004609c00246096604c0029210334313200490103323033002230293302e3037001300300223237586094606060740026092607200292010334313100490103343134004901033431330022533303e33712004002200220044a66607866e1c005200010021533303c3370e002900108018a99981e19b8700148010401054ccc0f0cdc3800a400c200a2a66607866e1c005200810061533303c3370e002900508038a99981e19b8700148030402054ccc0f0cdc3800a401c20122a66607866e1c0052010100a1533303c3370e002900908058b248101300049010131004901013200490101330049010134004901013500490101360049010137004901013800490101390025333031337120029000898010008800919b81480000048c88cc00400c0092002482024bd004888cccc01000920002333300500248001d69bab00100323002375200244446604244a666062002200a2a66606066ebcc0f0c0e00040184c010c0ecc0e00044c008c0d800400488cc00c008c014c0ccc0c4c08c00488c94ccc0acc010c0ccc0c40084c8c8c94ccc0b8cdc3a4000004294054ccc0b8cdc3a400400426466e2000401cdd6981b0008a513038002303800137540022646464a66605c66e1d200000215330274a0294054ccc0b8cdc3a40040042a6604e6466e2000401cdd6981b00089919b87007001375a606c0022a6604e944528181c001181c0009baa001303200123370e60686ea8005200201e2330023374a900001299ba548008cc04800409488cc00ccdd2a4000660240046602400804a66e9520003301200133012004025223374a90001980880119808800812260103d87a8000232323253330253370e9001001098168008a998170028b181780118178009baa32302b301b001302a301a0014901033330380023026300200123025300200123024300200123023300200123022300a0012533301c001153302400216132533301d00113024002153302500416302100149103333036004901033330370023330023237586042602200260406020002646eb0c084c01cc044004c080c040004c038004888cccc02800c0048cc014c038c8c08cc04c004c088c080c04800400c54cc088018588c024894ccc064004405c4c94ccc064c0100044cc014004c00cc07c0084c00cc07c008c0800055d02492063616e27742067657420616e7920636f6e74696e75696e67206f75747075747300230193019001253330130011480004ccc048cdd7980f180d0009ba9002375a603a60346eacc074c06800520004890022330033005001002300122253330120011225001153330113002301900113222300200330190011330030023017001232300223300200200123002233002002001223300300230163006001223375e6e9cc014008dd398028009191919299980719b87480080084c05800454cc05c01458c060008c060004dd5180998089801800a49033330340023014375400246601000200429452401327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67004901387074727946726f6d2843757272656e637953796d626f6c293a206d757374206265203238206279746573206c6f6e67206f7220656d7074790049012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e67004901257074727946726f6d28504f53495854696d65293a206d75737420626520706f736974697665004bd702b9a5573e9201317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f004901257074727946726f6d2854784964293a206d757374206265203332206279746573206c6f6e670049012a7074727946726f6d2854784964293a20636f6e7374727563746f72206669656c6473206c656e203e2031004901267074727946726f6d2854784964293a20696e76616c696420636f6e7374727563746f7220696400574492012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e67005742ae7124013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72005573caae75",\n "description": "Fundraising validator",\n "type": "PlutusScriptV2"\n}'},1946:e=>{"use strict";e.exports='{\n "cborHex": "590329590326010000323232323232323232323232323232323232322223232323232323253330153370e9000001099191919299980c99b874800000854ccc064cdc39998079bab301e30133018301e004375c603c0026eb8c078015200215333019332301322533301d00114a02a6646603a0022944c00cc0840044c008c07c0048cdd7980f980c8008079bac301e3018301e301800c149854cc07d2401115554784f206e6f7420636f6e73756d65640016153301f01616153301f01716301f002301f0013754603660320026028010264646464a66603266e1d2000002153330193370e66601e6eacc078c04cc060c078010dd7180f0009bae301e00532337029000000a40042930a9980f80b0b0a9980f80b8b180f801180f8009baa301b30190013014008301b002301b001375400ca66602266e1d2000002132325333013337126e340052040132324994ccc054004526153301a016163016003153301901716375c002602c0022a66602266e1d2002002132325333013337126e340052040132324994ccc054004526153301a016163016003153301901716375c002602c0022a6602e92013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f720016301700230170013754004444666600800490001199980280124000eb4dd5800801918011ba900122223300522533300f00110051533300e3375e602c602600200c26008602a602600226004602200200246460044660040040024600446600400400246014600400246012600400246010601000292103323034004901435061747465726e206d61746368206661696c75726520696e2027646f2720626c6f636b206174207372632f5368617265642f436865636b732e68733a33373a332d313900230093754002ae6955cfa481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0057449201327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67005742ae7155cf2ab9d1",\n "description": "NFT Minting Policy",\n "type": "PlutusScriptV2"\n}'},2076:e=>{"use strict";e.exports='{\n "cborHex": "591d5e591d5b0100003232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232222232323232323232323232323253330573370e900000109919299982c998191ba9001375860bc6066609c00c264646464a6660ba66ebcc188c138c148054c8c18cc13cc14c004c0bc01854ccc174cdd79831181c982900a991831981d182980098178030a99982e980f9982380a9817803099191919299983099b89030375a60cc0082a6660c266e20dd698330021bad3066003153330613371090011bad306600215333061337106eb4c198008dd698330008a999830a9981099b8948000dd698331832800899b88375a60cc60ca0029064008a9998309980d980e00b9bab30663065305600a153330613370e66607c6eacc198c194c158028dd71833182b00d1bae30663065305601a48008526153306703116153306703216153306749103313332001615330674910331333100161533067491033133300016153306749103313239001615330674910331323800163064001306300130620013052302f006153306349103313134001615330634910331313300161533063491033131320016533305c3370e900000109919191919191919191919191919191919191919191919191919191924ca6660f00022930a9983e83c8b183d003299983a99b87480000084c8c94ccc1dccdc3984000800a4000264a6660f066ebcdd38399ba7307c00113253330793370e6e340052040132323232324994ccc1f800452615330830107f16308001003375a00260fe00260fa00a2a660fe0ea2c6eb8c1f400454cc1f81d458c1fc00454cc1f41d458dd5000983d0008a9983d83e0b183e001183e0009baa00130760013074006533306f3370e900000109919191919191919191919191924ca6660f80022930a998408083e8b183f003299983c99b87480000084c8c8c8c8c8c8c926533308001001149854cc214042040458c208040194ccc1f4cdc3a4000004264646464646464932999842008008a4c2a661120210a022c610c0200ca6661020266e1d2000002132325333083013370e6e340052038132324994ccc21404004526153308a0108601163087010031533089010820116375c002610c020022a6661020266e1d2002002132325333083013370e6e340052038132324994ccc21404004526153308a0108601163087010031533089010860116375c002610c020022a6610e02110022c6110020046110020026ea8004c2080400454ccc1f4cdc3a4004004264646464646464646464932999843808008a4c2a6611802110022c6112020066eb4004c22004004c2180400cdd68009842808009841808019bad0013082010011533083010840116308401002308401001375400260fc0022a6660f266e1d20020021324994ccc1e8004526153307f07b16153307f0800116308001002308001001375400260f400260f000ca6660e666e1d20000021323253330753370e6e340052038132324994ccc1dc004526153307c078163079003153307b07416375c00260f00022a6660e666e1d20020021323253330753370e6e340052038132324994ccc1dc004526153307c078163079003153307b07816375c00260f00022a660f20f42c60f400460f40026ea8004c1d000454cc1d41d858c1d8008c1d8004dd5000983800098370019bad001306d001306b003375a00260d400260d00066eb4004c19c004c19400cdd6800983200098310019bad001306100115330620631630630023063001375460560042a660be08e2c608e60ba6092609a020605801a2a6660ae66e1d2002002132323232323232323253330603301a301b016375660ca60c860aa0122a6660c066e1cccc0f4dd598329832182a8049bae30653055019375c60ca60c860aa032900109919191929998321982700e181b0068a99983219b87333041375660d260ac60b20226eb8c1a4c15cc164030dd71834982b182c806240042646464646464646464a6660da66ebcc1c8c178c188048c1c800454ccc1b54cc0b4cdc49bad3072005375a60e4010266e24dd698390041bad30720041533306d33223232325330323303130393077002303930770011330313039307730760013039307730760023066002306500232330380010013374a90011982b801035183900399911981b99ba548008cc15c0081a8cdd2a4004660ae0020d4660706eb4c1c800c018cc0e0dd698390010030a99983699baf307230710013072307130710071533306d337126e34dd71839004a408c26464a6660de66e1cccc130008dd7183a1839983200b9bae3074306330640174800854ccc1bccdc39998260011bae307430623064017375c60e860c260c802e90010a99983799b870013370007c07c2a6660de660906ea4dd7183a183200a1bac30743049306401c149854cc1d52401033133340016153307549103313232001615330754910331323100161533075491033132300016533306f0011480004ccc1b8cdd7983b98398009ba9488100375a60ec60e66eacc1d8c1cc0052000375660e460e260c40262a660e692103313333001615330734910331323700161533073491033132360016153307349103313139001615330734910331313800163070001306f001306e001306d001305d020306c3058305c00f306a001306900130583059009153306a4901033132350016153306a49103313137001653330633370e900000109919191919191919191919191919191919191919191919191919191924ca6660fe0022930a9984200840008b184080803299983e19b87480000084c8c94ccc1f8cdc3984380800a4000264a6660fe66ebcdd383d1ba73083010011325333080013370e6e340052040132323232324994ccc21404004526153308a010860116308701003375a002610c0200261080200a2a6610c020f82c6eb8c2100400454cc214041f058c2180400454cc210041f058dd50009840808008a9984100841808b1841808011841808009baa001307d001307b00653330763370e900000109919191919191919191919191924ca666106020022930a9984400842008b18428080329998400099b87480000084c8c8c8c8c8c8c926533308701001149854cc230042200458c224040194ccc21004cdc3a4000004264646464646464932999845808008a4c2a6612002118022c611a0200ca6661100266e1d200000213232533308a013370e6e340052038132324994ccc2300400452615330910108d0116308e010031533090010890116375c002611a020022a6661100266e1d200200213232533308a013370e6e340052038132324994ccc2300400452615330910108d0116308e0100315330900108d0116375c002611a020022a6611c0211e022c611e02004611e020026ea8004c2240400454ccc21004cdc3a4004004264646464646464646464932999847008008a4c2a661260211e022c6120020066eb4004c23c04004c2340400cdd68009846008009845008019bad001308901001153308a0108b0116308b01002308b010013754002610a020022a6661000266e1d20020021324994ccc2040400452615330860108201161533086010870116308701002308701001375400261020200260fe00ca6660f466e1d200000213232533307c3370e6e340052038132324994ccc1f800452615330830107f1630800100315330820107b16375c00260fe0022a6660f466e1d200200213232533307c3370e6e340052038132324994ccc1f800452615330830107f1630800100315330820107f16375c00260fe0022a6610002102022c6102020046102020026ea8004c1ec00454cc1f01f458c1f4008c1f4004dd5000983b800983a8019bad00130740013072003375a00260e200260de0066eb4004c1b8004c1b000cdd6800983580098348019bad0013068001153306906a16306a002306a001375460640122a660cc0602c2a660cc0622ca6660be66e1d20000021323253330613370e6e340052038132323232323232323232323232323253330703371290000008991919191919191919191924ca6660f60022930a998400083e0b183e803299983c19b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c926533308501001149854cc228042180458c21c040194ccc20804cdc3a4000004264646464646464932999844808008a4c2a6611c02114022c61160200ca66610c0266e1d20000021323232323232324994ccc2340400452615330920108e0116308f01006533308a013370e90000010991929998460099b87371a002901c0991924ca66611c020022930a9984980847808b1848008018a9984900845808b1bae001308f010011533308a013370e90010010991929998460099b87371a002901c0991924ca66611c020022930a9984980847808b1848008018a9984900847808b1bae001308f01001153309001091011630910100230910100137540026116020022a66610c0266e1d20020021323232323232323232324994ccc240040045261533095010910116309201003375a002612202002611e020066eb4004c23804004c2300400cdd68009845808008a9984600846808b1846808011846808009baa00130870100115333082013370e900100109924ca666106020022930a9984400842008b0a9984400844808b1844808011844808009baa001308301001308101006533307c3370e900000109919299983f19b87371a002901c0991924ca666100020022930a9984280840808b1841008018a998420083e8b1bae0013081010011533307c3370e900100109919299983f19b87371a002901c0991924ca666100020022930a9984280840808b1841008018a9984200840808b1bae0013081010011533082010830116308301002308301001375400260fa0022a660fc0fe2c60fe00460fe0026ea8004c1e4004c1dc00cdd6800983b000983a0018a9983b0340b1bad00130730013071003375a00260e000260dc0066eb8004c1b4004c1ac0194ccc198cdc3a400000426464a6660d066e1cc1c4005200013253330693375e6e9c190dd39836800899299983519b87371a00290200991919191924ca6660de0022930a9983a0380b18388019bad0013070001306e005153307006616375c60dc0022a660de0cc2c60e00022a660dc0cc2c6ea8004c1ac00454cc1b01b458c1b4008c1b4004dd5000983380098328018a998338300b1bae0013064001153306506616306600230660013754002605a0026060660806086002646eb0c180c13cc140004c17cc13c040c178c138004c174008c0b00344c94ccc160cc0c4dd48009bac305d3032304d005132533305a001153330593370e66606c6eacc178c12cc138018dd7182f18270091bae305e305d304e012303948008526153305f03a16153330593370e66606c6eacc178c12cc138018dd7182f18270091bae305e305d304e012303948008526153305f03a16303a00e153305e046163046305c3048304c00f305e002305e0013754016646464a6660ac66e1d20020021305b304b00c153305c4901033330330016305d002305d001375460b060ae6090012a6660a466e1d20000021323232323232324994ccc164004526153305e05a16305b00653330563370e900000109919191919191919191919191919191924ca6660cc0022930a998358338b18340019bad00130670013065003375a00260c800260c40066eb4004c184004c17c00cdd6800982f000982e0019bad001305b001153305c05d16305d002305d001375400260ae0022a6660a466e1d20020021323232323232324994ccc164004526153305e05a16305b00653330563370e90000010991919191919191919299982fa9982a99b87001480004cdc3800a40702646464a6660c466e24dc6800a4080264646464a6660cca660b866e1c005200013370e002901c0991919299983499b89371a00290200991919299983619b89480000044c8c926533306e001149854cc1cc1bc58c1c000c54cc1c819058dd6800983780098368018a998378310b1bae001306c001306a004153306c06016371a0026eb8004c1a0004c19800c54cc1a016c58dd7000983280098318020a9983282c8b1b8d001375c00260c200260be00ca6660b466e1d20000021323232323232323232323232324994ccc19c004526153306c06816306900653330643370e900000109919191919191924ca6660d60022930a998380360b1836803299983419b87480000084c8c8c8c8c8c8c926533306f001149854cc1d01c058c1c40194ccc1b0cdc3a400000426464a6660dc66e1cdc6800a4070264649329998380008a4c2a660ea0e22c60e40062a660e80da2c6eb8004c1c400454ccc1b0cdc3a400400426464a6660dc66e1cdc6800a4070264649329998380008a4c2a660ea0e22c60e40062a660e80e22c6eb8004c1c400454cc1c81cc58c1cc008c1cc004dd500098368008a99983419b87480080084c8c8c8c8c8c8c8c8c8c9265333072001149854cc1dc1cc58c1d000cdd6800983980098388019bad0013070001306e003375a00260da0022a660dc0de2c60de00460de0026ea8004c1a400454ccc190cdc3a40040042649329998328008a4c2a660d40cc2c2a660d40d62c60d600460d60026ea8004c194004c18c0194ccc178cdc3a400000426464a6660c066e1cdc6800a4070264649329998310008a4c2a660ce0c62c60c80062a660cc0be2c6eb8004c18c00454ccc178cdc3a400400426464a6660c066e1cdc6800a4070264649329998310008a4c2a660ce0c62c60c80062a660cc0c62c6eb8004c18c00454cc19019458c194008c194004dd5000982f8008a998300308b183080118308009baa001305b001153305c05d16305d002305d001375400260ae0022a6660a466e1d20040021324994ccc14c00452615330580541615330580591630590023059001375400ca66609c66e1d20000021323232323232323232323232323232323232323232323232323232324994ccc1a8004526153306f06b16306c00653330673370e900000109919299983499b873072001480004c94ccc1a8cdd79ba7065374e60dc002264a6660d666e1cdc6800a4080264646464649329998380008a4c2a660ea0e22c60e40066eb4004c1c4004c1bc01454cc1c419c58dd718378008a998380338b18388008a998378338b1baa001306c001153306d06e16306e002306e001375400260d000260cc00ca6660c266e1d20000021323232323232323232323232324994ccc1b8004526153307306f163070006533306b3370e900000109919191919191924ca6660e40022930a9983b8398b183a003299983799b87480000084c8c8c8c8c8c8c9265333076001149854cc1ec1dc58c1e00194ccc1cccdc3a400000426464a6660ea66e1cdc6800a40702646493299983b8008a4c2a660f80f02c60f20062a660f60e82c6eb8004c1e000454ccc1cccdc3a400400426464a6660ea66e1cdc6800a40702646493299983b8008a4c2a660f80f02c60f20062a660f60f02c6eb8004c1e000454cc1e41e858c1e8008c1e8004dd5000983a0008a99983799b87480080084c8c8c8c8c8c8c8c8c8c9265333079001149854cc1f81e858c1ec00cdd6800983d000983c0019bad00130770013075003375a00260e80022a660ea0ec2c60ec00460ec0026ea8004c1c000454ccc1accdc3a40040042649329998360008a4c2a660e20da2c2a660e20e42c60e400460e40026ea8004c1b0004c1a80194ccc194cdc3a400000426464a6660ce66e1cdc6800a4070264649329998348008a4c2a660dc0d42c60d60062a660da0cc2c6eb8004c1a800454ccc194cdc3a400400426464a6660ce66e1cdc6800a4070264649329998348008a4c2a660dc0d42c60d60062a660da0d42c6eb8004c1a800454cc1ac1b058c1b0008c1b0004dd500098330008a998338340b183400118340009baa00130620013060003375a00260be00260ba0066eb4004c170004c16800cdd6800982c800982b8019bad00130560013054003375a00260a60022a660a80aa2c60aa00460aa0026ea800c88cdd79ba6002374c0024646eacc130c12cc0f0004c0080048c8c12cc128c0ec004ccc008004800454cc12c00c588cc0a0c8dd61825181d0009824981c8009818000a4903333035002232323232533304753303d5330070021001153300730090021300900113300a00400313300c004003300c304b304a004300b304a3049004304900230480022233304200200100314a0466607e002941289129981a9980200100089980180100091191919299982099b87480000084c8c8c94ccc110cdc3a40000042944528182580118258009baa004153330413370e90010010991919299982219b87480080084c8cdc39bad304a005001375a60920022940c12c008c12c004dd50020991919299982219b87480100085288a50304b002304b0013754008609000460900026ea800888c8c8c94ccc100cdc3a4000004294454ccc100cdc3a40040042646464a66608666e1d200000214a02a66608666e1d200400214a2266e20dd698240021bad3048001304a002304a00137540082646464a66608666e1d200400214a22940c128008c128004dd5002182380118238009baa00223370e60886ea8005200202e22330033374a9000198110011981100201a99ba548000cc088004cc0880100d488cdd2a40006604200466042002068980103d87a8000223300300137506008004446ea0cdc01bad002375a002466e08cdc1000a40f0004906807a410125e802921033131360049010331313500232323253330323370e90010010a9981c0028b0a99981919b87480100084c0dc00454cc0e001858c0e4008c0e4004dd5181a18119812000a4903333032004901033330310023002300e0012533302c001153303100216132533302d00113031002153303200416302f0014910333303600490103333037002300f22533302b00114a02a66605466ebcc0bc00400c52889801181700091815980100091815180100091814980b0009111999802001240004666600a00490003ad3756002006460046ea40048888cc030894ccc0a0004401454ccc09ccdd7981818160008030980218179816000898011815800800919b814800000524103313233002333002323758604a602a00260486028002646eb0c094c050c054004c090c050004c02c004888cccc01000c0048cc01cc028c8c09cc05c004c098c094c05800400c54cc09802c5888cc00cc01c004008c0088894ccc07c004489400454ccc078c008c08c0044c888c00800cc08c0044cc00c008c0880048c008894ccc07800440604c94ccc078c0100044cc018004c00cc0880084c00cc088008c0880048c8c0088cc0080080048c0088cc0080080055d01119801801180f18070009119baf374e601a0046e9cc03400524012063616e27742067657420616e7920636f6e74696e75696e67206f75747075747300232323253330183370e90010010980e8008a9980f0028b180f801180f8009baa301a3019300a001491033330340049010331313100232323253330153370e90010010a9980d8028b09bae301a001301c002301c0013754602e600e002921033331320023014300200123013300200123012300200123011301100123014375400246601600200429452401257074727946726f6d28504f53495854696d65293a206d75737420626520706f736974697665004901327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67004901387074727946726f6d2843757272656e637953796d626f6c293a206d757374206265203238206279746573206c6f6e67206f7220656d707479004bd70249257074727946726f6d2854784964293a206d757374206265203332206279746573206c6f6e670049012a7074727946726f6d2854784964293a20636f6e7374727563746f72206669656c6473206c656e203e2031004901267074727946726f6d2854784964293a20696e76616c696420636f6e7374727563746f722069640049012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e67005734aae7d241317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0049012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e67005744ae855ce2493f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72005573caae75",\n "description": "Protocol Validator",\n "type": "PlutusScriptV2"\n}'},615:e=>{"use strict";e.exports='{\n "cborHex": "5903a35903a0010000323232323232323232323232323232323232323232322223232323232323253330183370e9001001099191919299980e19b874800000854ccc070cdc399980a1bab3021300f301b3021004375c60420026eb8c084014c8cdc0a400000290010a4c2a660440322c2a660440342c604400460440026ea8c078c070004c05c0204c8c8c8c94ccc070cdc3a40000042a66603866e1cccc050dd598109807980d98108021bae3021001375c604200a90010a99980e19808919b8733301537566044604060380026eb8c088c07003cdd718111810180e007a4004664603044a666040002297ae0133574060066048002600460440024604460406038002646eb0c088c070004c084c06c03054ccc070cc0448cdc399980a9bab30223020301c001375c6044603801e6eb8c088c080c07003d2002323758604460326038002604260360182930a9981124810332303600161533022491033230350016153302201916153302201a16302200230220013754603c6038002602e010603c004603c0026ea80194ccc050cdc3a400000426464a66602c66e24dc6800a40802646493299980c0008a4c2a6603a0322c60320062a660380342c6eb8004c06400454ccc050cdc3a400400426464a66602c66e24dc6800a40802646493299980c0008a4c2a6603a0322c60320062a660380342c6eb8004c06400454cc0692413f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f720016301a002301a00137540044602260040024602060120024600e44a66601e002294054cc010c00cc04c0044c008c0440048cc02c0040085289111999802001240004666600a00490003ad3756002006460046ea40048888cc014894ccc034004401454ccc030cdd7980a18088008030980218099808800898011807800800919180111980100100091801119801001000918041804000a4903323034004901435061747465726e206d61746368206661696c75726520696e2027646f2720626c6f636b206174207372632f5368617265642f436865636b732e68733a33373a332d313900230093754002ae6955cfa481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0057449201327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67005742ae7155cf2ab9d1",\n "description": "Verification token",\n "type": "PlutusScriptV2"\n}'},5174:()=>{}}]); \ No newline at end of file +(self.webpackChunkctl_scaffold=self.webpackChunkctl_scaffold||[]).push([[535],{2711:(e,n,t)=>{e=t.nmd(e);var r,o,a=t(4155),u=t(5108),i=t(2833).Buffer,c={};!function(e){const{BigNumber:n}=t(6628),r=t(4721)({}),o=e=>e;e.fromString=o,e.fromFiniteBigNumber=o,e.fromArray=o,e.fromObject=o,e.aesonNull=null;const a=e=>t=>r=>o=>a=>u=>i=>{if(null===i)return e(i);if("boolean"==typeof i)return t(i);if("string"==typeof i)return o(i);if(n.isBigNumber(i))return r(i);if(Array.isArray(i))return a(i);if("object"==typeof i)return u(i);throw"Imposible happened: JSON object is incorrect: "+i.toString()+" "+typeof i};e._caseAeson=a;const u=n(2).pow(512);class i extends n{constructor(e){super(e)}toJSON(){return this.isInteger()&&this.abs().lte(u)?this.toFixed():super.toJSON()}}e.stringifyAeson=e=>r.stringify((e=>{const n=[],t=a(o)(o)((e=>new i(e)))(o)((e=>{const r=[];return e.forEach(((e,o)=>{n.push((()=>r[o]=t(e)))})),r}))((e=>{const r={};return Object.keys(e).reverse().forEach((o=>{n.push((()=>r[o]=t(e[o])))})),r})),r=t(e);for(;0!==n.length;)n.pop()();return r})(e)),e.parseAeson=e=>n=>t=>{try{return n(r.parse(t))}catch(n){return e}};const c=e=>n=>e;a(c("null"))(c("bool"))(c("bnum"))(c("str"))(c("arr"))(c("obj"))}(c.Aeson=c.Aeson||{}),function(e){"use strict";e["Control.Alt"]=e["Control.Alt"]||{},e["Control.Alt"].alt=function(e){return e.alt}}(c),function(e){"use strict";e.arrayApply=function(e){return function(n){for(var t=e.length,r=n.length,o=new Array(t*r),a=0,u=0;us.length)return r;for(var f=l.concat(s).sort(),d=0;da?-1:1}}}}(c["Data.Ord"]=c["Data.Ord"]||{}),function(e){"use strict";e["Data.Ordering"]=e["Data.Ordering"]||{};var n=e["Data.Ordering"],t=function(){function e(){}return e.value=new e,e}(),r=function(){function e(){}return e.value=new e,e}(),o=function(){function e(){}return e.value=new e,e}(),a={eq:function(e){return function(n){return e instanceof t&&n instanceof t||e instanceof r&&n instanceof r||e instanceof o&&n instanceof o}}};n.LT=t,n.GT=r,n.EQ=o,n.invert=function(e){if(e instanceof r)return t.value;if(e instanceof o)return o.value;if(e instanceof t)return r.value;throw new Error("Failed pattern match at Data.Ordering (line 33, column 1 - line 33, column 31): "+[e.constructor.name])},n.eqOrdering=a}(c),function(e){"use strict";e.intSub=function(e){return function(n){return e-n|0}}}(c["Data.Ring"]=c["Data.Ring"]||{}),function(e){"use strict";e.intAdd=function(e){return function(n){return e+n|0}},e.intMul=function(e){return function(n){return e*n|0}},e.numAdd=function(e){return function(n){return e+n}},e.numMul=function(e){return function(n){return e*n}}}(c["Data.Semiring"]=c["Data.Semiring"]||{}),function(e){"use strict";e["Data.Semiring"]=e["Data.Semiring"]||{};var n=e["Data.Semiring"],t=e["Data.Semiring"],r=e["Data.Symbol"],o=e["Record.Unsafe"],a=e["Type.Proxy"],u=function(e){return e.zeroRecord},i=function(e){return e.zero},c={add:t.numAdd,zero:0,mul:t.numMul,one:1},l={add:t.intAdd,zero:0,mul:t.intMul,one:1},s=function(e){return e.oneRecord},f=function(e){return e.one},d=function(e){return e.mulRecord},v=function(e){return e.mul},m=function(e){return e.addRecord},p=function(e){return e.add};n.add=p,n.zero=i,n.mul=v,n.one=f,n.semiringInt=l,n.semiringNumber=c,n.semiringRecord=function(){return function(e){return{add:m(e)(a.Proxy.value),mul:d(e)(a.Proxy.value),one:s(e)(a.Proxy.value)(a.Proxy.value),zero:u(e)(a.Proxy.value)(a.Proxy.value)}}},n.semiringRecordNil={addRecord:function(e){return function(e){return function(e){return{}}}},mulRecord:function(e){return function(e){return function(e){return{}}}},oneRecord:function(e){return function(e){return{}}},zeroRecord:function(e){return function(e){return{}}}},n.semiringRecordCons=function(e){return function(){return function(n){return function(t){return{addRecord:function(u){return function(u){return function(i){var c=m(n)(a.Proxy.value)(u)(i),l=r.reflectSymbol(e)(a.Proxy.value),s=o.unsafeSet(l),f=o.unsafeGet(l);return s(p(t)(f(u))(f(i)))(c)}}},mulRecord:function(u){return function(u){return function(i){var c=d(n)(a.Proxy.value)(u)(i),l=r.reflectSymbol(e)(a.Proxy.value),s=o.unsafeSet(l),f=o.unsafeGet(l);return s(v(t)(f(u))(f(i)))(c)}}},oneRecord:function(u){return function(u){var i=s(n)(a.Proxy.value)(a.Proxy.value),c=r.reflectSymbol(e)(a.Proxy.value);return o.unsafeSet(c)(f(t))(i)}},zeroRecord:function(c){return function(c){var l=u(n)(a.Proxy.value)(a.Proxy.value),s=r.reflectSymbol(e)(a.Proxy.value);return o.unsafeSet(s)(i(t))(l)}}}}}}}}(c),function(e){"use strict";e["Data.Ring"]=e["Data.Ring"]||{};var n=e["Data.Ring"],t=e["Data.Ring"],r=e["Data.Semiring"],o=function(e){return e.sub},a={sub:t.intSub,Semiring0:function(){return r.semiringInt}};n.sub=o,n.negate=function(e){return function(n){return o(e)(r.zero(e.Semiring0()))(n)}},n.ringInt=a}(c),function(e){"use strict";e["Data.Ord"]=e["Data.Ord"]||{};var n=e["Data.Ord"],t=e["Data.Ord"],r=e["Data.Eq"],o=e["Data.Ordering"],a=e["Data.Ring"],u=e["Data.Semiring"],i=e["Data.Symbol"],c=e["Record.Unsafe"],l=e["Type.Proxy"],s={compare:t.ordStringImpl(o.LT.value)(o.EQ.value)(o.GT.value),Eq0:function(){return r.eqString}},f={compareRecord:function(e){return function(e){return function(e){return o.EQ.value}}},EqRecord0:function(){return r.eqRowNil}},d={compare:t.ordNumberImpl(o.LT.value)(o.EQ.value)(o.GT.value),Eq0:function(){return r.eqNumber}},v={compare:t.ordIntImpl(o.LT.value)(o.EQ.value)(o.GT.value),Eq0:function(){return r.eqInt}},m={compare:t.ordCharImpl(o.LT.value)(o.EQ.value)(o.GT.value),Eq0:function(){return r.eqChar}},p=function(e){return e.compareRecord},g=function(e){return e.compare},y=function(e){return function(n){return function(t){return!(g(e)(n)(t)instanceof o.LT)}}};n.compare=g,n.compare1=function(e){return e.compare1},n.lessThan=function(e){return function(n){return function(t){return g(e)(n)(t)instanceof o.LT}}},n.lessThanOrEq=function(e){return function(n){return function(t){return!(g(e)(n)(t)instanceof o.GT)}}},n.greaterThan=function(e){return function(n){return function(t){return g(e)(n)(t)instanceof o.GT}}},n.greaterThanOrEq=y,n.comparing=function(e){return function(n){return function(t){return function(r){return g(e)(n(t))(n(r))}}}},n.min=function(e){return function(n){return function(t){var r=g(e)(n)(t);if(r instanceof o.LT)return n;if(r instanceof o.EQ)return n;if(r instanceof o.GT)return t;throw new Error("Failed pattern match at Data.Ord (line 167, column 3 - line 170, column 12): "+[r.constructor.name])}}},n.max=function(e){return function(n){return function(t){var r=g(e)(n)(t);if(r instanceof o.LT)return t;if(r instanceof o.EQ)return n;if(r instanceof o.GT)return n;throw new Error("Failed pattern match at Data.Ord (line 176, column 3 - line 179, column 12): "+[r.constructor.name])}}},n.abs=function(e){return function(n){return function(t){return y(e)(t)(u.zero(n.Semiring0()))?t:a.negate(n)(t)}}},n.signum=function(e){return function(n){return function(t){return y(e)(t)(u.zero(n.Semiring0()))?u.one(n.Semiring0()):a.negate(n)(u.one(n.Semiring0()))}}},n.ordInt=v,n.ordNumber=d,n.ordString=s,n.ordChar=m,n.ordArray=function(e){return{compare:(n=function(n){return function(t){var r=g(e)(n)(t);if(r instanceof o.EQ)return 0;if(r instanceof o.LT)return 1;if(r instanceof o.GT)return-1;throw new Error("Failed pattern match at Data.Ord (line 74, column 7 - line 77, column 17): "+[r.constructor.name])}},function(e){return function(r){return g(v)(0)(t.ordArrayImpl(n)(e)(r))}}),Eq0:function(){return r.eqArray(e.Eq0())}};var n},n.ordRecordNil=f,n.ordRecordCons=function(e){return function(){return function(n){return function(t){return{compareRecord:function(a){return function(a){return function(u){var s=i.reflectSymbol(n)(l.Proxy.value),f=g(t)(c.unsafeGet(s)(a))(c.unsafeGet(s)(u));return r.notEq(o.eqOrdering)(f)(o.EQ.value)?f:p(e)(l.Proxy.value)(a)(u)}}},EqRecord0:function(){return r.eqRowCons(e.EqRecord0())()(n)(t.Eq0())}}}}}},n.ordRecord=function(){return function(e){return{compare:p(e)(l.Proxy.value),Eq0:function(){return r.eqRec()(e.EqRecord0())}}}}}(c),function(e){"use strict";e._copyST=function(e){return function(){var n={};for(var t in e)hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n}},e.empty={},e.runST=function(e){return e()},e._fmapObject=function(e,n){var t={};for(var r in e)hasOwnProperty.call(e,r)&&(t[r]=n(e[r]));return t},e._mapWithKey=function(e,n){var t={};for(var r in e)hasOwnProperty.call(e,r)&&(t[r]=n(r)(e[r]));return t},e._foldM=function(e){return function(n){return function(t){return function(r){var o=t;function a(e){return function(t){return n(t)(e)(r[e])}}for(var u in r)hasOwnProperty.call(r,u)&&(o=e(o)(a(u)));return o}}}},e._lookup=function(e,n,t,r){return t in r?n(r[t]):e},e.toArrayWithKey=function(e){return function(n){var t=[];for(var r in n)hasOwnProperty.call(n,r)&&t.push(e(r)(n[r]));return t}}}(c["Foreign.Object"]=c["Foreign.Object"]||{}),function(e){"use strict";e.map_=function(e){return function(n){return function(){return e(n())}}},e.pure_=function(e){return function(){return e}},e.bind_=function(e){return function(n){return function(){return n(e())()}}},e.while=function(e){return function(n){return function(){for(;e();)n()}}},e.foreach=function(e){return function(n){return function(){for(var t=0,r=e.length;tn?-1:1,r=new Array(t*(n-e)+1),o=e,a=0;o!==n;)r[a++]=o,o+=t;return r[a]=o,r}},e.replicate="function"==typeof Array.prototype.fill?function(e){return function(n){return e<1?[]:new Array(e).fill(n)}}:function(e){return function(n){for(var t=[],r=0,o=0;o=t.length?n:e(t[r])}}}},e.findIndexImpl=function(e){return function(n){return function(t){return function(r){for(var o=0,a=r.length;o=r.length)return n;var o=r.slice();return o.splice(t,1),e(o)}}}},e.reverse=function(e){return e.slice().reverse()},e.concat=function(e){if(e.length<=1e4)return Array.prototype.concat.apply([],e);for(var n=[],t=0,r=e.length;t>1))-a>1&&e(n,t,o,r,a,i),u-i>1&&e(n,t,o,r,i,u),c=a,l=i,s=a;c0?(r[s++]=d,++l):(r[s++]=f,++c);for(;c=0;o--)r=e(t[o])(r);return r}}},e.foldlArray=function(e){return function(n){return function(t){for(var r=n,o=t.length,a=0;a="0"&&e[o]<="9"?"\\&":"";return"\\"+t.charCodeAt(0).toString(10)+a}))+'"'},e.showArrayImpl=function(e){return function(n){for(var t=[],r=0,o=n.length;r0?Math.floor(e):Math.ceil(e)}(t));return e(r)}catch(e){return n}}}},r.fromInt=function(e){return o(e)},r.toBase=function(e){return function(n){return n.toString(e)}},r.toNumber=function(e){return e.toJSNumber()},r.biAdd=function(e){return function(n){return e.add(n)}},r.biMul=function(e){return function(n){return e.multiply(n)}},r.biSub=function(e){return function(n){return e.minus(n)}},r.biMod=function(e){return function(n){return e.mod(n)}},r.biDiv=function(e){return function(n){return e.divide(n)}},r.biEquals=function(e){return function(n){return e.equals(n)}},r.biCompare=function(e){return function(n){return e.compare(n)}},r.abs=function(e){return e.abs()},function(e){"use strict";e.intDegree=function(e){return Math.min(Math.abs(e),2147483647)},e.intDiv=function(e){return function(n){return 0===n?0:n>0?Math.floor(e/n):-Math.floor(e/-n)}},e.intMod=function(e){return function(n){if(0===n)return 0;var t=Math.abs(n);return(e%t+t)%t}}}(c["Data.EuclideanRing"]=c["Data.EuclideanRing"]||{}),function(e){"use strict";e["Data.CommutativeRing"]=e["Data.CommutativeRing"]||{};var n=e["Data.CommutativeRing"],t=e["Data.Ring"],r={Ring0:function(){return t.ringInt}};n.commutativeRingInt=r}(c),function(e){"use strict";e["Data.EuclideanRing"]=e["Data.EuclideanRing"]||{};var n=e["Data.EuclideanRing"],t=e["Data.EuclideanRing"],r=e["Data.CommutativeRing"],o=e["Data.Eq"],a=e["Data.Semiring"],u=function(e){return e.mod},i={degree:t.intDegree,div:t.intDiv,mod:t.intMod,CommutativeRing0:function(){return r.commutativeRingInt}};n.div=function(e){return e.div},n.mod=u,n.gcd=function(e){return function(n){return function(t){return function(r){var i,c=e,l=n,s=t,f=!1;function d(e,n,t,i){if(o.eq(e)(i)(a.zero(n.CommutativeRing0().Ring0().Semiring0())))return f=!0,t;c=e,l=n,s=i,r=u(n)(t)(i)}for(;!f;)i=d(c,l,s,r);return i}}}},n.euclideanRingInt=i}(c),function(e){"use strict";e.fromNumberImpl=function(e){return function(n){return function(t){return(0|t)===t?e(t):n}}},e.toNumber=function(e){return e},e.fromStringAsImpl=function(e){return function(n){return function(t){var r;r=t<11?"[0-"+(t-1).toString()+"]":11===t?"[0-9a]":"[0-9a-"+String.fromCharCode(86+t)+"]";var o=new RegExp("^[\\+\\-]?"+r+"+$","i");return function(r){if(o.test(r)){var a=parseInt(r,t);return(0|a)===a?e(a):n}return n}}}},e.toStringAs=function(e){return function(n){return n.toString(e)}}}(c["Data.Int"]=c["Data.Int"]||{}),function(e){"use strict";e.topInt=2147483647,e.bottomInt=-2147483648,e.topChar=String.fromCharCode(65535),e.bottomChar=String.fromCharCode(0)}(c["Data.Bounded"]=c["Data.Bounded"]||{}),function(e){"use strict";e["Data.Bounded"]=e["Data.Bounded"]||{};var n=e["Data.Bounded"],t=e["Data.Bounded"],r=e["Data.Ord"],o={top:t.topInt,bottom:t.bottomInt,Ord0:function(){return r.ordInt}},a={top:t.topChar,bottom:t.bottomChar,Ord0:function(){return r.ordChar}};n.bottom=function(e){return e.bottom},n.top=function(e){return e.top},n.boundedInt=o,n.boundedChar=a}(c),function(e){"use strict";e.isNaN=isNaN,e.infinity=1/0,e.isFinite=isFinite}(c["Data.Number"]=c["Data.Number"]||{}),function(e){"use strict";e["Data.Number"]=e["Data.Number"]||{};var n=e["Data.Number"],t=e["Data.Number"];n.isNaN=t.isNaN,n.infinity=t.infinity,n.isFinite=t.isFinite}(c),function(e){"use strict";e.ceil=Math.ceil,e.floor=Math.floor,e.trunc=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)},e.remainder=function(e){return function(n){return e%n}},e.round=Math.round}(c.Math=c.Math||{}),function(e){"use strict";e.Math=e.Math||{};var n=e.Math,t=e.Math;n.ceil=t.ceil,n.floor=t.floor,n.round=t.round,n.trunc=t.trunc,n.remainder=t.remainder}(c),function(e){"use strict";e["Data.Int"]=e["Data.Int"]||{};var n=e["Data.Int"],t=e["Data.Int"],r=e["Data.Boolean"],o=e["Data.Bounded"],a=e["Data.Maybe"],u=e["Data.Number"],i=e.Math,c=t.fromStringAsImpl(a.Just.create)(a.Nothing.value)(10),l=t.fromNumberImpl(a.Just.create)(a.Nothing.value),s=function(e){if(!u.isFinite(e))return 0;if(e>=t.toNumber(o.top(o.boundedInt)))return o.top(o.boundedInt);if(e<=t.toNumber(o.bottom(o.boundedInt)))return o.bottom(o.boundedInt);if(r.otherwise)return a.fromMaybe(0)(l(e));throw new Error("Failed pattern match at Data.Int (line 66, column 1 - line 66, column 29): "+[e.constructor.name])};n.fromNumber=l,n.ceil=function(e){return s(i.ceil(e))},n.floor=function(e){return s(i.floor(e))},n.fromString=c,n.decimal=10,n.toNumber=t.toNumber,n.toStringAs=t.toStringAs}(c),function(e){"use strict";e["Data.BigInt"]=e["Data.BigInt"]||{};var n=e["Data.BigInt"],t=e["Data.BigInt"],r=e["Data.EuclideanRing"],o=e["Data.Int"],a=e["Data.Maybe"],u=e["Data.Ordering"],i=e["Data.Ring"],c=e["Data.Semiring"],l=t.toBase(10),s={show:function(e){return'fromString "'+l(e)+'"'}},f={add:t.biAdd,zero:t.fromInt(0),mul:t.biMul,one:t.fromInt(1)},d={sub:t.biSub,Semiring0:function(){return f}},v=t.fromNumberImpl(a.Just.create)(a.Nothing.value),m=t.fromBaseImpl(a.Just.create)(a.Nothing.value)(10),p={eq:t.biEquals},g={compare:function(e){return function(n){var r=t.biCompare(e)(n);return 1===r?u.GT.value:0===r?u.EQ.value:u.LT.value}},Eq0:function(){return p}},y={Ring0:function(){return d}},b={div:function(e){return function(n){return t.biDiv(i.sub(d)(e)(r.mod(b)(e)(n)))(n)}},mod:function(e){return function(n){var r=t.abs(n);return t.biMod(c.add(f)(t.biMod(e)(r))(r))(r)}},degree:function(e){return o.floor(t.toNumber(t.abs(e)))},CommutativeRing0:function(){return y}};n.fromString=m,n.fromNumber=v,n.toString=l,n.toInt=function(e){return o.fromNumber(t.toNumber(e))},n.eqBigInt=p,n.ordBigInt=g,n.showBigInt=s,n.semiringBigInt=f,n.ringBigInt=d,n.euclideanRingBigInt=b,n.fromInt=t.fromInt,n.abs=t.abs,n.toNumber=t.toNumber}(c),function(e){"use strict";var n=t(6628);e.parseBigNumberImpl=function(e,t,r){var o;try{o=new n(r)}catch(n){return e(n)}return t(o)},e.isInteger=function(e){return e.isInteger()},e.toNumber=function(e){return e.toNumber()},e.toString=function(e){return e.toString()},e.toFixed=function(e){return e.toFixed()},e.toFractionImpl=function(e){return function(n,t){var r=n.toFraction(t);return e(r[0])(r[1])}},e.fromNumber=function(e){return new n(e)}}(c["Data.BigNumber"]=c["Data.BigNumber"]||{}),function(e){"use strict";e.from=function(e){return e>>>0},e.exact=function(e){return function(n){return function(t){return function(r){var o=t(r);return o==r?e(o):n}}}},e.toInt=function(e){return 0|e},e.toNumber=function(e){return e},e.uintAdd=function(e){return function(n){return e+n>>>0}},e.uintMul=function(e){return function(n){return Math.imul(e,n)>>>0}},e.uintEq=function(e){return function(n){return e==n}},e.uintCmp=function(e){return function(n){return function(t){return function(r){return function(o){return r>>0}},e.or=function(e){return function(n){return(e|n)>>>0}},e.shl=function(e){return function(n){return e<>>0}},e.zshr=function(e){return function(n){return e>>>n>>>0}}}(c["Data.UInt"]=c["Data.UInt"]||{}),function(e){"use strict";e["Data.UInt"]=e["Data.UInt"]||{};var n=e["Data.UInt"],t=e["Data.UInt"],r=e["Data.Maybe"],o=e["Data.Ordering"],a={show:function(e){return t.toString(e)+"u"}},u={eq:t.uintEq},i={compare:t.uintCmp(o.LT.value)(o.EQ.value)(o.GT.value),Eq0:function(){return u}},c=t.from,l=t.exact(r.Just.create)(r.Nothing.value)(c),s=t.from,f={zero:s(0),add:t.uintAdd,one:s(1),mul:t.uintMul};n.fromInt=s,n["fromNumber'"]=l,n.fromString=function(e){return l(t.fromStringImpl(e))},n.uintSemiring=f,n.uintEqInstance=u,n.uintOrd=i,n.uintShowInstance=a,n.toInt=t.toInt,n.toNumber=t.toNumber,n.and=t.and,n.or=t.or,n.shl=t.shl,n.zshr=t.zshr,n.toString=t.toString}(c),function(e){"use strict";e["Data.BigNumber"]=e["Data.BigNumber"]||{};var n=e["Data.BigNumber"],t=e["Data.BigNumber"],r=e["Data.Either"],o=e["Data.Function.Uncurried"],a=e["Data.Tuple"],u=e["Data.UInt"],i=o.runFn3(t.parseBigNumberImpl)(r.Left.create)(r.Right.create);n.parseBigNumber=i,n.toFraction=function(e){return function(n){return t.toFractionImpl(a.Tuple.create)(e,n)}},n.fromUInt=function(e){return t.fromNumber(u.toNumber(e))},n.isInteger=t.isInteger,n.toNumber=t.toNumber,n.toString=t.toString,n.toFixed=t.toFixed,n.fromNumber=t.fromNumber}(c),function(e){"use strict";e["Data.Typelevel.Undefined"]=e["Data.Typelevel.Undefined"]||{};var n=e["Data.Typelevel.Undefined"],t=e["Data.Unit"].unit;n[void 0]=t}(c),function(e){"use strict";e.unsafeUnionFn=function(e,n){var t={};for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r]);for(var o in e)({}).hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}}(c["Record.Unsafe.Union"]=c["Record.Unsafe.Union"]||{}),function(e){"use strict";e["Record.Unsafe.Union"]=e["Record.Unsafe.Union"]||{};var n=e["Record.Unsafe.Union"],t=e["Record.Unsafe.Union"];n.unsafeUnionFn=t.unsafeUnionFn}(c),function(e){"use strict";e.Record=e.Record||{};var n=e.Record,t=e["Data.Symbol"],r=e["Record.Unsafe"],o=e["Record.Unsafe.Union"];n.get=function(e){return function(){return function(n){return function(o){return r.unsafeGet(t.reflectSymbol(e)(n))(o)}}}},n.set=function(e){return function(){return function(){return function(n){return function(o){return function(a){return r.unsafeSet(t.reflectSymbol(e)(n))(o)(a)}}}}}},n.insert=function(e){return function(){return function(){return function(n){return function(o){return function(a){return r.unsafeSet(t.reflectSymbol(e)(n))(o)(a)}}}}}},n.delete=function(e){return function(){return function(){return function(n){return function(o){return r.unsafeDelete(t.reflectSymbol(e)(n))(o)}}}}},n.merge=function(){return function(){return function(e){return function(n){return o.unsafeUnionFn(e,n)}}}}}(c),function(e){"use strict";e.typeOf=function(e){return typeof e},e.tagOf=function(e){return Object.prototype.toString.call(e).slice(8,-1)}}(c.Foreign=c.Foreign||{}),function(e){"use strict";e.pureE=function(e){return function(){return e}},e.bindE=function(e){return function(n){return function(){return n(e())()}}}}(c.Effect=c.Effect||{}),function(e){"use strict";e.Effect=e.Effect||{};var n=e.Effect,t=e.Effect,r=e["Control.Applicative"],o=e["Control.Monad"],a={Applicative0:function(){return c},Bind1:function(){return u}},u={bind:t.bindE,Apply0:function(){return i}},i={apply:o.ap(a),Functor0:function(){return l}},c={pure:t.pureE,Apply0:function(){return i}},l={map:r.liftA1(c)};n.functorEffect=l,n.applyEffect=i,n.applicativeEffect=c,n.bindEffect=u,n.monadEffect=a}(c),function(e){"use strict";e.showErrorImpl=function(e){return e.stack||e.toString()},e.error=function(e){return new Error(e)},e.message=function(e){return e.message},e.throwException=function(e){return function(){throw e}},e.catchException=function(e){return function(n){return function(){try{return n()}catch(n){return n instanceof Error||"[object Error]"===Object.prototype.toString.call(n)?e(n)():e(new Error(n.toString()))()}}}}}(c["Effect.Exception"]=c["Effect.Exception"]||{}),function(e){"use strict";e["Effect.Exception"]=e["Effect.Exception"]||{};var n=e["Effect.Exception"],t=e["Effect.Exception"],r=e["Control.Applicative"],o=e["Data.Either"],a=e["Data.Functor"],u=e.Effect,i={show:t.showErrorImpl};n.throw=function(e){return t.throwException(t.error(e))},n.try=function(e){return t.catchException((n=r.pure(u.applicativeEffect),function(e){return n(o.Left.create(e))}))(a.map(u.functorEffect)(o.Right.create)(e));var n},n.showError=i,n.error=t.error,n.message=t.message,n.throwException=t.throwException,n.catchException=t.catchException}(c),function(e){"use strict";e["Control.Monad.Error.Class"]=e["Control.Monad.Error.Class"]||{};var n=e["Control.Monad.Error.Class"],t=e["Control.Applicative"],r=e["Data.Either"],o=e["Data.Function"],a=e["Data.Functor"],u=e["Data.Maybe"],i=e.Effect,c=e["Effect.Exception"],l=function(e){return e.throwError},s={throwError:r.Left.create,Monad0:function(){return r.monadEither}},f={throwError:c.throwException,Monad0:function(){return i.monadEffect}},d={catchError:function(e){return function(n){if(e instanceof r.Left)return n(e.value0);if(e instanceof r.Right)return new r.Right(e.value0);throw new Error("Failed pattern match at Control.Monad.Error.Class (line 72, column 1 - line 74, column 35): "+[e.constructor.name,n.constructor.name])}},MonadThrow0:function(){return s}},v={catchError:o.flip(c.catchException),MonadThrow0:function(){return f}},m=function(e){return e.catchError};n.catchError=m,n.throwError=l,n.try=function(e){return function(n){return m(e)(a.map(e.MonadThrow0().Monad0().Bind1().Apply0().Functor0())(r.Right.create)(n))((o=t.pure(e.MonadThrow0().Monad0().Applicative0()),function(e){return o(r.Left.create(e))}));var o}},n.liftMaybe=function(e){return function(n){return u.maybe(l(e)(n))(t.pure(e.Monad0().Applicative0()))}},n.liftEither=function(e){return r.either(l(e))(t.pure(e.Monad0().Applicative0()))},n.monadThrowEither=s,n.monadErrorEither=d,n.monadThrowEffect=f,n.monadErrorEffect=v}(c),function(e){"use strict";e["Control.Monad.Reader.Class"]=e["Control.Monad.Reader.Class"]||{};var n=e["Control.Monad.Reader.Class"],t=e["Data.Functor"],r=function(e){return e.ask};n.ask=r,n.asks=function(e){return function(n){return t.map(e.Monad0().Bind1().Apply0().Functor0())(n)(r(e))}}}(c),function(e){"use strict";e["Control.Monad.State.Class"]=e["Control.Monad.State.Class"]||{};var n=e["Control.Monad.State.Class"],t=e["Data.Tuple"],r=e["Data.Unit"],o=function(e){return e.state};n.state=o,n.get=function(e){return o(e)((function(e){return new t.Tuple(e,e)}))},n.gets=function(e){return function(n){return o(e)((function(e){return new t.Tuple(n(e),e)}))}},n.put=function(e){return function(n){return o(e)((function(e){return new t.Tuple(r.unit,n)}))}},n.modify=function(e){return function(n){return o(e)((function(e){var r=n(e);return new t.Tuple(r,r)}))}},n.modify_=function(e){return function(n){return o(e)((function(e){return new t.Tuple(r.unit,n(e))}))}}}(c),function(e){"use strict";e["Control.Monad.Trans.Class"]=e["Control.Monad.Trans.Class"]||{},e["Control.Monad.Trans.Class"].lift=function(e){return e.lift}}(c),function(e){"use strict";e["Effect.Class"]=e["Effect.Class"]||{};var n=e["Effect.Class"],t=e["Control.Category"],r=e.Effect,o={liftEffect:t.identity(t.categoryFn),Monad0:function(){return r.monadEffect}};n.liftEffect=function(e){return e.liftEffect},n.monadEffectEffect=o}(c),function(e){"use strict";e["Control.Monad.Except.Trans"]=e["Control.Monad.Except.Trans"]||{};var n=e["Control.Monad.Except.Trans"],t=e["Control.Applicative"],r=e["Control.Apply"],o=e["Control.Bind"],a=e["Control.Monad"],u=e["Control.Monad.Reader.Class"],i=e["Control.Monad.State.Class"],c=e["Control.Monad.Trans.Class"],l=e["Data.Either"],s=e["Data.Functor"],f=e["Data.Monoid"],d=e["Data.Semigroup"],v=e["Effect.Class"],m={lift:function(e){return function(n){return o.bind(e.Bind1())(n)((function(n){return t.pure(e.Applicative0())(new l.Right(n))}))}}},p=function(e){return function(n){return e(n)}},g=function(e){return{map:function(n){return p(s.map(e)(s.map(l.functorEither)(n)))}}},y=function(e){return{Applicative0:function(){return C(e)},Bind1:function(){return b(e)}}},b=function(e){return{bind:function(n){return function(r){return o.bind(e.Bind1())(n)(l.either((a=t.pure(e.Applicative0()),function(e){return a(l.Left.create(e))}))((function(e){return r(e)})));var a}},Apply0:function(){return w(e)}}},w=function(e){return{apply:a.ap(y(e)),Functor0:function(){return g(e.Bind1().Apply0().Functor0())}}},C=function(e){return{pure:(n=t.pure(e.Applicative0()),function(e){return n(l.Right.create(e))}),Apply0:function(){return w(e)}};var n},h=function(e){return{throwError:(n=t.pure(e.Applicative0()),function(e){return n(l.Left.create(e))}),Monad0:function(){return y(e)}};var n};n.ExceptT=function(e){return e},n.runExceptT=function(e){return e},n.mapExceptT=p,n.except=function(e){var n=t.pure(e);return function(e){return n(e)}},n.functorExceptT=g,n.applyExceptT=w,n.applicativeExceptT=C,n.bindExceptT=b,n.monadExceptT=y,n.altExceptT=function(e){return function(n){return{alt:function(r){return function(a){return o.bind(n.Bind1())(r)((function(r){if(r instanceof l.Right)return t.pure(n.Applicative0())(new l.Right(r.value0));if(r instanceof l.Left)return o.bind(n.Bind1())(a)((function(o){if(o instanceof l.Right)return t.pure(n.Applicative0())(new l.Right(o.value0));if(o instanceof l.Left)return t.pure(n.Applicative0())(new l.Left(d.append(e)(r.value0)(o.value0)));throw new Error("Failed pattern match at Control.Monad.Except.Trans (line 87, column 9 - line 89, column 49): "+[o.constructor.name])}));throw new Error("Failed pattern match at Control.Monad.Except.Trans (line 83, column 5 - line 89, column 49): "+[r.constructor.name])}))}},Functor0:function(){return g(n.Bind1().Apply0().Functor0())}}}},n.monadTransExceptT=m,n.monadEffectExceptT=function(e){return{liftEffect:(n=c.lift(m)(e.Monad0()),t=v.liftEffect(e),function(e){return n(t(e))}),Monad0:function(){return y(e.Monad0())}};var n,t},n.monadThrowExceptT=h,n.monadErrorExceptT=function(e){return{catchError:function(n){return function(r){return o.bind(e.Bind1())(n)(l.either((function(e){return r(e)}))((a=t.pure(e.Applicative0()),function(e){return a(l.Right.create(e))})));var a}},MonadThrow0:function(){return h(e)}}},n.monadAskExceptT=function(e){return{ask:c.lift(m)(e.Monad0())(u.ask(e)),Monad0:function(){return y(e.Monad0())}}},n.monadStateExceptT=function(e){return{state:function(n){return c.lift(m)(e.Monad0())(i.state(e)(n))},Monad0:function(){return y(e.Monad0())}}},n.monoidExceptT=function(e){return function(n){return{mempty:t.pure(C(e))(f.mempty(n)),Semigroup0:function(){return function(e){return function(n){return{append:r.lift2(w(e))(d.append(n))}}}(e)(n.Semigroup0())}}}}}(c),function(e){"use strict";e["Data.NonEmpty"]=e["Data.NonEmpty"]||{};var n=e["Data.NonEmpty"],t=e["Control.Plus"],r=e["Data.Foldable"],o=e["Data.Functor"],a=e["Data.Semigroup"],u=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}();n.NonEmpty=u,n.singleton=function(e){return function(n){return new u(n,t.empty(e))}},n.functorNonEmpty=function(e){return{map:function(n){return function(t){return new u(n(t.value0),o.map(e)(n)(t.value1))}}}},n.foldableNonEmpty=function(e){return{foldMap:function(n){return function(t){return function(o){return a.append(n.Semigroup0())(t(o.value0))(r.foldMap(e)(n)(t)(o.value1))}}},foldl:function(n){return function(t){return function(o){return r.foldl(e)(n)(n(t)(o.value0))(o.value1)}}},foldr:function(n){return function(t){return function(o){return n(o.value0)(r.foldr(e)(n)(t)(o.value1))}}}}}}(c),function(e){"use strict";e["Data.List.Types"]=e["Data.List.Types"]||{};var n,t=e["Data.List.Types"],r=e["Control.Applicative"],o=e["Control.Apply"],a=e["Control.Bind"],u=e["Control.Category"],i=e["Data.Eq"],c=e["Data.Foldable"],l=e["Data.Function"],s=e["Data.Functor"],f=e["Data.Maybe"],d=e["Data.Monoid"],v=e["Data.NonEmpty"],m=e["Data.Ord"],p=e["Data.Ordering"],g=e["Data.Semigroup"],y=e["Data.Traversable"],b=function(){function e(){}return e.value=new e,e}(),w=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),C={map:function(e){var n;return n=b.value,function(t){var r,o=n,a=!1;function u(n,r){return r instanceof w&&r.value1 instanceof w&&r.value1.value1 instanceof w?(o=new w(r,n),void(t=r.value1.value1.value1)):(a=!0,(i=n,function(n){for(var t,r,o,a=i,u=!1;!u;)o=n,t=(r=a)instanceof w&&r.value0 instanceof w&&r.value0.value1 instanceof w&&r.value0.value1.value1 instanceof w?(a=r.value1,void(n=new w(e(r.value0.value0),new w(e(r.value0.value1.value0),new w(e(r.value0.value1.value1.value0),o))))):(u=!0,o);return t})((u=r)instanceof w&&u.value1 instanceof w&&u.value1.value1 instanceof b?new w(e(u.value0),new w(e(u.value1.value0),b.value)):u instanceof w&&u.value1 instanceof b?new w(e(u.value0),b.value):b.value));var u,i}for(;!a;)r=u(o,t);return r}}},h=v.functorNonEmpty(C),A={foldr:function(e){return function(n){var t,r=(t=b.value,function(e){var n,r=t,o=!1;function a(n,t){if(t instanceof b)return o=!0,n;if(t instanceof w)return r=new w(t.value0,n),void(e=t.value1);throw new Error("Failed pattern match at Data.List.Types (line 108, column 7 - line 108, column 23): "+[n.constructor.name,t.constructor.name])}for(;!o;)n=a(r,e);return n}),o=c.foldl(A)(l.flip(e))(n);return function(e){return o(r(e))}}},foldl:function(e){return function(n){return function(t){var r,o=n,a=!1;function u(n,r){if(r instanceof b)return a=!0,n;if(r instanceof w)return o=e(n)(r.value0),void(t=r.value1);throw new Error("Failed pattern match at Data.List.Types (line 112, column 12 - line 114, column 30): "+[r.constructor.name])}for(;!a;)r=u(o,t);return r}}},foldMap:function(e){return function(n){return c.foldl(A)((function(t){var r=g.append(e.Semigroup0())(t);return function(e){return r(n(e))}}))(d.mempty(e))}}},S=v.foldableNonEmpty(A),I={append:function(e){return function(n){return c.foldr(A)(w.create)(n)(e)}}},T={mempty:b.value,Semigroup0:function(){return I}},D={append:function(e){return function(n){return new v.NonEmpty(e.value0,g.append(I)(e.value1)(function(e){return new w(e.value0,e.value1)}(n)))}}},F={traverse:function(e){return function(n){var t=s.map(e.Apply0().Functor0())(c.foldl(A)(l.flip(w.create))(b.value)),a=c.foldl(A)((function(t){var r=o.lift2(e.Apply0())(l.flip(w.create))(t);return function(e){return r(n(e))}}))(r.pure(e)(b.value));return function(e){return t(a(e))}}},sequence:function(e){return y.traverse(F)(e)(u.identity(u.categoryFn))},Functor0:function(){return C},Foldable1:function(){return A}},E={unfoldr1:function(e){return function(n){var t;return(t=n,function(n){var r,o=t,a=!1;function u(t,r){var u=e(t);if(u.value1 instanceof f.Just)return o=u.value1.value0,void(n=new w(u.value0,r));if(u.value1 instanceof f.Nothing)return a=!0,c.foldl(A)(l.flip(w.create))(b.value)(new w(u.value0,r));throw new Error("Failed pattern match at Data.List.Types (line 136, column 22 - line 138, column 61): "+[u.constructor.name])}for(;!a;)r=u(o,n);return r})(b.value)}}},x={unfoldr:function(e){return function(n){var t;return(t=n,function(n){var r,o=t,a=!1;function u(t,r){var u=e(t);if(u instanceof f.Nothing)return a=!0,c.foldl(A)(l.flip(w.create))(b.value)(r);if(u instanceof f.Just)return o=u.value0.value1,void(n=new w(u.value0.value0,r));throw new Error("Failed pattern match at Data.List.Types (line 143, column 22 - line 145, column 52): "+[u.constructor.name])}for(;!a;)r=u(o,n);return r})(b.value)}},Unfoldable10:function(){return E}},M={eq1:function(e){return function(n){return function(t){var r;return(r=n,function(n){return function(t){for(var o,a,u,c,l=r,s=n,f=!1;!f;)a=l,u=s,o=(c=t)?a instanceof b&&u instanceof b?(f=!0,c):a instanceof w&&u instanceof w?(l=a.value1,s=u.value1,void(t=c&&i.eq(e)(u.value0)(a.value0))):(f=!0,!1):(f=!0,!1);return o}})(t)(!0)}}}},R={compare1:function(e){return function(n){return function(t){var r;return(r=n,function(n){var t,o=r,a=!1;function u(t,r){if(t instanceof b&&r instanceof b)return a=!0,p.EQ.value;if(t instanceof b)return a=!0,p.LT.value;if(r instanceof b)return a=!0,p.GT.value;if(t instanceof w&&r instanceof w){var u=m.compare(e)(t.value0)(r.value0);return u instanceof p.EQ?(o=t.value1,void(n=r.value1)):(a=!0,u)}throw new Error("Failed pattern match at Data.List.Types (line 61, column 5 - line 61, column 20): "+[t.constructor.name,r.constructor.name])}for(;!a;)t=u(o,n);return t})(t)}}},Eq10:function(){return M}},P={apply:function(e){return function(n){if(e instanceof b)return b.value;if(e instanceof w)return g.append(I)(s.map(C)(e.value0)(n))(o.apply(P)(e.value1)(n));throw new Error("Failed pattern match at Data.List.Types (line 158, column 1 - line 160, column 48): "+[e.constructor.name,n.constructor.name])}},Functor0:function(){return C}},k={apply:function(e){return function(n){return new v.NonEmpty(e.value0(n.value0),g.append(I)(o.apply(P)(e.value1)(new w(n.value0,b.value)))(o.apply(P)(new w(e.value0,e.value1))(n.value1)))}},Functor0:function(){return h}},B={bind:function(e){return function(n){if(e instanceof b)return b.value;if(e instanceof w)return g.append(I)(n(e.value0))(a.bind(B)(e.value1)(n));throw new Error("Failed pattern match at Data.List.Types (line 165, column 1 - line 167, column 37): "+[e.constructor.name,n.constructor.name])}},Apply0:function(){return P}},N={pure:function(e){return new w(e,b.value)},Apply0:function(){return P}},L={alt:g.append(I),Functor0:function(){return C}},_={empty:b.value,Alt0:function(){return L}},U={Applicative0:function(){return N},Plus1:function(){return _}},H={pure:(n=v.singleton(_),function(e){return n(e)}),Apply0:function(){return k}};t.Nil=b,t.Cons=w,t.NonEmptyList=function(e){return e},t.ordList=function(e){return{compare:m.compare1(R)(e),Eq0:function(){return n=e.Eq0(),{eq:i.eq1(M)(n)};var n}}},t.semigroupList=I,t.monoidList=T,t.functorList=C,t.foldableList=A,t.unfoldableList=x,t.traversableList=F,t.applicativeList=N,t.bindList=B,t.plusList=_,t.alternativeList=U,t.functorNonEmptyList=h,t.applicativeNonEmptyList=H,t.semigroupNonEmptyList=D,t.foldableNonEmptyList=S}(c),function(e){"use strict";e["Data.List.NonEmpty"]=e["Data.List.NonEmpty"]||{};var n,t=e["Data.List.NonEmpty"],r=e["Data.List.Types"],o=e["Data.NonEmpty"],a=(n=o.singleton(r.plusList),function(e){return r.NonEmptyList(n(e))});t.singleton=a,t.head=function(e){return e.value0}}(c),function(e){"use strict";e.Foreign=e.Foreign||{};var n=e.Foreign,t=e.Foreign,r=e["Control.Applicative"],o=e["Control.Monad.Error.Class"],a=e["Control.Monad.Except.Trans"],u=e["Data.Boolean"],i=e["Data.List.NonEmpty"],c=e["Data.Show"],l=e["Unsafe.Coerce"],s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),d=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),v=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),m=l.unsafeCoerce,p=l.unsafeCoerce,g=function(e){if(e instanceof s)return e.value0;if(e instanceof d)return"Error at array index "+c.show(c.showInt)(e.value0)+": "+g(e.value1);if(e instanceof v)return"Error at property "+c.show(c.showString)(e.value0)+": "+g(e.value1);if(e instanceof f)return"Type mismatch: expected "+e.value0+", found "+e.value1;throw new Error("Failed pattern match at Foreign (line 73, column 1 - line 73, column 45): "+[e.constructor.name])},y=function(e){var n=o.throwError(a.monadThrowExceptT(e));return function(e){return n(i.singleton(e))}},b=function(e){return function(n){return function(o){if(t.tagOf(o)===n)return r.pure(a.applicativeExceptT(e))(p(o));if(u.otherwise)return y(e)(new f(n,t.tagOf(o)));throw new Error("Failed pattern match at Foreign (line 110, column 1 - line 110, column 71): "+[n.constructor.name,o.constructor.name])}}};n.ForeignError=s,n.renderForeignError=g,n.unsafeToForeign=m,n.unsafeReadTagged=b,n.readString=function(e){return b(e)("String")},n.fail=y,n.typeOf=t.typeOf}(c),function(e){e.undefined=void 0}(c["Literals.Undefined"]=c["Literals.Undefined"]||{}),function(e){"use strict";e["Literals.Undefined"]=e["Literals.Undefined"]||{};var n=e["Literals.Undefined"],t=e["Literals.Undefined"];n[void 0]=t[void 0]}(c),function(e){"use strict";e["Untagged.Castable"]=e["Untagged.Castable"]||{};var n=e["Untagged.Castable"],t=e["Unsafe.Coerce"];n.cast=function(){return t.unsafeCoerce}}(c),function(e){"use strict";e["Untagged.TypeCheck"]=e["Untagged.TypeCheck"]||{};var n=e["Untagged.TypeCheck"],t=e.Foreign,r={hasRuntimeType:function(e){return"string",function(e){return"string"===t.typeOf(e)}}};n.hasRuntimeType=function(e){return e.hasRuntimeType},n.hasRuntimeTypeString=r}(c),function(e){"use strict";e["Untagged.Union"]=e["Untagged.Union"]||{};var n=e["Untagged.Union"],t=e["Data.Either"],r=e["Data.Maybe"],o=e.Foreign,a=e["Literals.Undefined"],u=e["Type.Proxy"],i=e["Untagged.Castable"],c=e["Untagged.TypeCheck"],l=i.cast;n.asOneOf=l,n.toEither1=function(e){return function(e){return function(n){return function(t){return function(r){return c.hasRuntimeType(e)(u.Proxy.value)(o.unsafeToForeign(r))?n(r):t(r)}}}}(e)(t.Left.create)(t.Right.create)},n.maybeToUor=function(e){if(e instanceof r.Just)return e.value0;if(e instanceof r.Nothing)return i.cast()(a[void 0]);throw new Error("Failed pattern match at Untagged.Union (line 121, column 1 - line 121, column 49): "+[e.constructor.name])}}(c),function(e){"use strict";e.Aeson=e.Aeson||{};var n,t,r,o,a,u=e.Aeson,i=e.Aeson,c=e["Control.Alt"],l=e["Control.Applicative"],s=e["Control.Bind"],f=e["Control.Category"],d=e["Control.Lazy"],v=e["Data.Argonaut.Core"],m=e["Data.Argonaut.Decode.Error"],p=e["Data.Argonaut.Encode.Encoders"],g=e["Data.Bifunctor"],y=e["Data.BigInt"],b=e["Data.BigNumber"],w=e["Data.Either"],C=e["Data.Function"],h=e["Data.Functor"],A=e["Data.Int"],S=e["Data.Maybe"],I=e["Data.Number"],T=e["Data.Symbol"],D=e["Data.Traversable"],F=e["Data.Typelevel.Undefined"],E=e["Data.UInt"],x=e["Foreign.Object"],M=e.Record,R=e["Type.Proxy"],P=e["Untagged.Union"],k={show:i.stringifyAeson},B={gDecodeAeson:function(e){return function(e){return new w.Right({})}}},N={encodeAeson:i.fromString},L={encodeAeson:i.fromFiniteBigNumber},_={encodeAeson:f.identity(f.categoryFn)},U={decodeAeson:l.pure(w.applicativeEither)},H=function(e){return e(S.Nothing.value)(S.Just.create)},q=function(e){return w.note(new m.TypeMismatch("JSON String"))(i.parseAeson(S.Nothing.value)(S.Just.create)(e))},O={gEncodeAeson:function(e){return function(e){return x.empty}}},V=function(e){return e.gEncodeAeson},W=function(e){return e.gDecodeAeson},K={encodeAeson:function(e){return i.fromFiniteBigNumber(b.fromUInt(e))}},z=function(e){return e.encodeAeson},J={encodeAeson:(t=w.fromRight(F[void 0]),r=h.map(w.functorEither)((n=z(L),function(e){return n(e)})),function(e){return t(r(b.parseBigNumber(y.toString(e))))})},G=function(e){return{encodeAeson:(n=h.map(h.functorArray)(z(e)),function(e){return i.fromArray(n(e))})};var n},j=function(e){return{encodeAeson:function(n){return i.fromObject(h.map(x.functorObject)(z(e))(n))}}},Q=function(e){return e.decodeAeson},Z=function(e){var n=C.const(e);return{caseObject:n,caseNull:n,caseBoolean:n,caseString:n,caseFiniteBigNumber:n,caseArray:n}},X=function(e){return function(n){return i._caseAeson(e.caseNull)(e.caseBoolean)(e.caseFiniteBigNumber)(e.caseString)(e.caseArray)(e.caseObject)(n)}},Y=function(e){return function(n){return X({caseArray:n,caseBoolean:(t=Z(e)).caseBoolean,caseFiniteBigNumber:t.caseFiniteBigNumber,caseNull:t.caseNull,caseObject:t.caseObject,caseString:t.caseString});var t}},$={decodeAeson:(o=new w.Left(new m.TypeMismatch("Boolean")),function(e){return X({caseBoolean:e,caseArray:(n=Z(o)).caseArray,caseFiniteBigNumber:n.caseFiniteBigNumber,caseNull:n.caseNull,caseObject:n.caseObject,caseString:n.caseString});var n})(w.Right.create)},ee=function(e){return function(n){return X({caseFiniteBigNumber:n,caseArray:(t=Z(e)).caseArray,caseBoolean:t.caseBoolean,caseNull:t.caseNull,caseObject:t.caseObject,caseString:t.caseString});var t}},ne=function(e){return function(n){return ee(e)((function(e){return n(e)}))}},te=function(e){return function(n){var t=S.maybe(e)(n),r=ne(S.Nothing.value)((function(e){return b.isInteger(e)?y.fromString(b.toFixed(e)):S.Nothing.value}));return function(e){return t(r(e))}}},re={decodeAeson:te(new w.Left(new m.TypeMismatch("BigInt")))(w.Right.create)},oe=function(e){return function(n){return function(e){return function(n){return ne(e)((t=S.maybe(e)(n),function(e){return t((n=b.toNumber(e),I.isFinite(n)&&!I.isNaN(n)?new S.Just(n):S.Nothing.value));var n}));var t}}(e)((function(e){return n(e)}))}},ae=(H(oe),{decodeAeson:oe(new w.Left(new m.TypeMismatch("Number")))(w.Right.create)}),ue={decodeAeson:function(e){return function(n){var t=S.maybe(e)(n),r=ne(S.Nothing.value)((function(e){return b.isInteger(e)?A.fromNumber(b.toNumber(e)):S.Nothing.value}));return function(e){return t(r(e))}}}(new w.Left(new m.TypeMismatch("Int")))(w.Right.create)},ie={decodeAeson:function(e){return function(n){var t=S.maybe(e)(n),r=ne(S.Nothing.value)((function(e){return b.isInteger(e)?E["fromNumber'"](b.toNumber(e)):S.Nothing.value}));return function(e){return t(r(e))}}}(new w.Left(new m.TypeMismatch("UInt")))(w.Right.create)},ce={decodeAeson:ee(new w.Left(new m.TypeMismatch("Finite BigNumber")))(w.Right.create)},le=(a=function(e){return function(n){return X({caseNull:n,caseArray:(t=Z(e)).caseArray,caseBoolean:t.caseBoolean,caseFiniteBigNumber:t.caseFiniteBigNumber,caseObject:t.caseObject,caseString:t.caseString});var t}},a(!1)(C.const(!0))),se=function(e){return function(n){return X({caseObject:n,caseArray:(t=Z(e)).caseArray,caseBoolean:t.caseBoolean,caseFiniteBigNumber:t.caseFiniteBigNumber,caseNull:t.caseNull,caseString:t.caseString});var t}},fe=function(e){return function(n){return X({caseString:n,caseArray:(t=Z(e)).caseArray,caseBoolean:t.caseBoolean,caseFiniteBigNumber:t.caseFiniteBigNumber,caseNull:t.caseNull,caseObject:t.caseObject});var t}},de=H(fe),ve={decodeAeson:fe(new w.Left(new m.TypeMismatch("String")))(w.Right.create)},me=d.defer(d.lazyFn)((function(e){return X({caseNull:C.const(v.jsonNull),caseBoolean:p.encodeBoolean,caseFiniteBigNumber:function(e){return p.encodeString(b.toString(e))},caseString:p.encodeString,caseArray:(t=h.map(h.functorArray)(me),function(e){return v.fromArray(t(e))}),caseObject:(n=h.map(x.functorObject)(me),function(e){return v.fromObject(n(e))})});var n,t})),pe=function(e){return{decodeAeson:function(n){var t=function(e){return function(t){return h.map(w.functorEither)(S.Just.create)(Q(e)(n))}};return X({caseNull:C.const(new w.Right(S.Nothing.value)),caseBoolean:t(e),caseFiniteBigNumber:t(e),caseString:t(e),caseArray:t(e),caseObject:t(e)})(n)}}};u.unpackFinite=function(e){return e},u.caseAesonArray=Y,u.caseAesonBigInt=te,u.caseAesonObject=se,u.caseAesonString=fe,u.decodeAeson=Q,u.decodeJsonString=function(e){return s.composeKleisli(w.bindEither)(q)(Q(e))},u.encodeAeson=z,u.getField=function(e){return function(n){return function(t){var r;return(r=Q(e),function(e){return function(n){return S.maybe(new w.Left(new m.AtKey(n,m.MissingValue.value)))((t=g.lmap(g.bifunctorEither)(m.AtKey.create(n)),function(e){return t(r(e))}))(x.lookup(n)(e));var t}})(n)(t)}}},u.getFieldOptional=function(e){var n;return n=Q(e),function(e){return function(t){var r,o,a=(r=g.lmap(g.bifunctorEither)(m.AtKey.create(t)),function(e){return r(n(e))});return S.maybe(l.pure(w.applicativeEither)(S.Nothing.value))((o=h.map(w.functorEither)(S.Just.create),function(e){return o(a(e))}))(x.lookup(t)(e))}}},u["getFieldOptional'"]=function(e){var n;return n=Q(e),function(e){return function(t){return S.maybe(l.pure(w.applicativeEither)(S.Nothing.value))((function(e){return le(e)?l.pure(w.applicativeEither)(S.Nothing.value):h.map(w.functorEither)(S.Just.create)(g.lmap(g.bifunctorEither)(m.AtKey.create(t))(n(e)))}))(x.lookup(t)(e))}}},u.parseJsonStringToAeson=q,u.isNull=le,u.toString=de,u.toStringifiedNumbersJson=me,u.showAeson=k,u.decodeAesonUInt=ie,u.decodeAesonInt=ue,u.decodeAesonBigInt=re,u.decodeAesonNumber=ae,u.decodeAesonFiniteBigNumbe=ce,u.decodeAesonBoolean=$,u.decodeAesonString=ve,u.decodeAesonAeson=U,u.decodeAesonObject=function(e){return{decodeAeson:se(new w.Left(new m.TypeMismatch("Object")))(D.traverse(x.traversableObject)(w.applicativeEither)(Q(e)))}},u.decodeAesonRecord=function(e){return function(){return{decodeAeson:se(new w.Left(new m.TypeMismatch("Record")))((function(n){return W(e)(n)(R.Proxy.value)}))}}},u["decodeAeson|+|"]=function(){return function(e){return function(n){return{decodeAeson:function(t){return c.alt(w.altEither)(h.map(w.functorEither)(P.asOneOf())(Q(e)(t)))(h.map(w.functorEither)(P.asOneOf())(Q(n)(t)))}}}}},u.decodeAesonArray=function(e){return{decodeAeson:Y(new w.Left(new m.TypeMismatch("Array")))(D.traverse(D.traversableArray)(w.applicativeEither)(Q(e)))}},u.decodeAesonMaybe=pe,u.gDecodeAesonRowNil=B,u.gDecodeAesonCons=function(e){return function(n){return function(t){return function(){return function(){return{gDecodeAeson:function(r){return function(o){var a=T.reflectSymbol(t)(R.Proxy.value),u=x.lookup(a)(r),i=e.decodeAesonField(u);if(i instanceof S.Just)return s.bind(w.bindEither)(g.lmap(g.bifunctorEither)(m.AtKey.create(a))(i.value0))((function(e){return s.bind(w.bindEither)(W(n)(r)(R.Proxy.value))((function(n){return new w.Right(M.insert(t)()()(R.Proxy.value)(e)(n))}))}));if(i instanceof S.Nothing)return new w.Left(new m.AtKey(a,m.MissingValue.value));throw new Error("Failed pattern match at Aeson (line 718, column 5 - line 725, column 44): "+[i.constructor.name])}}}}}}}},u.decodeAesonFieldMaybe=function(e){return{decodeAesonField:(n=S.maybe(new w.Right(S.Nothing.value))(Q(pe(e))),function(e){return S.Just.create(n(e))})};var n},u.decodeAesonField1=function(e){return{decodeAesonField:function(n){return h.map(S.functorMaybe)(Q(e))(n)}}},u.encodeAesonBigInt=J,u.encodeAesonUInt=K,u.encodeAesonString=N,u.encodeAesonAeson=_,u.encodeAesonObject=j,u.encodeAesonRecord=function(e){return function(){return{encodeAeson:function(n){return z(j(_))(V(e)(n)(R.Proxy.value))}}}},u.encodeAesonArray=G,u.encodeTupleAuxTuple=function(e){return function(n){return{tupleToArray:function(t){return[z(e)(t.value0),z(n)(t.value1)]}}}},u.encodeAesonTuple=function(e){return{encodeAeson:(n=z(G(_)),t=e.tupleToArray,function(e){return n(t(e))})};var n,t},u.encodeAesonMaybe=function(e){return{encodeAeson:function(n){if(n instanceof S.Nothing)return i.aesonNull;if(n instanceof S.Just)return z(e)(n.value0);throw new Error("Failed pattern match at Aeson (line 845, column 1 - line 847, column 39): "+[n.constructor.name])}}},u.gEncodeAesonNil=O,u.gEncodeAesonCons=function(e){return function(n){return function(t){return function(){return{gEncodeAeson:function(r){return function(o){return x.insert(T.reflectSymbol(t)(R.Proxy.value))(z(e)(M.get(t)()(R.Proxy.value)(r)))(V(n)(r)(R.Proxy.value))}}}}}}},u.stringifyAeson=i.stringifyAeson}(c),function(n){"use strict";var r;n._ajax=(r={},!e.require||void 0!==a&&a.versions.electron?(r.newXHR=function(){return new XMLHttpRequest},r.fixupUrl=function(e){return e||"/"},r.getResponse=function(e){return e.response}):(r.newXHR=function(){return new(t(6473))},r.fixupUrl=function(e,n){if(null===n.nodejsBaseUrl){var r=t(5214),o=r.parse(e);return o.protocol=o.protocol||"http:",o.hostname=o.hostname||"localhost",r.format(o)}return e||"/"},r.getResponse=function(e){return e.response}),function(e,n,t,o){return function(a,u){var i=r.newXHR(),c=r.fixupUrl(o.url,i);if(i.open(o.method||"GET",c,!0,o.username,o.password),o.headers)try{for(var l,s=0;null!=(l=o.headers[s]);s++)i.setRequestHeader(l.field,l.value)}catch(e){a(e)}var f=function(e){return function(){a(new Error(e))}};return i.onerror=f(n),i.ontimeout=f(e),i.onload=function(){u({status:i.status,statusText:i.statusText,headers:i.getAllResponseHeaders().split("\r\n").filter((function(e){return e.length>0})).map((function(e){var n=e.indexOf(":");return t(e.substring(0,n))(e.substring(n+2))})),body:r.getResponse(i)})},i.responseType=o.responseType,i.withCredentials=o.withCredentials,i.timeout=o.timeout,i.send(o.content),function(e,n,t){try{i.abort()}catch(e){return n(e)}return t()}}})}(c.Affjax=c.Affjax||{}),function(e){"use strict";e["Data.MediaType.Common"]=e["Data.MediaType.Common"]||{};var n=e["Data.MediaType.Common"];n.applicationFormURLEncoded="application/x-www-form-urlencoded",n.applicationJSON="application/json"}(c),function(e){"use strict";e["Affjax.RequestBody"]=e["Affjax.RequestBody"]||{};var n=e["Affjax.RequestBody"],t=e["Data.Maybe"],r=e["Data.MediaType.Common"],o=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),a=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),u=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),i=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f=i.create;n.ArrayView=o,n.Blob=a,n.Document=u,n.String=i,n.FormData=c,n.FormURLEncoded=l,n.Json=s,n.arrayView=function(e){return new o((function(n){return n(e)}))},n.string=f,n.toMediaType=function(e){return e instanceof l?new t.Just(r.applicationFormURLEncoded):e instanceof s?new t.Just(r.applicationJSON):t.Nothing.value}}(c),function(e){"use strict";e["Affjax.RequestHeader"]=e["Affjax.RequestHeader"]||{};var n=e["Affjax.RequestHeader"],t=e["Data.Newtype"],r=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),o=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),a=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}();n.Accept=r,n.ContentType=o,n.RequestHeader=a,n.name=function(e){if(e instanceof r)return"Accept";if(e instanceof o)return"Content-Type";if(e instanceof a)return e.value0;throw new Error("Failed pattern match at Affjax.RequestHeader (line 21, column 1 - line 21, column 32): "+[e.constructor.name])},n.value=function(e){if(e instanceof r)return t.unwrap()(e.value0);if(e instanceof o)return t.unwrap()(e.value0);if(e instanceof a)return e.value1;throw new Error("Failed pattern match at Affjax.RequestHeader (line 26, column 1 - line 26, column 33): "+[e.constructor.name])}}(c),function(e){"use strict";e["Affjax.ResponseFormat"]=e["Affjax.ResponseFormat"]||{};var n=e["Affjax.ResponseFormat"],t=e["Control.Category"],r=e["Data.Maybe"],o=e["Data.MediaType.Common"],a=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),u=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),i=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f=new l(t.identity(t.categoryFn)),d=new s(t.identity(t.categoryFn));n.ArrayBuffer=a,n.Blob=u,n.Document=i,n.Json=c,n.String=l,n.Ignore=s,n.string=f,n.ignore=d,n.toResponseType=function(e){if(e instanceof a)return"arraybuffer";if(e instanceof u)return"blob";if(e instanceof i)return"document";if(e instanceof c)return"text";if(e instanceof l)return"text";if(e instanceof s)return"";throw new Error("Failed pattern match at Affjax.ResponseFormat (line 44, column 3 - line 50, column 19): "+[e.constructor.name])},n.toMediaType=function(e){return e instanceof c?new r.Just(o.applicationJSON):r.Nothing.value}}(c),function(e){"use strict";e["Affjax.ResponseHeader"]=e["Affjax.ResponseHeader"]||{};var n=e["Affjax.ResponseHeader"],t=e["Data.Show"],r=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),o={show:function(e){return"(ResponseHeader "+t.show(t.showString)(e.value0)+" "+t.show(t.showString)(e.value1)+")"}};n.ResponseHeader=r,n.showResponseHeader=o}(c),function(e){"use strict";e["Control.Monad.Except"]=e["Control.Monad.Except"]||{};var n,t=e["Control.Monad.Except"],r=e["Control.Monad.Except.Trans"],o=e["Data.Newtype"],a=(n=o.unwrap(),function(e){return n(r.runExceptT(e))});t.runExcept=a}(c),function(e){"use strict";e._jsonParser=function(e,n,t){try{return n(JSON.parse(t))}catch(n){return e(n.message)}}}(c["Data.Argonaut.Parser"]=c["Data.Argonaut.Parser"]||{}),function(e){"use strict";e["Data.Argonaut.Parser"]=e["Data.Argonaut.Parser"]||{};var n=e["Data.Argonaut.Parser"],t=e["Data.Argonaut.Parser"],r=e["Data.Either"];n.jsonParser=function(e){return t._jsonParser(r.Left.create,r.Right.create,e)}}(c),function(e){"use strict";e.replaceAll=function(e){return function(n){return function(t){return t.replace(new RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}}},e.split=function(e){return function(n){return n.split(e)}},e.joinWith=function(e){return function(n){return n.join(e)}}}(c["Data.String.Common"]=c["Data.String.Common"]||{}),function(e){"use strict";e["Data.String.Common"]=e["Data.String.Common"]||{};var n=e["Data.String.Common"],t=e["Data.String.Common"];n.null=function(e){return""===e},n.replaceAll=t.replaceAll,n.split=t.split,n.joinWith=t.joinWith}(c),function(e){"use strict";e._encodeFormURLComponent=function(e,n,t){try{return n(function(e){return e.replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16)}))}(encodeURIComponent(t)).replace(/%20/g,"+"))}catch(n){return e(n)}}}(c.JSURI=c.JSURI||{}),function(e){"use strict";e.JSURI=e.JSURI||{};var n=e.JSURI,t=e.JSURI,r=e["Data.Function"],o=e["Data.Function.Uncurried"],a=e["Data.Maybe"],u=o.runFn3(t._encodeFormURLComponent)(r.const(a.Nothing.value))(a.Just.create);n.encodeFormURLComponent=u}(c),function(e){"use strict";e["Data.FormURLEncoded"]=e["Data.FormURLEncoded"]||{};var n,t,r=e["Data.FormURLEncoded"],o=e["Control.Apply"],a=e["Data.Functor"],u=e["Data.Maybe"],i=e["Data.String.Common"],c=e["Data.Traversable"],l=e.JSURI,s=(n=a.map(u.functorMaybe)(i.joinWith("&")),t=c.traverse(c.traversableArray)(u.applicativeMaybe)((function(e){if(e.value1 instanceof u.Nothing)return l.encodeFormURLComponent(e.value0);if(e.value1 instanceof u.Just)return o.apply(u.applyMaybe)(a.map(u.functorMaybe)((function(e){return function(n){return e+"="+n}}))(l.encodeFormURLComponent(e.value0)))(l.encodeFormURLComponent(e.value1.value0));throw new Error("Failed pattern match at Data.FormURLEncoded (line 37, column 18 - line 39, column 116): "+[e.constructor.name])})),function(e){return n(t(e))});r.encode=s}(c),function(e){"use strict";e["Data.HTTP.Method"]=e["Data.HTTP.Method"]||{};var n=e["Data.HTTP.Method"],t=e["Data.Either"],r=e["Data.Show"],o=function(){function e(){}return e.value=new e,e}(),a=function(){function e(){}return e.value=new e,e}(),u=function(){function e(){}return e.value=new e,e}(),i=function(){function e(){}return e.value=new e,e}(),c=function(){function e(){}return e.value=new e,e}(),l=function(){function e(){}return e.value=new e,e}(),s=function(){function e(){}return e.value=new e,e}(),f=function(){function e(){}return e.value=new e,e}(),d=function(){function e(){}return e.value=new e,e}(),v=function(){function e(){}return e.value=new e,e}(),m=function(){function e(){}return e.value=new e,e}(),p=function(){function e(){}return e.value=new e,e}(),g=function(){function e(){}return e.value=new e,e}(),y=function(){function e(){}return e.value=new e,e}(),b=function(){function e(){}return e.value=new e,e}(),w=function(){function e(){}return e.value=new e,e}(),C={show:function(e){if(e instanceof o)return"OPTIONS";if(e instanceof a)return"GET";if(e instanceof u)return"HEAD";if(e instanceof i)return"POST";if(e instanceof c)return"PUT";if(e instanceof l)return"DELETE";if(e instanceof s)return"TRACE";if(e instanceof f)return"CONNECT";if(e instanceof d)return"PROPFIND";if(e instanceof v)return"PROPPATCH";if(e instanceof m)return"MKCOL";if(e instanceof p)return"COPY";if(e instanceof g)return"MOVE";if(e instanceof y)return"LOCK";if(e instanceof b)return"UNLOCK";if(e instanceof w)return"PATCH";throw new Error("Failed pattern match at Data.HTTP.Method (line 43, column 1 - line 59, column 23): "+[e.constructor.name])}},h=t.either(r.show(C))((function(e){return e}));n.GET=a,n.POST=i,n.print=h}(c),function(e){"use strict";e["Data.Identity"]=e["Data.Identity"]||{};var n=e["Data.Identity"],t={map:function(e){return function(n){return e(n)}}},r={apply:function(e){return function(n){return e(n)}},Functor0:function(){return t}},o={bind:function(e){return function(n){return n(e)}},Apply0:function(){return r}},a={pure:function(e){return e},Apply0:function(){return r}},u={Applicative0:function(){return a},Bind1:function(){return o}};n.functorIdentity=t,n.monadIdentity=u}(c),function(e){"use strict";e.null=null,e.notNull=function(e){return e}}(c["Data.Nullable"]=c["Data.Nullable"]||{}),function(e){"use strict";e["Data.Nullable"]=e["Data.Nullable"]||{};var n=e["Data.Nullable"],t=e["Data.Nullable"],r=e["Data.Maybe"].maybe(t.null)(t.notNull);n.toNullable=r}(c),function(e){"use strict";var n=function(){var e={},n="Pure",t="Throw",r="Catch",o="Sync",a="Async",u="Bind",i="Bracket",c="Fork",l="Sequential",s="Map",f="Apply",d="Alt",v="Cons",m="Resume",p="Release",g="Finalizer",y="Finalized",b="Forked";function w(e,n,t,r){this.tag=e,this._1=n,this._2=t,this._3=r}function C(e){var n=function(n,t,r){return new w(e,n,t,r)};return n.tag=e,n}function h(e){return new w(n,void 0)}function A(e){try{e()}catch(e){setTimeout((function(){throw e}),0)}}function S(e,n,t){try{return n(t())}catch(n){return e(n)}}function I(e,n,t){try{return n(t)()}catch(n){return t(e(n))(),h}}var T=function(){var e=1024,n=0,t=0,r=new Array(e),o=!1;function a(){var a;for(o=!0;0!==n;)n--,a=r[t],r[t]=void 0,t=(t+1)%e,a();o=!1}return{isDraining:function(){return o},enqueue:function(u){var i;n===e&&(i=o,a(),o=i),r[(t+n)%e]=u,n++,o||a()}}}();function D(e,s,f){var d=0,b=0,C=f,h=null,F=null,x=null,M=null,R=null,P=0,k=0,B=null,N=!0;function L(f){for(var k,_,U;;)switch(k=null,_=null,U=null,b){case 2:b=1;try{C=x(C),null===M?x=null:(x=M._1,M=M._2)}catch(n){b=5,h=e.left(n),C=null}break;case 3:e.isLeft(C)?(b=5,h=C,C=null):null===x?b=5:(b=2,C=e.fromRight(C));break;case 1:switch(C.tag){case u:x&&(M=new w(v,x,M)),x=C._2,b=1,C=C._1;break;case n:null===x?(b=5,C=e.right(C._1)):(b=2,C=C._1);break;case o:b=3,C=S(e.left,e.right,C._1);break;case a:return b=4,void(C=I(e.left,C._1,(function(e){return function(){d===f&&(d++,T.enqueue((function(){d===f+1&&(b=3,C=e,L(d))})))}})));case t:b=5,h=e.left(C._1),C=null;break;case r:R=new w(v,C,null===x?R:new w(v,new w(m,x,M),R,F),F),x=null,M=null,b=1,C=C._1;break;case i:P++,R=new w(v,C,null===x?R:new w(v,new w(m,x,M),R,F),F),x=null,M=null,b=1,C=C._1;break;case c:b=3,k=D(e,s,C._2),s&&s.register(k),C._1&&k.run(),C=e.right(k);break;case l:b=1,C=E(e,s,C._1)}break;case 5:if(x=null,M=null,null===R)b=6,C=F||h||C;else switch(k=R._3,U=R._1,R=R._2,U.tag){case r:F&&F!==k&&0===P?b=5:h&&(b=1,C=U._2(e.fromLeft(h)),h=null);break;case m:F&&F!==k&&0===P||h?b=5:(x=U._1,M=U._2,b=2,C=e.fromRight(C));break;case i:P--,null===h&&(_=e.fromRight(C),R=new w(v,new w(p,U._2,_),R,k),(F===k||P>0)&&(b=1,C=U._3(_)));break;case p:R=new w(v,new w(y,C,h),R,F),b=1,C=F&&F!==k&&0===P?U._1.killed(e.fromLeft(F))(U._2):h?U._1.failed(e.fromLeft(h))(U._2):U._1.completed(e.fromRight(C))(U._2),h=null,P++;break;case g:P++,R=new w(v,new w(y,C,h),R,F),b=1,C=U._1;break;case y:P--,b=5,C=U._1,h=U._2}break;case 6:for(var H in B)B.hasOwnProperty(H)&&(N=N&&B[H].rethrow,A(B[H].handler(C)));return B=null,void(F&&h?setTimeout((function(){throw e.fromLeft(h)}),0):e.isLeft(C)&&N&&setTimeout((function(){if(N)throw e.fromLeft(C)}),0));case 0:b=1;break;case 4:return}}function _(e){return function(){if(6===b)return N=N&&e.rethrow,e.handler(C)(),function(){};var n=k++;return(B=B||{})[n]=e,function(){null!==B&&delete B[n]}}}return{kill:function(n,t){return function(){if(6===b)return t(e.right(void 0))(),function(){};var r=_({rethrow:!1,handler:function(){return t(e.right(void 0))}})();switch(b){case 0:F=e.left(n),b=6,C=F,L(d);break;case 4:null===F&&(F=e.left(n)),0===P&&(4===b&&(R=new w(v,new w(g,C(n)),R,F)),b=5,C=null,h=null,L(++d));break;default:null===F&&(F=e.left(n)),0===P&&(b=5,C=null,h=null)}return r}},join:function(e){return function(){var n=_({rethrow:!1,handler:e})();return 0===b&&L(d),n}},onComplete:_,isSuspended:function(){return 0===b},run:function(){0===b&&(T.isDraining()?L(d):T.enqueue((function(){L(d)})))}}}function F(n,t,r,o){var u=0,i={},c=0,l={},m=new Error("[ParAff] Early exit"),p=null,g=e;function y(t,r,o){var a,u,c=r,l=null,m=null,p=0,g={};e:for(;;)switch(a=null,c.tag){case b:if(c._3===e&&(a=i[c._1],g[p++]=a.kill(t,(function(e){return function(){0==--p&&o(e)()}}))),null===l)break e;c=l._2,null===m?l=null:(l=m._1,m=m._2);break;case s:c=c._2;break;case f:case d:l&&(m=new w(v,l,m)),l=c,c=c._1}if(0===p)o(n.right(void 0))();else for(u=0,a=p;ut=>()=>{try{let r;return r=new n.default(t),r.finalizers=[],e("Created a new WebSocket")(),r}catch(n){throw e("Failed to create a new WebSocket"),n}},e._onWsConnect=e=>n=>()=>{e.addEventListener("open",n),e.finalizers.push((()=>{e.removeEventListener("open",n)}))},e._onWsError=e=>n=>()=>{const t=function(e){n(e.toString())()};return e.addEventListener("error",t),e.finalizers.push((()=>{e.removeEventListener("error",t)})),t},e._removeOnWsError=e=>n=>()=>e.removeEventListener("error",n),e._onWsMessage=e=>n=>t=>()=>{const r=function(e){const r=e.data;n(`message: ${r}`)(),t(r)()};e.addEventListener("message",r),e.finalizers.push((()=>{e.removeEventListener("message",r)}))},e._wsFinalize=e=>()=>{for(let n of e.finalizers)try{n()}catch(e){}e.finalizers=[]},e._wsSend=e=>n=>t=>()=>{n(`sending: ${t}`)(),e.send(t)},e._wsClose=e=>()=>{e.close()}}(c["Ctl.Internal.JsWebSocket"]=c["Ctl.Internal.JsWebSocket"]||{}),function(e){"use strict";e["Ctl.Internal.JsWebSocket"]=e["Ctl.Internal.JsWebSocket"]||{};var n=e["Ctl.Internal.JsWebSocket"],t=e["Ctl.Internal.JsWebSocket"];n._mkWebSocket=t._mkWebSocket,n._onWsConnect=t._onWsConnect,n._onWsError=t._onWsError,n._removeOnWsError=t._removeOnWsError,n._onWsMessage=t._onWsMessage,n._wsSend=t._wsSend,n._wsClose=t._wsClose,n._wsFinalize=t._wsFinalize}(c),function(e){"use strict";e["Data.List"]=e["Data.List"]||{};var n,t=e["Data.List"],r=e["Control.Alt"],o=e["Control.Applicative"],a=e["Control.Apply"],u=e["Control.Lazy"],i=e["Data.Boolean"],c=e["Data.Eq"],l=e["Data.Foldable"],s=e["Data.Functor"],f=e["Data.List.Types"],d=e["Data.Maybe"],v=e["Data.Ord"],m=e["Data.Ordering"],p=e["Data.Tuple"],g=e["Data.Unfoldable"],y=function(e){return new f.Cons(e,f.Nil.value)},b=function(e){var n=function(t){return function(r){if(t instanceof f.Cons&&r instanceof f.Cons){if(c.eq(m.eqOrdering)(e(t.value0)(r.value0))(m.GT.value))return new f.Cons(r.value0,n(t)(r.value1));if(i.otherwise)return new f.Cons(t.value0,n(t.value1)(r))}if(t instanceof f.Nil)return r;if(r instanceof f.Nil)return t;throw new Error("Failed pattern match at Data.List (line 477, column 3 - line 477, column 38): "+[t.constructor.name,r.constructor.name])}},t=function(e){return e instanceof f.Cons&&e.value1 instanceof f.Cons?new f.Cons(n(e.value0)(e.value1.value0),t(e.value1.value1)):e},r=function(n){if(n instanceof f.Cons&&n.value1 instanceof f.Cons){if(c.eq(m.eqOrdering)(e(n.value0)(n.value1.value0))(m.GT.value))return o(n.value1.value0)(y(n.value0))(n.value1.value1);if(i.otherwise)return a(n.value1.value0)((function(e){return new f.Cons(n.value0,e)}))(n.value1.value1)}return y(n)},o=function(n){return function(t){return function(o){for(var a,u,i,l,s=n,d=t,v=!1;!v;)u=s,i=d,a=(l=o)instanceof f.Cons&&c.eq(m.eqOrdering)(e(u)(l.value0))(m.GT.value)?(s=l.value0,d=new f.Cons(u,i),void(o=l.value1)):(v=!0,new f.Cons(new f.Cons(u,i),r(l)));return a}}},a=function(n){return function(t){return function(o){var a,u=n,i=t,l=!1;function s(n,t,a){return a instanceof f.Cons&&c.notEq(m.eqOrdering)(e(n)(a.value0))(m.GT.value)?(u=a.value0,i=function(e){return t(new f.Cons(n,e))},void(o=a.value1)):(l=!0,new f.Cons(t(y(n)),r(a)))}for(;!l;)a=s(u,i,o);return a}}};return function(e){return function(e){var n,r=!1;function o(n){if(n instanceof f.Cons&&n.value1 instanceof f.Nil)return r=!0,n.value0;e=t(n)}for(;!r;)n=o(e);return n}(r(e))}},w=(n=f.Nil.value,function(e){var t,r=n,o=!1;function a(n,t){if(t instanceof f.Nil)return o=!0,n;if(t instanceof f.Cons)return r=new f.Cons(t.value0,n),void(e=t.value1);throw new Error("Failed pattern match at Data.List (line 372, column 3 - line 372, column 19): "+[n.constructor.name,t.constructor.name])}for(;!o;)t=a(r,e);return t}),C=function(e){return function(n){return function(t){var r,o=e,a=n,u=!1;function i(e,n,r){if(n<1)return u=!0,w(e);if(r instanceof f.Nil)return u=!0,w(e);if(r instanceof f.Cons)return o=new f.Cons(r.value0,e),a=n-1|0,void(t=r.value1);throw new Error("Failed pattern match at Data.List (line 524, column 3 - line 524, column 35): "+[e.constructor.name,n.constructor.name,r.constructor.name])}for(;!u;)r=i(o,a,t);return r}}}(f.Nil.value),h=function(e){return function(n){return function(t){return a.apply(e.Applicative0().Apply0())(s.map(e.Plus1().Alt0().Functor0())(f.Cons.create)(t))(u.defer(n)((function(r){return A(e)(n)(t)})))}}},A=function(e){return function(n){return function(t){return r.alt(e.Plus1().Alt0())(h(e)(n)(t))(o.pure(e.Applicative0())(f.Nil.value))}}},S=l.foldl(f.foldableList)((function(e){return function(n){return e+1|0}}))(0);t.toUnfoldable=function(e){return g.unfoldr(e)((function(e){return s.map(d.functorMaybe)((function(e){return new p.Tuple(e.head,e.tail)}))(function(e){if(e instanceof f.Nil)return d.Nothing.value;if(e instanceof f.Cons)return new d.Just({head:e.value0,tail:e.value1});throw new Error("Failed pattern match at Data.List (line 263, column 1 - line 263, column 66): "+[e.constructor.name])}(e))}))},t.fromFoldable=function(e){return l.foldr(e)(f.Cons.create)(f.Nil.value)},t.some=h,t.null=function(e){return e instanceof f.Nil},t.length=S,t.head=function(e){if(e instanceof f.Nil)return d.Nothing.value;if(e instanceof f.Cons)return new d.Just(e.value0);throw new Error("Failed pattern match at Data.List (line 234, column 1 - line 234, column 22): "+[e.constructor.name])},t.reverse=w,t.filter=function(e){return function(n){return function(t){var r,o=n,a=!1;function u(n,r){if(r instanceof f.Nil)return a=!0,w(n);if(r instanceof f.Cons){if(e(r.value0))return o=new f.Cons(r.value0,n),void(t=r.value1);if(i.otherwise)return o=n,void(t=r.value1)}throw new Error("Failed pattern match at Data.List (line 394, column 3 - line 394, column 27): "+[n.constructor.name,r.constructor.name])}for(;!a;)r=u(o,t);return r}}(f.Nil.value)},t.mapMaybe=function(e){return function(n){return function(t){var r,o=n,a=!1;function u(n,r){if(r instanceof f.Nil)return a=!0,w(n);if(r instanceof f.Cons){var u=e(r.value0);if(u instanceof d.Nothing)return o=n,void(t=r.value1);if(u instanceof d.Just)return o=new f.Cons(u.value0,n),void(t=r.value1);throw new Error("Failed pattern match at Data.List (line 423, column 5 - line 425, column 32): "+[u.constructor.name])}throw new Error("Failed pattern match at Data.List (line 421, column 3 - line 421, column 27): "+[n.constructor.name,r.constructor.name])}for(;!a;)r=u(o,t);return r}}(f.Nil.value)},t.sort=function(e){return function(n){return b(v.compare(e))(n)}},t.sortBy=b,t.take=C}(c),function(e){"use strict";e.new=function(e){return function(){return{value:e}}},e.read=function(e){return function(){return e.value}},e.modifyImpl=function(e){return function(n){return function(){var t=e(n.value);return n.value=t.state,t.value}}},e.write=function(e){return function(n){return function(){n.value=e}}}}(c["Effect.Ref"]=c["Effect.Ref"]||{}),function(e){"use strict";e["Effect.Ref"]=e["Effect.Ref"]||{};var n=e["Effect.Ref"],t=e["Effect.Ref"],r=e["Data.Functor"],o=e.Effect,a=t.modifyImpl;n.modify_=function(e){return function(n){return r.void(o.functorEffect)(function(e){return a((function(n){var t=e(n);return{state:t,value:t}}))}(e)(n))}},n.new=t.new,n.read=t.read,n.write=t.write}(c),function(e){"use strict";e["Ctl.Internal.Logging"]=e["Ctl.Internal.Logging"]||{};var n=e["Ctl.Internal.Logging"],t=e["Control.Applicative"],r=e["Ctl.Internal.Helpers"],o=e["Data.Foldable"],a=e["Data.Functor"],u=e["Data.JSDate"],i=e["Data.List"],c=e["Data.List.Types"],l=e["Data.Log.Level"],s=e["Data.Map.Internal"],f=e["Data.Maybe"],d=e["Data.Ord"],v=e.Effect,m=e["Effect.Aff"],p=e["Effect.Class"],g=e["Effect.Ref"],y=function(e){return function(n){return function(t){return function(o){if(n instanceof f.Nothing)return r.logString(e)(t)(o);if(n instanceof f.Just)return p.liftEffect(p.monadEffectEffect)((function(){var r=u.now();return m.launchAff_(n.value0(e)({level:t,message:o,tags:s.empty,timestamp:r}))()}));throw new Error("Failed pattern match at Ctl.Internal.Logging (line 30, column 3 - line 35, column 55): "+[n.constructor.name])}}}};n.setupLogs=function(e){return function(n){return function(){var r,u=p.liftEffect(p.monadEffectEffect)(g.new(c.Nil.value))(),s=y(e)(n),b=g.write(c.Nil.value)(u),w=function(e){return function(n){return t.when(v.applicativeEffect)(d.greaterThanOrEq(l.ordLogLevel)(n.level)(e))(g.modify_(c.Cons.create(n))(u))}},C=y(e)(new f.Just((r=a.map(a.functorFn)(p.liftEffect(m.monadEffectAff)),function(e){return r(w(e))})));return{addLogEntry:w,logger:s,printLogs:function(){var e=a.map(v.functorEffect)(i.reverse)(g.read(u))();return b(),o.for_(v.applicativeEffect)(c.foldableList)(e)((function(e){return s(e.level)(e.message)}))()},clearLogs:b,suppressedLogger:C}}}},n.mkLogger=y}(c),function(e){let n;n=t(1164),n=t(6359)(n);const r=(e,t)=>r=>o=>{let a=null;try{a=n[e][t](o)}catch(e){}return null==a?r.nothing:r.just(a)},o=e=>n=>n[e](),a=o("to_address"),u=o("to_bytes"),i=o("to_bech32"),c=o("network_id"),l=o("payment_cred"),s=o("stake_cred");e.withStakeCredential=e=>t=>t.kind()==n.StakeCredKind.Key?e.onKeyHash(t.to_keyhash()):e.onScriptHash(t.to_scripthash()),e.keyHashCredential=n.StakeCredential.from_keyhash,e.scriptHashCredential=n.StakeCredential.from_scripthash,e.addressBytes=u,e.stakeCredentialToBytes=u,e.addressBech32=i,e._addressNetworkId=e=>n=>e(c(n)),e._addressFromBech32=r("Address","from_bech32"),e._baseAddressFromAddress=r("BaseAddress","from_address"),e._enterpriseAddressFromAddress=r("EnterpriseAddress","from_address"),e._pointerAddressFromAddress=r("PointerAddress","from_address"),e._rewardAddressFromAddress=r("RewardAddress","from_address"),e.baseAddressToAddress=a,e.enterpriseAddressToAddress=a,e.pointerAddressToAddress=a,e.rewardAddressToAddress=a,e.baseAddressPaymentCred=l,e.enterpriseAddressPaymentCred=l,e.pointerAddressPaymentCred=l,e.baseAddressDelegationCred=s,e.pointerAddressStakePointer=e=>{const n=e.stake_pointer();return{slot:n.slot_bignum(),txIx:n.tx_index_bignum(),certIx:n.cert_index_bignum()}},e._enterpriseAddress=e=>t=>n.EnterpriseAddress.new(e(t.network),t.paymentCred),e._rewardAddress=e=>t=>n.RewardAddress.new(e(t.network),t.paymentCred),e._baseAddress=e=>t=>n.BaseAddress.new(e(t.network),t.paymentCred,t.delegationCred),e._pointerAddress=e=>t=>{const r=t.stakePointer,o=n.Pointer.new_pointer(r.slot,r.txIx,r.certIx);return n.PointerAddress.new(e(t.network),t.paymentCred,o)}}(c["Ctl.Internal.Serialization.Address"]=c["Ctl.Internal.Serialization.Address"]||{}),function(e){const n=e=>{const n=[];for(let t=0;tt=>n(t[e]());e._containerHelper=e=>({unpack:n,unpackFromProperty:t,unpackKeyIndexed:n=>{const t=[];for(let r=0;r{const t=e.new();return n.forEach((e=>t.add(e))),t},packMap:(n,t)=>{const r=n.new();return t.forEach((n=>{const[t,o]=e.untuple(n);r.insert(t,o)})),r}})}(c["Ctl.Internal.FfiHelpers"]=c["Ctl.Internal.FfiHelpers"]||{}),function(e){"use strict";e["Ctl.Internal.FfiHelpers"]=e["Ctl.Internal.FfiHelpers"]||{};var n=e["Ctl.Internal.FfiHelpers"],t=e["Ctl.Internal.FfiHelpers"],r=e["Data.Either"],o=e["Data.Maybe"],a=e["Data.Tuple"],u={nothing:o.Nothing.value,just:o.Just.create,from:o.fromMaybe},i=t._containerHelper({untuple:function(e){return[e.value0,e.value1]},tuple:a.Tuple.create});n.maybeFfiHelper=u,n.containerHelper=i,n.errorHelper=function(e){return{error:function(n){return r.Left.create(e(n))},valid:r.Right.create,from:function(e){var n=o.fromMaybe(e);return function(e){return n(r.hush(e))}}}}}(c),function(e){"use strict";e["Ctl.Internal.TypeLevel.Nat"]=e["Ctl.Internal.TypeLevel.Nat"]||{};var n=e["Ctl.Internal.TypeLevel.Nat"],t=e["Type.Proxy"],r=function(e){return e.natVal};n.natVal=r,n.knownNatZ={natVal:function(e){return 0}},n.knownNatS=function(e){return{natVal:function(n){return 1+r(e)(t.Proxy.value)|0}}}}(c),function(e){let n;n=t(1164),n=t(6359)(n),e.bnCompare=e=>n=>e.compare(n),e.zero=n.BigNum.zero(),e.one=n.BigNum.one(),e.bnAdd=e=>n=>t=>{try{return e.just(n.checked_add(t))}catch(n){return e.nothing}},e._fromString=e=>t=>{try{return e.just(n.BigNum.from_str(t))}catch(n){return e.nothing}},e.toString=e=>e.to_str()}(c["Ctl.Internal.Types.BigNum"]=c["Ctl.Internal.Types.BigNum"]||{}),function(e){"use strict";e["Ctl.Internal.Types.BigNum"]=e["Ctl.Internal.Types.BigNum"]||{};var n,t,r,o,a=e["Ctl.Internal.Types.BigNum"],u=e["Ctl.Internal.Types.BigNum"],i=e.Aeson,c=e["Control.Bind"],l=e["Ctl.Internal.FfiHelpers"],s=e["Data.Argonaut.Decode.Error"],f=e["Data.BigInt"],d=e["Data.Either"],v=e["Data.Int"],m=e["Data.Maybe"],p=e["Data.Ordering"],g=e["Data.UInt"],y={show:function(e){return'fromString "'+u.toString(e)+'"'}},b={eq:function(e){return function(n){return 0===u.bnCompare(e)(n)}}},w={compare:function(e){return function(n){var t=u.bnCompare(e)(n);return 1===t?p.GT.value:0===t?p.EQ.value:p.LT.value}},Eq0:function(){return b}},C=(n=m.fromJust(),function(e){return n(f.fromString(u.toString(e)))}),h={encodeAeson:(t=i.encodeAeson(i.encodeAesonBigInt),function(e){return t(C(e))})},A=u._fromString(l.maybeFfiHelper),S=(r=m.fromJust(),function(e){return r(A(e))}),I=S("18446744073709551615"),T=function(e){return A(f.toString(e))},D={decodeAeson:c.composeKleisliFlipped(d.bindEither)((o=d.note(new s.TypeMismatch("Couldn't convert `BigInt` to `BigNum`")),function(e){return o(T(e))}))(i.decodeAeson(i.decodeAesonBigInt))},F=u.bnAdd(l.maybeFfiHelper);a.add=F,a.fromBigInt=T,a.fromInt=function(e){return S(g.toString(g.fromInt(e)))},a.fromString=A,a.fromStringUnsafe=S,a.maxValue=I,a.toBigInt=C,a.toInt=function(e){return v.fromString(u.toString(e))},a.fromUInt=function(e){return S(g.toString(e))},a.eqBigNum=b,a.ordBigNum=w,a.showBigNum=y,a.decodeAesonBigNum=D,a.encodeAesonBigNum=h,a.one=u.one,a.toString=u.toString,a.zero=u.zero}(c),function(e){e.ord_=e=>n=>t=>{let r=0;const o=n.length,a=t.length;for(;ra?-1:1},e.concat_=e=>n=>{const t=new Uint8Array(e.length+n.length);for(let n=0;ni.from(e).toString("hex");const{ceil:n}=Math,{fromCharCode:t}=String;e.hexToByteArray_=e=>n=>t=>{let r=[];for(let n=0;nnew Uint8Array(e),e.byteArrayFromIntArray_=e=>n=>t=>t.every((e=>e<256&&e>=0))?n(new Uint8Array(t)):e,e.byteArrayToIntArray=e=>Array.from(e),e.byteLength=e=>e.byteLength,e.subarray=e=>n=>t=>t.subarray(e,n)}(c["Ctl.Internal.Types.ByteArray"]=c["Ctl.Internal.Types.ByteArray"]||{}),function(e){"use strict";e.toCharCode=function(e){return e.charCodeAt(0)},e.fromCharCode=function(e){return String.fromCharCode(e)}}(c["Data.Enum"]=c["Data.Enum"]||{}),function(e){"use strict";e["Data.Enum"]=e["Data.Enum"]||{};var n,t=e["Data.Enum"],r=e["Data.Enum"],o=e["Data.Bounded"],a=e["Data.Maybe"],u=e["Data.Ord"],i=function(e){return e.toEnum},c=function(e){return e.fromEnum},l=function(e){return e>=o.bottom(o.boundedInt)&&e<=o.top(o.boundedInt)?new a.Just(r.fromCharCode(e)):a.Nothing.value},s={succ:(n=l,function(e){return function(t){return n(e(t)+1|0)}})(r.toCharCode),pred:function(e){return function(n){return function(t){return e(n(t)-1|0)}}}(l)(r.toCharCode),Ord0:function(){return u.ordChar}},f={cardinality:r.toCharCode(o.top(o.boundedChar))-r.toCharCode(o.bottom(o.boundedChar))|0,toEnum:l,fromEnum:r.toCharCode,Bounded0:function(){return o.boundedChar},Enum1:function(){return s}};t.toEnum=i,t.fromEnum=c,t.toEnumWithDefaults=function(e){return function(n){return function(t){return function(r){var u=i(e)(r);if(u instanceof a.Just)return u.value0;if(u instanceof a.Nothing)return r=0?a.pure(f.applicativeMaybe)(n):f.Nothing.value})))},t.hexToByteArray=S,t.showByteArray=y,t.eqByteArray=h,t.ordByteArray=C,t.monoidByteArray=w,t.decodeAesonByteArray=I,t.encodeAesonByteArray=A,t.byteArrayToHex=r.byteArrayToHex,t.byteArrayToIntArray=r.byteArrayToIntArray,t.byteLength=r.byteLength,t.subarray=r.subarray}(c),function(e){"use strict";e["Data.Generic.Rep"]=e["Data.Generic.Rep"]||{};var n=e["Data.Generic.Rep"],t=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),r=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),o=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),a=function(){function e(){}return e.value=new e,e}();n.to=function(e){return e.to},n.from=function(e){return e.from},n.NoArguments=a,n.Inl=t,n.Inr=r,n.Product=o}(c),function(e){"use strict";e.intercalate=function(e){return function(n){var t=n.length;if(0===t)return"";for(var r=n[0],o=1;oe.to_bytes(),e.hashFromBytes=e=>t=>o=>r(n[e].from_bytes)(t)(o),e.hashToBech32Unsafe=e=>n=>n.to_bech32(e);const r=e=>n=>t=>{let r=null;try{r=e(t)}catch(e){}return null==r?n.nothing:n.just(r)};e.hashToBech32Impl=e=>n=>t=>{let r=null;try{r=t.to_bech32(n)}catch(e){}return null==r?e.nothing:e.just(r)},e._ed25519KeyHashFromBech32Impl=e=>t=>r(n.Ed25519KeyHash.from_bech32)(e)(t),e.nativeScriptHash=e=>e.hash()}(c["Ctl.Internal.Serialization.Hash"]=c["Ctl.Internal.Serialization.Hash"]||{}),function(e){"use strict";e["Data.Void"]=e["Data.Void"]||{},e["Data.Void"].absurd=function(e){return function(e){for(var n;;)n=void 0;return n}()}}(c),function(e){"use strict";e["Ctl.Internal.ToData"]=e["Ctl.Internal.ToData"]||{};var n,t,r,o=e["Ctl.Internal.ToData"],a=e["Control.Category"],u=e["Ctl.Internal.Helpers"],i=e["Ctl.Internal.TypeLevel.Nat"],c=e["Ctl.Internal.Types.BigNum"],l=e["Ctl.Internal.Types.PlutusData"],s=e["Data.Array"],f=e["Data.Functor"],d=e["Data.Generic.Rep"],v=e["Data.Maybe"],m=e["Data.Newtype"],p=e["Data.Ord"],g=e["Data.Semigroup"],y=e["Data.Tuple"],b=e["Data.Void"],w=e.Record,C=e["Type.Proxy"],h={toData:b.absurd},A={toData:(n=m.unwrap(),function(e){return l.Bytes.create(n(e))})},S={toData:a.identity(a.categoryFn)},I={toData:l.Bytes.create},T={toData:l.Integer.create},D=function(e){return e.toDataWithSchema},F=function(e){return e["toDataArgsRec'"]},E=function(e){return e.toDataArgs},x=function(e){return e.toData},M={toData:(t=x(T),function(e){return t(c.toBigInt(e))})},R={toData:(r=x(T),function(e){return r(u.uIntToBigInt(e))})};o.genericToData=function(e){return function(n){var t=D(n)(C.Proxy.value),r=d.from(e);return function(e){return t(r(e))}}},o.toData=x,o.toDataArgsRL=function(e){return{toDataArgsRec:function(n){return function(t){return function(r){return function(o){return f.map(f.functorArray)(y.snd)(s.sortWith(p.ordInt)(y.fst)(F(e)(n)(t)(r)(o)))}}}},ToDataArgsRLHelper0:function(){return e}}},o.toDataWithSchemaSum=function(e){return function(n){return{toDataWithSchema:function(t){return function(r){if(r instanceof d.Inl)return D(e)(t)(r.value0);if(r instanceof d.Inr)return D(n)(t)(r.value0);throw new Error("Failed pattern match at Ctl.Internal.ToData (line 140, column 1 - line 146, column 54): "+[t.constructor.name,r.constructor.name])}}}}},o.toDataWithSchemaConstruct=function(e){return function(e){return function(){return function(){return function(n){return function(n){return{toDataWithSchema:function(t){return function(r){return new l.Constr(c.fromInt(i.natVal(n)(C.Proxy.value)),E(e)(t)(C.Proxy.value)(r))}}}}}}}}},o.toDataArgsNoArguments=function(e){return{toDataArgs:function(e){return function(e){return function(e){return[]}}},IsSymbol0:function(){return e}}},o.toDataArgsArgumentRecord=function(e){return{toDataArgs:function(n){return function(t){return function(r){return E(e)(n)(t)(r)}}},IsSymbol0:e.IsSymbol0}},o.toDataArgsArgument=function(e){return function(n){return{toDataArgs:function(n){return function(n){return function(n){return[x(e)(n)]}}},IsSymbol0:function(){return n}}}},o.toDataArgsRecord=function(e){return function(n){return function(){return{toDataArgs:function(e){return function(t){return function(r){return n.toDataArgsRec(e)(t)(C.Proxy.value)(r)}}},IsSymbol0:function(){return e}}}}},o.toDataArgsProduct=function(e){return function(n){return{toDataArgs:function(t){return function(r){return function(o){return g.append(g.semigroupArray)(E(e)(t)(r)(o.value0))(E(n)(t)(r)(o.value1))}}},IsSymbol0:e.IsSymbol0}}},o.toDataArgsRLHelperNilRow={"toDataArgsRec'":function(e){return function(e){return function(e){return function(e){return[]}}}}},o.toDataArgsRLHelperCons=function(e){return function(n){return function(){return function(){return function(){return function(t){return function(r){return function(){return function(){return function(){return function(){return function(r){return{"toDataArgsRec'":function(o){return function(o){return function(a){return function(a){var u=i.natVal(r)(C.Proxy.value),c=w.get(t)()(C.Proxy.value)(a);return s.cons(new y.Tuple(u,x(e)(c)))(F(n)(C.Proxy.value)(o)(C.Proxy.value)(w.delete(t)()()(C.Proxy.value)(a)))}}}}}}}}}}}}}}}}},o.toDataVoid=h,o.toDataMaybe=function(e){return{toData:function(n){if(n instanceof v.Just)return new l.Constr(c.zero,[x(e)(n.value0)]);if(n instanceof v.Nothing)return new l.Constr(c.one,[]);throw new Error("Failed pattern match at Ctl.Internal.ToData (line 262, column 1 - line 264, column 40): "+[n.constructor.name])}}},o.toDataBigInt=T,o.toDataBigNum=M,o.toDataUInt=R,o.toDataByteArray=I,o.toDataRawBytes=A,o.toDataPlutusData=S}(c),function(e){"use strict";e["Ctl.Internal.Types.RawBytes"]=e["Ctl.Internal.Types.RawBytes"]||{};var n,t,r=e["Ctl.Internal.Types.RawBytes"],o=e["Ctl.Internal.Types.ByteArray"],a=e["Data.Functor"],u=e["Data.Maybe"],i=e["Data.Newtype"],c=e["Data.Show"],l=o.ordByteArray,s=o.monoidByteArray,f=o.eqByteArray,d=(n=i.unwrap(),function(e){return o.byteArrayToHex(n(e))}),v={show:function(e){return"(hexToRawBytesUnsafe "+c.show(c.showString)(d(e))+")"}},m=(t=a.map(u.functorMaybe)(i.wrap()),function(e){return t(o.hexToByteArray(e))});r.rawBytesToHex=d,r.hexToRawBytes=m,r.showRawBytes=v,r.eqRawBytes=f,r.ordRawBytes=l,r.monoidRawBytes=s}(c),function(e){"use strict";e["Ctl.Internal.Serialization.Hash"]=e["Ctl.Internal.Serialization.Hash"]||{};var n,t,r,o,a,u,i,c,l,s,f,d=e["Ctl.Internal.Serialization.Hash"],v=e["Ctl.Internal.Serialization.Hash"],m=e.Aeson,p=e["Control.Bind"],g=e["Ctl.Internal.FfiHelpers"],y=e["Ctl.Internal.ToData"],b=e["Ctl.Internal.Types.ByteArray"],w=e["Ctl.Internal.Types.PlutusData"],C=e["Ctl.Internal.Types.RawBytes"],h=e["Data.Argonaut.Decode.Error"],A=e["Data.Either"],S=e["Data.Eq"],I=e["Data.Function"],T=e["Data.Maybe"],D=e["Data.Newtype"],F=e["Data.Ord"],E=(n=D.wrap(),function(e){return n(v.hashToBytes(e))}),x={eq:I.on(S.eq(C.eqRawBytes))(E)},M={compare:I.on(F.compare(C.ordRawBytes))(E),Eq0:function(){return x}},R={show:function(e){return"(ScriptHash "+C.rawBytesToHex(E(e))+")"}},P={toData:(t=y.toData(y.toDataByteArray),r=D.unwrap(),function(e){return t(r(E(e)))})},k=v.hashToBech32Unsafe,B=v.hashFromBytes("ScriptHash")(g.maybeFfiHelper),N={decodeAeson:(o=T.maybe(new A.Left(new h.TypeMismatch("Expected hex-encoded script hash")))(A.Right.create),a=m.caseAesonString(T.Nothing.value)(p.composeKleisliFlipped(T.bindMaybe)(T.Just.create)(p.composeKleisliFlipped(T.bindMaybe)(B)(b.hexToByteArray))),function(e){return o(a(e))})},L={fromData:function(e){return e instanceof w.Bytes?B(e.value0):T.Nothing.value}},_=(u=D.wrap(),function(e){return u(v.hashToBytes(e))}),U={encodeAeson:(i=m.encodeAeson(m.encodeAesonString),function(e){return i(C.rawBytesToHex(_(e)))})},H={eq:I.on(S.eq(C.eqRawBytes))(_)},q={compare:I.on(F.compare(C.ordRawBytes))(_),Eq0:function(){return H}},O={show:function(e){return"(Ed25519KeyHash "+C.rawBytesToHex(_(e))+")"}},V={toData:(c=y.toData(y.toDataByteArray),l=D.unwrap(),function(e){return c(l(_(e)))})},W=v.hashToBech32Unsafe,K=v.hashFromBytes("Ed25519KeyHash")(g.maybeFfiHelper),z={decodeAeson:m.caseAesonString(new A.Left(new h.TypeMismatch("Expected Plutus BuiltinByteString")))(p.composeKleisliFlipped(A.bindEither)((f=A.note(new h.TypeMismatch("Invalid Ed25519KeyHash")),function(e){return f(K(e))}))((s=A.note(new h.TypeMismatch("Invalid ByteArray")),function(e){return s(b.hexToByteArray(e))})))},J={fromData:function(e){return e instanceof w.Bytes?K(e.value0):T.Nothing.value}},G=v._ed25519KeyHashFromBech32Impl(g.maybeFfiHelper),j=(0,v.hashToBech32Impl)(g.maybeFfiHelper);d.ed25519KeyHashFromBech32=G,d.ed25519KeyHashFromBytes=K,d.ed25519KeyHashToBech32=j,d.ed25519KeyHashToBech32Unsafe=W,d.ed25519KeyHashToBytes=_,d.scriptHashFromBytes=B,d.scriptHashToBech32Unsafe=k,d.scriptHashToBytes=E,d.eqEd25519KeyHash=H,d.ordEd25519KeyHash=q,d.showEd25519KeyHash=O,d.toDataEd25519KeyHash=V,d.fromDataEd25519KeyHash=J,d.decodeAesonEd25519KeyHash=z,d.encodeAesonEd25519KeyHash=U,d.eqScriptHash=x,d.ordScriptHash=M,d.showScriptHash=R,d.toDataScriptHash=P,d.fromDataScriptHash=L,d.decodeAesonScriptHash=N,d.nativeScriptHash=v.nativeScriptHash}(c),function(e){"use strict";e["Ctl.Internal.Types.CborBytes"]=e["Ctl.Internal.Types.CborBytes"]||{};var n,t,r,o,a=e["Ctl.Internal.Types.CborBytes"],u=e["Ctl.Internal.Types.ByteArray"],i=e["Data.Functor"],c=e["Data.Maybe"],l=e["Data.Newtype"],s=u.ordByteArray,f=u.eqByteArray,d=u.decodeAesonByteArray,v=(n=l.wrap(),t=l.unwrap(),function(e){return n(t(e))}),m=(r=i.map(c.functorMaybe)(l.wrap()),function(e){return r(u.hexToByteArray(e))}),p=(o=l.unwrap(),function(e){return u.byteArrayToHex(o(e))});a.CborBytes=function(e){return e},a.cborBytesToHex=p,a.hexToCborBytes=m,a.rawBytesAsCborBytes=v,a.eqCborBytes=f,a.ordCborBytes=s,a.decodeAesonCborBytes=d}(c),function(e){"use strict";e["Ctl.Internal.Serialization.Address"]=e["Ctl.Internal.Serialization.Address"]||{};var n,t=e["Ctl.Internal.Serialization.Address"],r=e["Ctl.Internal.Serialization.Address"],o=e.Aeson,a=e["Control.Alt"],u=e["Control.Bind"],i=e["Ctl.Internal.FfiHelpers"],c=e["Ctl.Internal.FromData"],l=e["Ctl.Internal.Serialization.Hash"],s=e["Ctl.Internal.ToData"],f=e["Ctl.Internal.Types.BigNum"],d=e["Ctl.Internal.Types.CborBytes"],v=e["Data.Argonaut.Decode.Error"],m=e["Data.Either"],p=e["Data.Eq"],g=e["Data.Function"],y=e["Data.Functor"],b=e["Data.Generic.Rep"],w=e["Data.Maybe"],C=e["Data.Ord"],h=e["Data.Show"],A=e["Data.Show.Generic"],S=function(){function e(){}return e.value=new e,e}(),I=function(){function e(){}return e.value=new e,e}(),T=s.toDataBigNum,D=s.toDataBigNum,F=s.toDataBigNum,E={show:function(e){return"(Address "+r.addressBech32(e)+")"}},x={show:A.genericShow({to:function(e){return e},from:function(e){return e}})(A.genericShowConstructor(A.genericShowArgsArgument(f.showBigNum))({reflectSymbol:function(){return"TransactionIndex"}}))},M={show:A.genericShow({to:function(e){return e},from:function(e){return e}})(A.genericShowConstructor(A.genericShowArgsArgument(f.showBigNum))({reflectSymbol:function(){return"Slot"}}))},R={to:function(e){if(e instanceof b.Inl)return S.value;if(e instanceof b.Inr)return I.value;throw new Error("Failed pattern match at Ctl.Internal.Serialization.Address (line 392, column 1 - line 392, column 36): "+[e.constructor.name])},from:function(e){if(e instanceof S)return new b.Inl(b.NoArguments.value);if(e instanceof I)return new b.Inr(b.NoArguments.value);throw new Error("Failed pattern match at Ctl.Internal.Serialization.Address (line 392, column 1 - line 392, column 36): "+[e.constructor.name])}},P={show:A.genericShow(R)(A.genericShowSum(A.genericShowConstructor(A.genericShowArgsNoArguments)({reflectSymbol:function(){return"TestnetId"}}))(A.genericShowConstructor(A.genericShowArgsNoArguments)({reflectSymbol:function(){return"MainnetId"}})))},k={show:A.genericShow({to:function(e){return e},from:function(e){return e}})(A.genericShowConstructor(A.genericShowArgsArgument(f.showBigNum))({reflectSymbol:function(){return"CertificateIndex"}}))},B=c.fromDataBigNum,N=c.fromDataBigNum,L=c.fromDataBigNum,_={eq:g.on(p.eq(d.eqCborBytes))(r.stakeCredentialToBytes)},U=f.eqBigNum,H={eq:function(e){return function(n){return e instanceof S&&n instanceof S||e instanceof I&&n instanceof I}}},q={eq:g.on(p.eq(d.eqCborBytes))(r.addressBytes)},O={eq:g.on(p.eq(q))(r.rewardAddressToAddress)},V={compare:g.on(C.compare(d.ordCborBytes))(r.addressBytes),Eq0:function(){return q}},W=f.decodeAesonBigNum,K=r.withStakeCredential({onKeyHash:g.const(w.Nothing.value),onScriptHash:w.Just.create}),z=r.withStakeCredential({onKeyHash:w.Just.create,onScriptHash:g.const(w.Nothing.value)}),J=function(e){return function(n){return function(t){return function(r){return"("+n+" "+h.show(e)(t(r))+")"}}}},G={show:J(E)("RewardAddress")(r.rewardAddressToAddress)},j={show:J(h.showString)("StakeCredenetial")(r.withStakeCredential({onKeyHash:h.show(l.showEd25519KeyHash),onScriptHash:h.show(l.showScriptHash)}))},Q=r._rewardAddressFromAddress(i.maybeFfiHelper),Z=function(e){return r.addressBytes(r.rewardAddressToAddress(e))},X={compare:g.on(C.compare(d.ordCborBytes))(Z),Eq0:function(){return O}},Y=r._pointerAddressFromAddress(i.maybeFfiHelper),$=function(e){if(e instanceof S)return 0;if(e instanceof I)return 1;throw new Error("Failed pattern match at Ctl.Internal.Serialization.Address (line 387, column 18 - line 389, column 17): "+[e.constructor.name])},ee=r._pointerAddress($),ne=r._rewardAddress($),te=r._enterpriseAddressFromAddress(i.maybeFfiHelper),re=r._enterpriseAddress($),oe=r._baseAddressFromAddress(i.maybeFfiHelper),ae=r._baseAddress($),ue=function(e){return function(n){return function(t){return ae({network:e,paymentCred:r.scriptHashCredential(n),delegationCred:r.scriptHashCredential(t)})}}},ie=r._addressNetworkId((function(e){return w.fromJust()(0===(n=e)?new w.Just(S.value):1===n?new w.Just(I.value):w.Nothing.value);var n})),ce=r._addressFromBech32(i.maybeFfiHelper),le=u.composeKleisli(w.bindMaybe)(ce)(Q),se={decodeAeson:u.composeKleisli(m.bindEither)(o.decodeAeson(o.decodeAesonString))((n=m.note(new v.TypeMismatch("RewardAddress")),function(e){return n(le(e))}))};t.Slot=function(e){return e},t.addressNetworkId=ie,t.baseAddress=ae,t.paymentKeyHashStakeKeyHashAddress=function(e){return function(n){return function(t){return ae({network:e,paymentCred:r.keyHashCredential(n),delegationCred:r.keyHashCredential(t)})}}},t.scriptHashStakeKeyHashAddress=function(e){return function(n){return function(t){return ae({network:e,paymentCred:r.scriptHashCredential(n),delegationCred:r.keyHashCredential(t)})}}},t.paymentKeyHashScriptHashAddress=function(e){return function(n){return function(t){return ae({network:e,paymentCred:r.keyHashCredential(n),delegationCred:r.scriptHashCredential(t)})}}},t.scriptHashScriptHashAddress=ue,t.scriptAddress=function(e){return function(n){return ue(e)(n)(n)}},t.MainnetId=I,t.TestnetId=S,t.stakeCredentialToKeyHash=z,t.stakeCredentialToScriptHash=K,t.addressFromBech32=ce,t.addressPaymentCred=function(e){return a.alt(w.altMaybe)(a.alt(w.altMaybe)(y.map(w.functorMaybe)(r.baseAddressPaymentCred)(oe(e)))(y.map(w.functorMaybe)(r.pointerAddressPaymentCred)(Y(e))))(y.map(w.functorMaybe)(r.enterpriseAddressPaymentCred)(te(e)))},t.addressStakeCred=function(e){return y.map(w.functorMaybe)(r.baseAddressDelegationCred)(oe(e))},t.baseAddressFromAddress=oe,t.baseAddressBytes=function(e){return r.addressBytes(r.baseAddressToAddress(e))},t.enterpriseAddress=re,t.enterpriseAddressFromAddress=te,t.enterpriseAddressBytes=function(e){return r.addressBytes(r.enterpriseAddressToAddress(e))},t.paymentKeyHashEnterpriseAddress=function(e){return function(n){return re({network:e,paymentCred:r.keyHashCredential(n)})}},t.scriptHashEnterpriseAddress=function(e){return function(n){return re({network:e,paymentCred:r.scriptHashCredential(n)})}},t.pointerAddressFromAddress=Y,t.pointerAddressBytes=function(e){return r.addressBytes(r.pointerAddressToAddress(e))},t.paymentKeyHashPointerAddress=function(e){return function(n){return function(t){return ee({network:e,paymentCred:r.keyHashCredential(n),stakePointer:t})}}},t.scriptHashPointerAddress=function(e){return function(n){return function(t){return ee({network:e,paymentCred:r.scriptHashCredential(n),stakePointer:t})}}},t.rewardAddress=ne,t.rewardAddressBytes=Z,t.rewardAddressBech32=function(e){return r.addressBech32(r.rewardAddressToAddress(e))},t.rewardAddressFromAddress=Q,t.eqSlot=U,t.decodeAesonSlot=W,t.fromDataSlot=N,t.toDataSlot=D,t.showSlot=M,t.toDataTransactionIndex=T,t.fromDataTransactionIndex=B,t.showTransactionIndex=x,t.toDataCertificateIndex=F,t.fromDataCertificateIndex=L,t.showCertificateIndex=k,t.showAddress=E,t.eqAddress=q,t.ordAddress=V,t.eqRewardAddress=O,t.showRewardAddress=G,t.ordRewardAddress=X,t.decodeAesonRewardAddress=se,t.eqStakeCredential=_,t.showStakeCredential=j,t.eqNetworkId=H,t.showNetworkId=P,t.addressBech32=r.addressBech32,t.keyHashCredential=r.keyHashCredential,t.scriptHashCredential=r.scriptHashCredential,t.withStakeCredential=r.withStakeCredential,t.baseAddressPaymentCred=r.baseAddressPaymentCred,t.baseAddressDelegationCred=r.baseAddressDelegationCred,t.baseAddressToAddress=r.baseAddressToAddress,t.enterpriseAddressPaymentCred=r.enterpriseAddressPaymentCred,t.enterpriseAddressToAddress=r.enterpriseAddressToAddress,t.pointerAddressPaymentCred=r.pointerAddressPaymentCred,t.pointerAddressToAddress=r.pointerAddressToAddress,t.pointerAddressStakePointer=r.pointerAddressStakePointer,t.rewardAddressToAddress=r.rewardAddressToAddress}(c),function(e){"use strict";e["Ctl.Internal.Cardano.Types.NativeScript"]=e["Ctl.Internal.Cardano.Types.NativeScript"]||{};var n=e["Ctl.Internal.Cardano.Types.NativeScript"],t=e["Ctl.Internal.Serialization.Address"],r=e["Ctl.Internal.Serialization.Hash"],o=e["Data.Eq"],a=e["Data.Generic.Rep"],u=e["Data.Show"],i=e["Data.Show.Generic"],c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),d=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),v=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),m={to:function(e){if(e instanceof a.Inl)return new c(e.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inl)return new l(e.value0.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inr&&e.value0.value0 instanceof a.Inl)return new s(e.value0.value0.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inr&&e.value0.value0 instanceof a.Inr&&e.value0.value0.value0 instanceof a.Inl)return new f(e.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value1);if(e instanceof a.Inr&&e.value0 instanceof a.Inr&&e.value0.value0 instanceof a.Inr&&e.value0.value0.value0 instanceof a.Inr&&e.value0.value0.value0.value0 instanceof a.Inl)return new d(e.value0.value0.value0.value0.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inr&&e.value0.value0 instanceof a.Inr&&e.value0.value0.value0 instanceof a.Inr&&e.value0.value0.value0.value0 instanceof a.Inr)return new v(e.value0.value0.value0.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.Cardano.Types.NativeScript (line 48, column 1 - line 48, column 39): "+[e.constructor.name])},from:function(e){if(e instanceof c)return new a.Inl(e.value0);if(e instanceof l)return new a.Inr(new a.Inl(e.value0));if(e instanceof s)return new a.Inr(new a.Inr(new a.Inl(e.value0)));if(e instanceof f)return new a.Inr(new a.Inr(new a.Inr(new a.Inl(new a.Product(e.value0,e.value1)))));if(e instanceof d)return new a.Inr(new a.Inr(new a.Inr(new a.Inr(new a.Inl(e.value0)))));if(e instanceof v)return new a.Inr(new a.Inr(new a.Inr(new a.Inr(new a.Inr(e.value0)))));throw new Error("Failed pattern match at Ctl.Internal.Cardano.Types.NativeScript (line 48, column 1 - line 48, column 39): "+[e.constructor.name])}},p={show:function(e){return i.genericShow(m)(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsArgument(r.showEd25519KeyHash))({reflectSymbol:function(){return"ScriptPubkey"}}))(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsArgument(u.showArray(p)))({reflectSymbol:function(){return"ScriptAll"}}))(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsArgument(u.showArray(p)))({reflectSymbol:function(){return"ScriptAny"}}))(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsProduct(i.genericShowArgsArgument(u.showInt))(i.genericShowArgsArgument(u.showArray(p))))({reflectSymbol:function(){return"ScriptNOfK"}}))(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsArgument(t.showSlot))({reflectSymbol:function(){return"TimelockStart"}}))(i.genericShowConstructor(i.genericShowArgsArgument(t.showSlot))({reflectSymbol:function(){return"TimelockExpiry"}})))))))(e)}},g={eq:function(e){return function(n){return e instanceof c&&n instanceof c?o.eq(r.eqEd25519KeyHash)(e.value0)(n.value0):e instanceof l&&n instanceof l||e instanceof s&&n instanceof s?o.eq(o.eqArray(g))(e.value0)(n.value0):e instanceof f&&n instanceof f?e.value0===n.value0&&o.eq(o.eqArray(g))(e.value1)(n.value1):(e instanceof d&&n instanceof d||e instanceof v&&n instanceof v)&&o.eq(t.eqSlot)(e.value0)(n.value0)}}};n.ScriptPubkey=c,n.ScriptAll=l,n.ScriptAny=s,n.ScriptNOfK=f,n.TimelockStart=d,n.TimelockExpiry=v,n.eqNativeScript=g,n.showNativeScript=p}(c),function(e){"use strict";e["Ctl.Internal.Types.Scripts"]=e["Ctl.Internal.Types.Scripts"]||{};var n=e["Ctl.Internal.Types.Scripts"],t=e["Ctl.Internal.Cardano.Types.NativeScript"],r=e["Ctl.Internal.Serialization.Hash"],o=e["Ctl.Internal.Types.ByteArray"],a=e["Data.Eq"],u=e["Data.Generic.Rep"],i=e["Data.Ordering"],c=e["Data.Show.Generic"],l=e["Data.Tuple"],s=function(){function e(){}return e.value=new e,e}(),f=function(){function e(){}return e.value=new e,e}(),d=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),v=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),m=r.toDataScriptHash,p=r.ordScriptHash,g=r.ordScriptHash,y={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(r.showScriptHash))({reflectSymbol:function(){return"ValidatorHash"}}))},b={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(r.showScriptHash))({reflectSymbol:function(){return"StakeValidatorHash"}}))},w={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(t.showNativeScript))({reflectSymbol:function(){return"NativeScriptStakeValidator"}}))},C={to:function(e){if(e instanceof u.Inl)return new d(e.value0);if(e instanceof u.Inr)return new v(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.Scripts (line 110, column 1 - line 110, column 40): "+[e.constructor.name])},from:function(e){if(e instanceof d)return new u.Inl(e.value0);if(e instanceof v)return new u.Inr(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.Scripts (line 110, column 1 - line 110, column 40): "+[e.constructor.name])}},h={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(r.showScriptHash))({reflectSymbol:function(){return"MintingPolicyHash"}}))},A={to:function(e){if(e instanceof u.Inl)return s.value;if(e instanceof u.Inr)return f.value;throw new Error("Failed pattern match at Ctl.Internal.Types.Scripts (line 52, column 1 - line 52, column 35): "+[e.constructor.name])},from:function(e){if(e instanceof s)return new u.Inl(u.NoArguments.value);if(e instanceof f)return new u.Inr(u.NoArguments.value);throw new Error("Failed pattern match at Ctl.Internal.Types.Scripts (line 52, column 1 - line 52, column 35): "+[e.constructor.name])}},S={show:c.genericShow(A)(c.genericShowSum(c.genericShowConstructor(c.genericShowArgsNoArguments)({reflectSymbol:function(){return"PlutusV1"}}))(c.genericShowConstructor(c.genericShowArgsNoArguments)({reflectSymbol:function(){return"PlutusV2"}})))},I={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(l.showTuple(o.showByteArray)(S)))({reflectSymbol:function(){return"PlutusScript"}}))},T={show:c.genericShow(C)(c.genericShowSum(c.genericShowConstructor(c.genericShowArgsArgument(I))({reflectSymbol:function(){return"PlutusMintingPolicy"}}))(c.genericShowConstructor(c.genericShowArgsArgument(t.showNativeScript))({reflectSymbol:function(){return"NativeMintingPolicy"}})))},D={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(I))({reflectSymbol:function(){return"PlutusScriptStakeValidator"}}))},F={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(I))({reflectSymbol:function(){return"Validator"}}))},E=r.fromDataScriptHash,x={eq:function(e){return function(n){return e instanceof s&&n instanceof s||e instanceof f&&n instanceof f}}},M=l.eqTuple(o.eqByteArray)(x),R={eq:function(e){return function(n){return e instanceof d&&n instanceof d?a.eq(M)(e.value0)(n.value0):e instanceof v&&n instanceof v&&a.eq(t.eqNativeScript)(e.value0)(n.value0)}}},P=M,k={compare:function(e){return function(n){if(e instanceof s&&n instanceof s)return i.EQ.value;if(e instanceof s)return i.LT.value;if(n instanceof s)return i.GT.value;if(e instanceof f&&n instanceof f)return i.EQ.value;throw new Error("Failed pattern match at Ctl.Internal.Types.Scripts (line 51, column 1 - line 51, column 29): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return x}};n.PlutusMintingPolicy=d,n.NativeMintingPolicy=v,n.MintingPolicyHash=function(e){return e},n.PlutusScript=function(e){return e},n.ValidatorHash=function(e){return e},n.PlutusV1=s,n.PlutusV2=f,n.plutusV1Script=function(e){return new l.Tuple(e,s.value)},n.plutusV2Script=function(e){return new l.Tuple(e,f.value)},n.ordLanguage=k,n.showLanguage=S,n.eqPlutusScript=M,n.showPlutusScript=I,n.eqMintingPolicy=R,n.showMintingPolicy=T,n.eqValidator=P,n.showValidator=F,n.showNativeScriptStakeVali=w,n.showPlutusScriptStakeVali=D,n.ordMintingPolicyHash=g,n.showMintingPolicyHash=h,n.ordValidatorHash=p,n.fromDataValidatorHash=E,n.toDataValidatorHash=m,n.showValidatorHash=y,n.showStakeValidatorHash=b}(c),function(e){"use strict";e["Ctl.Internal.Cardano.Types.ScriptRef"]=e["Ctl.Internal.Cardano.Types.ScriptRef"]||{};var n=e["Ctl.Internal.Cardano.Types.ScriptRef"],t=e["Ctl.Internal.Cardano.Types.NativeScript"],r=e["Ctl.Internal.Types.Scripts"],o=e["Data.Eq"],a=e["Data.Generic.Rep"],u=e["Data.Maybe"],i=e["Data.Show.Generic"],c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s={to:function(e){if(e instanceof a.Inl)return new c(e.value0);if(e instanceof a.Inr)return new l(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Cardano.Types.ScriptRef (line 38, column 1 - line 38, column 36): "+[e.constructor.name])},from:function(e){if(e instanceof c)return new a.Inl(e.value0);if(e instanceof l)return new a.Inr(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Cardano.Types.ScriptRef (line 38, column 1 - line 38, column 36): "+[e.constructor.name])}},f={show:i.genericShow(s)(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsArgument(t.showNativeScript))({reflectSymbol:function(){return"NativeScriptRef"}}))(i.genericShowConstructor(i.genericShowArgsArgument(r.showPlutusScript))({reflectSymbol:function(){return"PlutusScriptRef"}})))},d={eq:function(e){return function(n){return e instanceof c&&n instanceof c?o.eq(t.eqNativeScript)(e.value0)(n.value0):e instanceof l&&n instanceof l&&o.eq(r.eqPlutusScript)(e.value0)(n.value0)}}};n.NativeScriptRef=c,n.PlutusScriptRef=l,n.getPlutusScript=function(e){return e instanceof l?new u.Just(e.value0):u.Nothing.value},n.eqScriptRef=d,n.showScriptRef=f}(c),function(e){"use strict";e["Control.Alternative"]=e["Control.Alternative"]||{};var n=e["Control.Alternative"],t=e["Control.Applicative"],r=e["Control.Plus"],o=e["Data.Unit"];n.guard=function(e){return function(n){if(n)return t.pure(e.Applicative0())(o.unit);if(!n)return r.empty(e.Plus1());throw new Error("Failed pattern match at Control.Alternative (line 48, column 1 - line 48, column 54): "+[n.constructor.name])}}}(c),function(e){"use strict";e["Data.Array.NonEmpty.Internal"]=e["Data.Array.NonEmpty.Internal"]||{};var n=e["Data.Array.NonEmpty.Internal"],t=e["Control.Bind"],r=e["Data.Foldable"],o=e["Data.Functor"],a=e["Data.Traversable"].traversableArray,u=o.functorArray,i=r.foldableArray,c=t.bindArray;n.NonEmptyArray=function(e){return e},n.functorNonEmptyArray=u,n.foldableNonEmptyArray=i,n.traversableNonEmptyArray=a,n.bindNonEmptyArray=c}(c),function(e){"use strict";e["Data.Array.NonEmpty"]=e["Data.Array.NonEmpty"]||{};var n,t,r=e["Data.Array.NonEmpty"],o=e["Data.Array"],a=e["Data.Array.NonEmpty.Internal"],u=e["Data.Boolean"],i=e["Data.Maybe"],c=e["Data.Ord"],l=e["Data.Semigroup"],s=a.NonEmptyArray,f=(n=o.uncons,t=i.fromJust(),function(e){return t(n(e))}),d=function(e){return function(n){return e(n)}},v=(d(o.length),function(e){var n=d(e);return function(e){return s(n(e))}});r.fromArray=function(e){if(o.length(e)>0)return new i.Just(s(e));if(u.otherwise)return i.Nothing.value;throw new Error("Failed pattern match at Data.Array.NonEmpty (line 159, column 1 - line 159, column 58): "+[e.constructor.name])},r.toArray=function(e){return e},r.singleton=function(e){return s(o.singleton(e))},r.range=function(e){return function(n){return s(o.range(e)(n))}},r.replicate=function(e){return function(n){return s(o.replicate(c.max(c.ordInt)(1)(e))(n))}},r["cons'"]=function(e){return function(n){return s(o.cons(e)(n))}},r.appendArray=function(e){return function(n){return s(l.append(l.semigroupArray)(e)(n))}},r.uncons=f,r.sortBy=function(e){return v(o.sortBy(e))},r.sortWith=function(e){return function(n){return v(o.sortWith(e)(n))}},r.zipWith=function(e){return function(n){return function(t){return s(o.zipWith(e)(n)(t))}}},r.zip=function(e){return function(n){return s(o.zip(e)(n))}}}(c),function(e){"use strict";e["Ctl.Internal.Partition"]=e["Ctl.Internal.Partition"]||{};var n,t,r=e["Ctl.Internal.Partition"],o=e["Data.Array"],a=e["Data.Array.NonEmpty"],u=e["Data.Array.NonEmpty.Internal"],i=e["Data.BigInt"],c=e["Data.Boolean"],l=e["Data.Eq"],s=e["Data.EuclideanRing"],f=e["Data.Foldable"],d=e["Data.Function"],v=e["Data.Functor"],m=e["Data.HeytingAlgebra"],p=e["Data.Maybe"],g=e["Data.Newtype"],y=e["Data.Ord"],b=e["Data.Ordering"],w=e["Data.Ring"],C=e["Data.Semigroup"],h=e["Data.Semiring"],A=e["Data.Tuple"],S=function(e){return e},I=(n=p.fromJust(),function(e){return n(i.toInt(e))}),T=function(e){return function(n){return function(t){return new A.Tuple(s.div(e)(n)(t),s.mod(e)(n)(t))}}},D={equipartition:function(e){return function(n){if(n<=1)return a.singleton(e);if(c.otherwise){var t=v.map(A.functorTuple)(I)(T(i.euclideanRingBigInt)(e)(i.fromInt(n)));return a.appendArray(a.replicate(n-t.value1|0)(t.value0))(o.replicate(t.value1)(h.add(i.semiringBigInt)(t.value0)(h.one(i.semiringBigInt))))}throw new Error("Failed pattern match at Ctl.Internal.Partition (line 102, column 1 - line 111, column 61): "+[e.constructor.name,n.constructor.name])}}},F=(t=p.fromJust(),function(e){return t(a.fromArray(e))}),E={partition:function(e){return function(n){if(f.any(u.foldableNonEmptyArray)(m.heytingAlgebraBoolean)((function(e){return y.lessThan(i.ordBigInt)(e)(h.zero(i.semiringBigInt))}))(n))return p.Nothing.value;if(l.eq(i.eqBigInt)(f.sum(u.foldableNonEmptyArray)(i.semiringBigInt)(n))(h.zero(i.semiringBigInt)))return p.Nothing.value;if(c.otherwise){var t=f.sum(u.foldableNonEmptyArray)(i.semiringBigInt)(n),r=v.mapFlipped(u.functorNonEmptyArray)(n)((function(n){return T(i.euclideanRingBigInt)(h.mul(i.semiringBigInt)(e)(n))(t)})),s=I(w.sub(i.ringBigInt)(e)(f.sum(u.foldableNonEmptyArray)(i.semiringBigInt)(v.map(u.functorNonEmptyArray)(A.fst)(r)))),D=v.map(u.functorNonEmptyArray)(A.snd)(a.sortBy(y.comparing(y.ordInt)(A.fst))((E=a.sortBy(d.on((function(e){var n,t=y.compare((n=i.ordBigInt,{compare:function(e){return function(t){var r=y.compare(n)(e.value1)(t.value1);return r instanceof b.EQ?y.compare(n)(e.value0)(t.value0):r}},Eq0:function(){return e=n.Eq0(),A.eqTuple(e)(e);var e}}))(e);return function(e){return b.invert(t(e))}}))(A.snd))(a.zip(a.range(1)(f.length(u.foldableNonEmptyArray)(h.semiringInt)(r)))(v.map(u.functorNonEmptyArray)(S)(r))),a.zipWith(h.add(A.semiringTuple(h.semiringInt)(i.semiringBigInt)))(v.map(u.functorNonEmptyArray)(v.map(A.functorTuple)((x=g.unwrap(),function(e){return A.fst(x(e))})))(E))(F(C.append(C.semigroupArray)(o.replicate(s)(h.one(A.semiringTuple(h.semiringInt)(i.semiringBigInt))))(o.replicate(f.length(u.foldableNonEmptyArray)(h.semiringInt)(E)-s|0)(h.zero(A.semiringTuple(h.semiringInt)(i.semiringBigInt)))))))));return new p.Just(D)}var E,x;throw new Error("Failed pattern match at Ctl.Internal.Partition (line 42, column 1 - line 91, column 33): "+[e.constructor.name,n.constructor.name])}}};r.equipartition=function(e){return e.equipartition},r.partition=function(e){return e.partition},r.partitionBigInt=E,r.equipartitionBigInt=D}(c),function(e){let n;n=TextDecoder,e.assetNameName=("name",e=>e.name())}(c["Ctl.Internal.Types.TokenName"]=c["Ctl.Internal.Types.TokenName"]||{}),function(e){"use strict";e["Ctl.Internal.Types.TokenName"]=e["Ctl.Internal.Types.TokenName"]||{};var n=e["Ctl.Internal.Types.TokenName"],t=e["Ctl.Internal.Types.TokenName"],r=e["Control.Applicative"],o=e["Ctl.Internal.FromData"],a=e["Ctl.Internal.ToData"],u=e["Ctl.Internal.Types.ByteArray"],i=e["Ctl.Internal.Types.RawBytes"],c=e["Data.Boolean"],l=e["Data.Maybe"],s=e["Data.Monoid"],f=e["Data.Newtype"],d=e["Data.Show"],v=a.toDataRawBytes,m={show:function(e){return"(TokenName "+d.show(i.showRawBytes)(e)+")"}},p=i.ordRawBytes,g=o.fromDataRawBytes,y=i.eqRawBytes,b=s.mempty(i.monoidRawBytes);n.adaToken=b,n.getTokenName=function(e){return f.unwrap()(e)},n.mkTokenName=function(e){if(u.byteLength(e)<=32)return r.pure(l.applicativeMaybe)(f.wrap()(e));if(c.otherwise)return l.Nothing.value;throw new Error("Failed pattern match at Ctl.Internal.Types.TokenName (line 106, column 1 - line 106, column 44): "+[e.constructor.name])},n.eqTokenName=y,n.fromDataTokenName=g,n.ordTokenName=p,n.toDataTokenName=v,n.showTokenName=m,n.assetNameName=t.assetNameName}(c),function(e){"use strict";e.mapWithIndexArray=function(e){return function(n){for(var t=n.length,r=Array(t),o=0;ot=>r=>{try{return e.valid(n[t].from_bytes(r))}catch(n){return e.error(t+".from_bytes() raised "+n)}}}(c["Ctl.Internal.Deserialization.FromBytes"]=c["Ctl.Internal.Deserialization.FromBytes"]||{}),function(e){"use strict";e["Data.Variant"]=e["Data.Variant"]||{};var n=e["Data.Variant"],t=e["Data.Symbol"];n.inj=function(){return function(e){return function(n){return function(r){return{type:t.reflectSymbol(e)(n),value:r}}}}}}(c),function(e){"use strict";e["Ctl.Internal.Deserialization.Error"]=e["Ctl.Internal.Deserialization.Error"]||{};var n=e["Ctl.Internal.Deserialization.Error"],t=e["Ctl.Internal.FfiHelpers"],r=e["Data.Variant"],o=e["Type.Proxy"].Proxy.value,a=t.errorHelper(r.inj()({reflectSymbol:function(){return"fromBytesError"}})(o));n.fromBytesErrorHelper=a}(c),function(e){"use strict";e["Ctl.Internal.Deserialization.FromBytes"]=e["Ctl.Internal.Deserialization.FromBytes"]||{};var n=e["Ctl.Internal.Deserialization.FromBytes"],t=e["Ctl.Internal.Deserialization.FromBytes"],r=e["Control.Applicative"],o=e["Ctl.Internal.Deserialization.Error"],a=e["Data.Either"],u=e["Data.Maybe"],i=e["Data.Newtype"],c=e.Effect,l=e["Effect.Exception"],s=t._fromBytes(o.fromBytesErrorHelper),f={"fromBytes'":s("Address")},d={"fromBytes'":s("AuxiliaryDataHash")},v={"fromBytes'":s("DataHash")},m={"fromBytes'":s("Ed25519Signature")},p={"fromBytes'":s("GeneralTransactionMetadata")},g={"fromBytes'":s("GenesisDelegateHash")},y={"fromBytes'":s("GenesisHash")},b={"fromBytes'":s("NativeScript")},w={"fromBytes'":s("PlutusData")},C={"fromBytes'":s("PoolMetadataHash")},h={"fromBytes'":s("PublicKey")},A={"fromBytes'":s("ScriptDataHash")},S={"fromBytes'":s("TransactionHash")},I={"fromBytes'":s("TransactionUnspentOutput")},T={"fromBytes'":s("TransactionWitnessSet")},D={"fromBytes'":s("VRFKeyHash")},F={"fromBytes'":s("Value")},E=function(e){var n=e["fromBytes'"],t=i.unwrap();return function(e){return a.hush(n(t(e)))}};n.fromBytes=E,n.fromBytesEffect=function(e){return function(n){var t=E(e)(n);if(t instanceof u.Nothing)return l.throw("from_bytes() call failed");if(t instanceof u.Just)return r.pure(c.applicativeEffect)(t.value0);throw new Error("Failed pattern match at Ctl.Internal.Deserialization.FromBytes (line 142, column 3 - line 144, column 21): "+[t.constructor.name])}},n.fromBytesAddress=f,n.fromBytesAuxiliaryDataHas=d,n.fromBytesDataHash=v,n.fromBytesEd25519Signature=m,n.fromBytesGeneralTransacti=p,n.fromBytesGenesisDelegateH=g,n.fromBytesGenesisHash=y,n.fromBytesNativeScript=b,n.fromBytesPlutusData=w,n.fromBytesPoolMetadataHash=C,n.fromBytesPublicKey=h,n.fromBytesScriptDataHash=A,n.fromBytesTransactionHash=S,n.fromBytesTransactionUnspe=I,n.fromBytesTransactionWitne=T,n.fromBytesValue=F,n.fromBytesVRFKeyHash=D}(c),function(e){let n;n=t(1164),n=t(6359)(n),e._publicKeyFromBech32=e=>t=>{try{return e.just(n.PublicKey.from_bech32(t))}catch(n){return e.nothing}},e._ed25519SignatureFromBech32=e=>t=>{try{return e.just(n.Ed25519Signature.from_bech32(t))}catch(n){return e.nothing}},e._privateKeyFromBytes=e=>t=>{try{return e.just(n.PrivateKey.from_normal_bytes(t))}catch(n){return e.nothing}}}(c["Ctl.Internal.Deserialization.Keys"]=c["Ctl.Internal.Deserialization.Keys"]||{}),function(e){"use strict";e["Ctl.Internal.Deserialization.Keys"]=e["Ctl.Internal.Deserialization.Keys"]||{};var n=e["Ctl.Internal.Deserialization.Keys"],t=e["Ctl.Internal.Deserialization.Keys"],r=e["Ctl.Internal.FfiHelpers"],o=t._publicKeyFromBech32(r.maybeFfiHelper),a=t._privateKeyFromBytes(r.maybeFfiHelper),u=t._ed25519SignatureFromBech32(r.maybeFfiHelper);n.publicKeyFromBech32=o,n.privateKeyFromBytes=a,n.ed25519SignatureFromBech32=u}(c),function(e){e.bytesFromPublicKey=e=>e.as_bytes(),e.publicKeyFromPrivateKey=e=>e.to_public();const n=e=>e.to_bech32();e.bech32FromPublicKey=n,e.bech32FromEd25519Signature=n}(c["Ctl.Internal.Serialization.Keys"]=c["Ctl.Internal.Serialization.Keys"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.Keys"]=e["Ctl.Internal.Serialization.Keys"]||{};var n=e["Ctl.Internal.Serialization.Keys"],t=e["Ctl.Internal.Serialization.Keys"];n.bytesFromPublicKey=t.bytesFromPublicKey,n.bech32FromPublicKey=t.bech32FromPublicKey,n.bech32FromEd25519Signature=t.bech32FromEd25519Signature,n.publicKeyFromPrivateKey=t.publicKeyFromPrivateKey}(c),function(e){e._toBytes=e=>e.to_bytes()}(c["Ctl.Internal.Serialization.ToBytes"]=c["Ctl.Internal.Serialization.ToBytes"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.ToBytes"]=e["Ctl.Internal.Serialization.ToBytes"]||{};var n=e["Ctl.Internal.Serialization.ToBytes"],t=e["Ctl.Internal.Serialization.ToBytes"],r=e["Ctl.Internal.Types.CborBytes"];n.toBytes=function(){return function(e){return r.CborBytes(t._toBytes(e))}}}(c),function(e){let n;n=t(1164),n=t(6359)(n),e.newPositive=n.Int.new,e.newNegative=n.Int.new_negative,e._intToStr=e=>e.to_str()}(c["Ctl.Internal.Types.Int"]=c["Ctl.Internal.Types.Int"]||{}),function(e){"use strict";e["Ctl.Internal.Types.Int"]=e["Ctl.Internal.Types.Int"]||{};var n=e["Ctl.Internal.Types.Int"],t=e["Ctl.Internal.Types.Int"],r=e.Aeson,o=e["Control.Alt"],a=e["Control.Bind"],u=e["Ctl.Internal.Types.BigNum"],i=e["Data.Argonaut.Decode.Error"],c=e["Data.BigInt"],l=e["Data.Either"],s=e["Data.Eq"],f=e["Data.Function"],d=e["Data.Functor"],v=e["Data.Maybe"],m=e["Data.Ord"],p=e["Data.Ring"],g={show:t._intToStr},y={eq:f.on(s.eq(s.eqString))(t._intToStr)},b={compare:f.on(m.compare(c.ordBigInt))((function(e){return v.fromJust()(c.fromString(t._intToStr(e)))})),Eq0:function(){return y}},w=function(e){return o.alt(v.altMaybe)(d.map(v.functorMaybe)(t.newPositive)(u.fromBigInt(e)))(d.map(v.functorMaybe)(t.newNegative)(u.fromBigInt(p.negate(c.ringBigInt)(e))))},C=(a.composeKleisliFlipped(v.bindMaybe)(w)(c.fromString),{decodeAeson:function(e){return a.bind(l.bindEither)(r.decodeAeson(r.decodeAesonBigInt)(e))((n=l.note(new i.TypeMismatch("Int")),function(e){return n(w(e))}));var n}});n.eqInt=y,n.ordInt=b,n.showInt=g,n.decodeAesonInt=C}(c),function(e){"use strict";e["Ctl.Internal.Types.Datum"]=e["Ctl.Internal.Types.Datum"]||{};var n=e["Ctl.Internal.Types.Datum"],t=e["Ctl.Internal.FromData"],r=e["Ctl.Internal.ToData"],o=e["Ctl.Internal.Types.PlutusData"],a=e["Data.Show.Generic"],u=r.toDataPlutusData,i={show:a.genericShow({to:function(e){return e},from:function(e){return e}})(a.genericShowConstructor(a.genericShowArgsArgument(o.showPlutusData))({reflectSymbol:function(){return"Datum"}}))},c=t.fromDataPlutusData,l=o.eqPlutusData;n.eqDatum=l,n.fromDataDatum=c,n.toDataDatum=u,n.showDatum=i}(c),function(e){"use strict";e["Ctl.Internal.Types.Transaction"]=e["Ctl.Internal.Types.Transaction"]||{};var n=e["Ctl.Internal.Types.Transaction"],t=e["Control.Apply"],r=e["Ctl.Internal.FromData"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.Types.BigNum"],u=e["Ctl.Internal.Types.ByteArray"],i=e["Ctl.Internal.Types.PlutusData"],c=e["Data.Eq"],l=e["Data.Functor"],s=e["Data.Maybe"],f=e["Data.Ord"],d=e["Data.Ordering"],v=e["Data.Show"],m=e["Data.Show.Generic"],p=e["Data.UInt"],g=function(e){return e},y=function(e){return e},b={toData:function(e){return new i.Constr(a.zero,[o.toData(o.toDataByteArray)(e)])}},w={toData:function(e){return new i.Constr(a.zero,[o.toData(b)(e.transactionId),o.toData(o.toDataUInt)(e.index)])}},C=u.ordByteArray,h={show:m.genericShow({to:function(e){return e},from:function(e){return e}})(m.genericShowConstructor(m.genericShowArgsArgument(u.showByteArray))({reflectSymbol:function(){return"TransactionHash"}}))},A={show:m.genericShow({to:function(e){return e},from:function(e){return e}})(m.genericShowConstructor(m.genericShowArgsArgument(v.showRecord()(v.showRecordFieldsCons({reflectSymbol:function(){return"index"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"transactionId"}})(v.showRecordFieldsNil)(h))(p.uintShowInstance))))({reflectSymbol:function(){return"TransactionInput"}}))},S={show:m.genericShow({to:function(e){return e},from:function(e){return e}})(m.genericShowConstructor(m.genericShowArgsArgument(u.showByteArray))({reflectSymbol:function(){return"DataHash"}}))},I={fromData:function(e){return e instanceof i.Constr&&1===e.value1.length&&c.eq(a.eqBigNum)(e.value0)(a.zero)?l.map(s.functorMaybe)(g)(r.fromData(r.fromDataByteArray)(e.value1[0])):s.Nothing.value}},T={fromData:function(e){return e instanceof i.Constr&&2===e.value1.length&&c.eq(a.eqBigNum)(e.value0)(a.zero)?l.map(s.functorMaybe)(y)(t.apply(s.applyMaybe)(l.map(s.functorMaybe)((function(e){return function(n){return{transactionId:e,index:n}}}))(r.fromData(I)(e.value1[0])))(r.fromData(r.fromDataUInt)(e.value1[1]))):s.Nothing.value}},D=u.eqByteArray,F=c.eqRec()(c.eqRowCons(c.eqRowCons(c.eqRowNil)()({reflectSymbol:function(){return"transactionId"}})(D))()({reflectSymbol:function(){return"index"}})(p.uintEqInstance)),E={compare:function(e){return function(n){return f.compare(f.ordString)(u.byteArrayToHex(e))(u.byteArrayToHex(n))}},Eq0:function(){return D}},x={compare:function(e){return function(n){var t=f.compare(E)(e.transactionId)(n.transactionId);return t instanceof d.EQ?f.compare(p.uintOrd)(e.index)(n.index):t}},Eq0:function(){return F}},M=u.eqByteArray,R=u.decodeAesonByteArray,P=u.decodeAesonByteArray;n.DataHash=function(e){return e},n.eqTransactionInput=F,n.ordTransactionInput=x,n.showTransactionInput=A,n.fromDataTransactionInput=T,n.toDataTransactionInput=w,n.decodeAesonTransactionHas=R,n.ordTransactionHash=E,n.showTransactionHash=h,n.eqDataHash=M,n.ordDataHash=C,n.decodeAesonDataHash=P,n.showDataHash=S}(c),function(e){"use strict";e["Ctl.Internal.Types.OutputDatum"]=e["Ctl.Internal.Types.OutputDatum"]||{};var n=e["Ctl.Internal.Types.OutputDatum"],t=e["Ctl.Internal.Types.Datum"],r=e["Ctl.Internal.Types.Transaction"],o=e["Data.Eq"],a=e["Data.Generic.Rep"],u=e["Data.Maybe"],i=e["Data.Show.Generic"],c=function(){function e(){}return e.value=new e,e}(),l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f={to:function(e){if(e instanceof a.Inl)return c.value;if(e instanceof a.Inr&&e.value0 instanceof a.Inl)return new l(e.value0.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inr)return new s(e.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.OutputDatum (line 38, column 1 - line 38, column 38): "+[e.constructor.name])},from:function(e){if(e instanceof c)return new a.Inl(a.NoArguments.value);if(e instanceof l)return new a.Inr(new a.Inl(e.value0));if(e instanceof s)return new a.Inr(new a.Inr(e.value0));throw new Error("Failed pattern match at Ctl.Internal.Types.OutputDatum (line 38, column 1 - line 38, column 38): "+[e.constructor.name])}},d={show:i.genericShow(f)(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsNoArguments)({reflectSymbol:function(){return"NoOutputDatum"}}))(i.genericShowSum(i.genericShowConstructor(i.genericShowArgsArgument(r.showDataHash))({reflectSymbol:function(){return"OutputDatumHash"}}))(i.genericShowConstructor(i.genericShowArgsArgument(t.showDatum))({reflectSymbol:function(){return"OutputDatum"}}))))},v={eq:function(e){return function(n){return e instanceof c&&n instanceof c||(e instanceof l&&n instanceof l?o.eq(r.eqDataHash)(e.value0)(n.value0):e instanceof s&&n instanceof s&&o.eq(t.eqDatum)(e.value0)(n.value0))}}};n.NoOutputDatum=c,n.OutputDatumHash=l,n.OutputDatum=s,n.outputDatumDataHash=function(e){return e instanceof l?new u.Just(e.value0):u.Nothing.value},n.outputDatumDatum=function(e){return e instanceof s?new u.Just(e.value0):u.Nothing.value},n.eqOutputDatum=v,n.showOutputDatum=d}(c),function(e){"use strict";e["Ctl.Internal.Types.PubKeyHash"]=e["Ctl.Internal.Types.PubKeyHash"]||{};var n=e["Ctl.Internal.Types.PubKeyHash"],t=e["Ctl.Internal.Serialization.Address"],r=e["Ctl.Internal.Serialization.Hash"],o=e["Data.Newtype"],a=e["Data.Show.Generic"],u=r.toDataEd25519KeyHash,i=u,c=r.ordEd25519KeyHash,l={show:a.genericShow({to:function(e){return e},from:function(e){return e}})(a.genericShowConstructor(a.genericShowArgsArgument(r.showEd25519KeyHash))({reflectSymbol:function(){return"PubKeyHash"}}))},s={show:a.genericShow({to:function(e){return e},from:function(e){return e}})(a.genericShowConstructor(a.genericShowArgsArgument(l))({reflectSymbol:function(){return"StakePubKeyHash"}}))},f={show:a.genericShow({to:function(e){return e},from:function(e){return e}})(a.genericShowConstructor(a.genericShowArgsArgument(l))({reflectSymbol:function(){return"PaymentPubKeyHash"}}))},d=r.fromDataEd25519KeyHash,v=d,m=r.eqEd25519KeyHash;n.payPubKeyHashBaseAddress=function(e){return function(n){return function(r){return function(e){return function(n){return function(r){return t.baseAddressToAddress(t.paymentKeyHashStakeKeyHashAddress(e)(o.unwrap()(n))(o.unwrap()(o.unwrap()(r))))}}}(e)(n)(r)}}},n.payPubKeyHashEnterpriseAddress=function(e){return function(n){return function(e){var n,r=(n=e,function(e){return t.enterpriseAddress({network:n,paymentCred:t.keyHashCredential(o.unwrap()(e))})});return function(e){return t.enterpriseAddressToAddress(r(e))}}(e)(n)}},n.stakePubKeyHashRewardAddress=function(e){var n,r=(n=e,function(e){return t.rewardAddress({network:n,paymentCred:t.keyHashCredential(o.unwrap()(e))})}),a=o.unwrap();return function(e){return t.rewardAddressToAddress(r(a(e)))}},n.fromDataPubKeyHash=d,n.toDataPubKeyHash=u,n.showPubKeyHash=l,n.eqPaymentPubKeyHash=m,n.fromDataPaymentPubKeyHash=v,n.ordPaymentPubKeyHash=c,n.toDataPaymentPubKeyHash=i,n.showPaymentPubKeyHash=f,n.showStakePubKeyHash=s}(c),function(e){"use strict";e["Ctl.Internal.Types.RedeemerTag"]=e["Ctl.Internal.Types.RedeemerTag"]||{};var n=e["Ctl.Internal.Types.RedeemerTag"],t=e["Data.Generic.Rep"],r=e["Data.Maybe"],o=e["Data.Ordering"],a=e["Data.Show.Generic"],u=function(){function e(){}return e.value=new e,e}(),i=function(){function e(){}return e.value=new e,e}(),c=function(){function e(){}return e.value=new e,e}(),l=function(){function e(){}return e.value=new e,e}(),s={to:function(e){if(e instanceof t.Inl)return u.value;if(e instanceof t.Inr&&e.value0 instanceof t.Inl)return i.value;if(e instanceof t.Inr&&e.value0 instanceof t.Inr&&e.value0.value0 instanceof t.Inl)return c.value;if(e instanceof t.Inr&&e.value0 instanceof t.Inr&&e.value0.value0 instanceof t.Inr)return l.value;throw new Error("Failed pattern match at Ctl.Internal.Types.RedeemerTag (line 25, column 1 - line 25, column 38): "+[e.constructor.name])},from:function(e){if(e instanceof u)return new t.Inl(t.NoArguments.value);if(e instanceof i)return new t.Inr(new t.Inl(t.NoArguments.value));if(e instanceof c)return new t.Inr(new t.Inr(new t.Inl(t.NoArguments.value)));if(e instanceof l)return new t.Inr(new t.Inr(new t.Inr(t.NoArguments.value)));throw new Error("Failed pattern match at Ctl.Internal.Types.RedeemerTag (line 25, column 1 - line 25, column 38): "+[e.constructor.name])}},f={show:a.genericShow(s)(a.genericShowSum(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Spend"}}))(a.genericShowSum(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Mint"}}))(a.genericShowSum(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Cert"}}))(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Reward"}})))))},d={eq:function(e){return function(n){return e instanceof u&&n instanceof u||e instanceof i&&n instanceof i||e instanceof c&&n instanceof c||e instanceof l&&n instanceof l}}},v={compare:function(e){return function(n){if(e instanceof u&&n instanceof u)return o.EQ.value;if(e instanceof u)return o.LT.value;if(n instanceof u)return o.GT.value;if(e instanceof i&&n instanceof i)return o.EQ.value;if(e instanceof i)return o.LT.value;if(n instanceof i)return o.GT.value;if(e instanceof c&&n instanceof c)return o.EQ.value;if(e instanceof c)return o.LT.value;if(n instanceof c)return o.GT.value;if(e instanceof l&&n instanceof l)return o.EQ.value;throw new Error("Failed pattern match at Ctl.Internal.Types.RedeemerTag (line 27, column 1 - line 27, column 32): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return d}};n.Spend=u,n.Mint=i,n.Cert=c,n.Reward=l,n.fromString=function(e){return"spend"===e?new r.Just(u.value):"mint"===e?new r.Just(i.value):"certificate"===e?new r.Just(c.value):"withdrawal"===e?new r.Just(l.value):r.Nothing.value},n.eqRedeemerTag=d,n.ordRedeemerTag=v,n.showRedeemerTag=f}(c),function(e){"use strict";e["Ctl.Internal.Types.RewardAddress"]=e["Ctl.Internal.Types.RewardAddress"]||{};var n=e["Ctl.Internal.Types.RewardAddress"],t=e["Ctl.Internal.Serialization.Address"],r=e["Data.Newtype"],o=t.showRewardAddress,a=t.ordRewardAddress,u=t.eqRewardAddress,i=t.decodeAesonRewardAddress;n.rewardAddressToBech32=function(e){return t.rewardAddressBech32(e)},n.stakePubKeyHashRewardAddress=function(e){return function(n){return t.rewardAddress({network:e,paymentCred:t.keyHashCredential(r.unwrap()(r.unwrap()(n)))})}},n.stakeValidatorHashRewardAddress=function(e){return function(n){return t.rewardAddress({network:e,paymentCred:t.scriptHashCredential(r.unwrap()(n))})}},n.unRewardAddress=function(e){return e},n.eqRewardAddress=u,n.ordRewardAddress=a,n.showRewardAddress=o,n.decodeAesonRewardAddress=i}(c),function(e){"use strict";e["Ctl.Internal.Types.TransactionMetadata"]=e["Ctl.Internal.Types.TransactionMetadata"]||{};var n=e["Ctl.Internal.Types.TransactionMetadata"],t=e["Ctl.Internal.Helpers"],r=e["Ctl.Internal.Types.ByteArray"],o=e["Ctl.Internal.Types.Int"],a=e["Data.BigInt"],u=e["Data.Eq"],i=e["Data.Generic.Rep"],c=e["Data.Map.Internal"],l=e["Data.Ord"],s=e["Data.Ordering"],f=e["Data.Show"],d=e["Data.Show.Generic"],v=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),m=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),p=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),g=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),y=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),b={show:function(e){return t.showWithParens(a.showBigInt)("TransactionMetadatumLabel")(e)}},w=a.ordBigInt,C={append:function(e){return function(n){return t.appendRightMap(w)(e)(n)}}},h={to:function(e){if(e instanceof i.Inl)return new v(e.value0);if(e instanceof i.Inr&&e.value0 instanceof i.Inl)return new m(e.value0.value0);if(e instanceof i.Inr&&e.value0 instanceof i.Inr&&e.value0.value0 instanceof i.Inl)return new p(e.value0.value0.value0);if(e instanceof i.Inr&&e.value0 instanceof i.Inr&&e.value0.value0 instanceof i.Inr&&e.value0.value0.value0 instanceof i.Inl)return new g(e.value0.value0.value0.value0);if(e instanceof i.Inr&&e.value0 instanceof i.Inr&&e.value0.value0 instanceof i.Inr&&e.value0.value0.value0 instanceof i.Inr)return new y(e.value0.value0.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.TransactionMetadata (line 79, column 1 - line 79, column 47): "+[e.constructor.name])},from:function(e){if(e instanceof v)return new i.Inl(e.value0);if(e instanceof m)return new i.Inr(new i.Inl(e.value0));if(e instanceof p)return new i.Inr(new i.Inr(new i.Inl(e.value0)));if(e instanceof g)return new i.Inr(new i.Inr(new i.Inr(new i.Inl(e.value0))));if(e instanceof y)return new i.Inr(new i.Inr(new i.Inr(new i.Inr(e.value0))));throw new Error("Failed pattern match at Ctl.Internal.Types.TransactionMetadata (line 79, column 1 - line 79, column 47): "+[e.constructor.name])}},A={show:function(e){return d.genericShow(h)(d.genericShowSum(d.genericShowConstructor(d.genericShowArgsArgument(c.showMap(A)(A)))({reflectSymbol:function(){return"MetadataMap"}}))(d.genericShowSum(d.genericShowConstructor(d.genericShowArgsArgument(f.showArray(A)))({reflectSymbol:function(){return"MetadataList"}}))(d.genericShowSum(d.genericShowConstructor(d.genericShowArgsArgument(o.showInt))({reflectSymbol:function(){return"Int"}}))(d.genericShowSum(d.genericShowConstructor(d.genericShowArgsArgument(r.showByteArray))({reflectSymbol:function(){return"Bytes"}}))(d.genericShowConstructor(d.genericShowArgsArgument(f.showString))({reflectSymbol:function(){return"Text"}}))))))(e)}},S={show:d.genericShow({to:function(e){return e},from:function(e){return e}})(d.genericShowConstructor(d.genericShowArgsArgument(c.showMap(b)(A)))({reflectSymbol:function(){return"GeneralTransactionMetadata"}}))},I={eq:function(e){return function(n){return e instanceof v&&n instanceof v?u.eq(c.eqMap(I)(I))(e.value0)(n.value0):e instanceof m&&n instanceof m?u.eq(u.eqArray(I))(e.value0)(n.value0):e instanceof p&&n instanceof p?u.eq(o.eqInt)(e.value0)(n.value0):e instanceof g&&n instanceof g?u.eq(r.eqByteArray)(e.value0)(n.value0):e instanceof y&&n instanceof y&&e.value0===n.value0}}},T={compare:function(e){return function(n){if(e instanceof v&&n instanceof v)return l.compare(c.ordMap(T)(T))(e.value0)(n.value0);if(e instanceof v)return s.LT.value;if(n instanceof v)return s.GT.value;if(e instanceof m&&n instanceof m)return l.compare(l.ordArray(T))(e.value0)(n.value0);if(e instanceof m)return s.LT.value;if(n instanceof m)return s.GT.value;if(e instanceof p&&n instanceof p)return l.compare(o.ordInt)(e.value0)(n.value0);if(e instanceof p)return s.LT.value;if(n instanceof p)return s.GT.value;if(e instanceof g&&n instanceof g)return l.compare(r.ordByteArray)(e.value0)(n.value0);if(e instanceof g)return s.LT.value;if(n instanceof g)return s.GT.value;if(e instanceof y&&n instanceof y)return l.compare(l.ordString)(e.value0)(n.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.TransactionMetadata (line 78, column 1 - line 78, column 41): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return I}};n.MetadataMap=v,n.MetadataList=m,n.Int=p,n.Bytes=g,n.Text=y,n.TransactionMetadatumLabel=function(e){return e},n.showGeneralTransactionMet=S,n.semigroupGeneralTransacti=C,n.ordTransactionMetadatumLa=w,n.ordTransactionMetadatum=T}(c),function(e){"use strict";e["Ctl.Internal.Types.VRFKeyHash"]=e["Ctl.Internal.Types.VRFKeyHash"]||{};var n=e["Ctl.Internal.Types.VRFKeyHash"],t=e["Ctl.Internal.Serialization.ToBytes"],r=e["Ctl.Internal.Types.ByteArray"],o=e["Data.Eq"],a=e["Data.Function"],u=e["Data.Newtype"],i=e["Data.Show"],c={show:function(e){return"(VRFKeyHash "+i.show(i.showString)(r.byteArrayToHex(u.unwrap()(t.toBytes()(e))))+")"}},l={eq:a.on(o.eq(r.eqByteArray))((function(e){return u.unwrap()(t.toBytes()(e))}))};n.VRFKeyHash=function(e){return e},n.unVRFKeyHash=function(e){return e},n.showVRFKeyHash=c,n.eqVRFKeyHash=l}(c),function(e){"use strict";e["Data.Profunctor"]=e["Data.Profunctor"]||{};var n=e["Data.Profunctor"];n.dimap=function(e){return e.dimap},n.profunctorFn={dimap:function(e){return function(n){return function(t){return function(r){return n(t(e(r)))}}}}}}(c),function(e){"use strict";e["Data.Lens.Iso"]=e["Data.Lens.Iso"]||{};var n=e["Data.Lens.Iso"],t=e["Data.Boolean"],r=e["Data.Eq"],o=e["Data.Maybe"],a=e["Data.Profunctor"],u=function(e){return function(n){return function(t){return function(r){return a.dimap(t)(e)(n)(r)}}}};n.iso=u,n.non=function(e){return function(n){return function(a){return u(o.fromMaybe(n))((function(a){if(r.eq(e)(a)(n))return o.Nothing.value;if(t.otherwise)return new o.Just(a);throw new Error("Failed pattern match at Data.Lens.Iso (line 45, column 9 - line 46, column 33): "+[a.constructor.name])}))(a)}}}}(c),function(e){"use strict";e["Data.Lens.Iso.Newtype"]=e["Data.Lens.Iso.Newtype"]||{};var n=e["Data.Lens.Iso.Newtype"],t=e["Data.Lens.Iso"],r=e["Data.Newtype"];n._Newtype=function(){return function(){return function(e){return t.iso(r.unwrap())(r.wrap())(e)}}}}(c),function(e){"use strict";e["Data.Profunctor.Strong"]=e["Data.Profunctor.Strong"]||{};var n=e["Data.Profunctor.Strong"],t=e["Data.Functor"],r=e["Data.Profunctor"],o=e["Data.Tuple"],a={first:function(e){return function(n){return new o.Tuple(e(n.value0),n.value1)}},second:t.map(o.functorTuple),Profunctor0:function(){return r.profunctorFn}};n.first=function(e){return e.first},n.strongFn=a}(c),function(e){"use strict";e["Data.Lens.Lens"]=e["Data.Lens.Lens"]||{};var n=e["Data.Lens.Lens"],t=e["Data.Profunctor"],r=e["Data.Profunctor.Strong"],o=e["Data.Tuple"],a=function(e){return function(n){return function(o){return t.dimap(n.Profunctor0())(e)((function(e){return e.value1(e.value0)}))(r.first(n)(o))}}};n.lens=function(e){return function(n){return function(t){return a((function(t){return new o.Tuple(e(t),(function(e){return n(t)(e)}))}))(t)}}},n["lens'"]=a}(c),function(e){"use strict";e["Data.Lens.Record"]=e["Data.Lens.Record"]||{};var n=e["Data.Lens.Record"],t=e["Data.Function"],r=e["Data.Lens.Lens"],o=e.Record;n.prop=function(e){return function(){return function(){return function(n){return function(a){return r.lens(o.get(e)()(n))(t.flip(o.set(e)()()(n)))(a)}}}}}}(c),function(e){"use strict";e["Data.Set"]=e["Data.Set"]||{};var n=e["Data.Set"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Rec.Class"],a=e["Control.Monad.ST.Internal"],u=e["Data.Array"],i=e["Data.Array.ST"],c=e["Data.Eq"],l=e["Data.Foldable"],s=e["Data.Function"],f=e["Data.List"],d=e["Data.List.Types"],v=e["Data.Map.Internal"],m=e["Data.Maybe"],p=e["Data.Ord"],g=e["Data.Ordering"],y=e["Data.Show"],b=e["Data.Unfoldable"],w=e["Data.Unit"],C=function(e){return function(n){return function(t){return v.union(e)(n)(t)}}},h=function(e){return v.keys(e)},A=function(e){var n=f.toUnfoldable(e);return function(e){return n(h(e))}},S=function(e){return{append:C(e)}},I=function(e){return function(n){return function(t){return v.insert(e)(n)(w.unit)(t)}}},T={foldMap:function(e){return function(n){var t=l.foldMap(d.foldableList)(e)(n);return function(e){return t(h(e))}}},foldl:function(e){return function(n){var t=l.foldl(d.foldableList)(e)(n);return function(e){return t(h(e))}}},foldr:function(e){return function(n){var t=l.foldr(d.foldableList)(e)(n);return function(e){return t(h(e))}}}},D=v.empty,F=function(e){return function(n){return l.foldl(e)((function(e){return function(t){return I(n)(t)(e)}}))(D)}};n.fromFoldable=F,n.toUnfoldable=A,n.empty=D,n.isEmpty=function(e){return v.isEmpty(e)},n.singleton=function(e){return v.singleton(e)(w.unit)},n.insert=I,n.member=function(e){return function(n){return function(t){return v.member(e)(n)(t)}}},n.size=function(e){return v.size(e)},n.union=C,n.difference=function(e){return function(n){return function(t){return l.foldl(d.foldableList)(s.flip(function(e){return function(n){return function(t){return v.delete(e)(n)(t)}}}(e)))(n)(h(t))}}},n.intersection=function(e){return function(n){return function(c){var s,f=(s=u.fromFoldable(d.foldableList),function(e){return s(h(e))}),v=f(c),m=u.length(v),y=f(n),b=u.length(y);return F(l.foldableArray)(e)(r.bind(a.bindST)(r.bind(a.bindST)(i.new)((function(n){return o.tailRecM2(a.monadRecST)((function(r){return function(u){if(r()=>n(e)}(c["Ctl.Internal.QueryM.UniqueId"]=c["Ctl.Internal.QueryM.UniqueId"]||{}),function(e){"use strict";e["Ctl.Internal.QueryM.UniqueId"]=e["Ctl.Internal.QueryM.UniqueId"]||{};var n=e["Ctl.Internal.QueryM.UniqueId"],t=e["Ctl.Internal.QueryM.UniqueId"];n.uniqueId=t.uniqueId}(c),function(e){"use strict";e["Ctl.Internal.QueryM.JsonWsp"]=e["Ctl.Internal.QueryM.JsonWsp"]||{};var n=e["Ctl.Internal.QueryM.JsonWsp"],t=e.Aeson,r=e["Ctl.Internal.QueryM.UniqueId"],o=e["Data.Argonaut.Decode.Error"],a=e["Data.Either"],u=e["Data.Function"],i=e.Record,c=t.caseAesonObject(new a.Left(new o.TypeMismatch("expected object")))(u.flip(t.getField(t.decodeAesonString))("reflection"));n.mkCallType=function(e){return function(n){return function(o){return function(a){return function(){var u=function(e){return function(n){return function(){var t=r.uniqueId(n.methodname+"-")();return i.merge()()({mirror:t})(i.merge()()(e)(n))}}}(n)({methodname:o.methodname,args:o.args(a)})();return{body:t.encodeAeson(e)(u),id:u.mirror}}}}}},n.buildRequest=function(e){return e},n.parseJsonWspResponseId=c}(c),function(e){"use strict";e["Ctl.Internal.QueryM.Dispatcher"]=e["Ctl.Internal.QueryM.Dispatcher"]||{};var n=e["Ctl.Internal.QueryM.Dispatcher"],t=e.Aeson,r=e["Control.Applicative"],o=e["Ctl.Internal.QueryM.JsonWsp"],a=e["Data.Argonaut.Decode.Error"],u=e["Data.Either"],i=e["Data.Map.Internal"],c=e["Data.Maybe"],l=e["Data.Ord"],s=e["Data.Show"],f=e.Effect,d=e["Effect.Exception"],v=e["Effect.Ref"],m=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),p=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),g=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),y=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),b={show:function(e){if(e instanceof m)return"(JsError (message "+s.show(s.showString)(d.message(e.value0))+"))";if(e instanceof p)return"(JsonError "+s.show(a.showJsonDecodeError)(e.value0)+")";if(e instanceof g)return"(FaultError "+s.show(t.showAeson)(e.value0)+")";if(e instanceof y)return"(ListenerCancelled "+s.show(s.showString)(e.value0)+")";throw new Error("Failed pattern match at Ctl.Internal.QueryM.Dispatcher (line 40, column 1 - line 45, column 52): "+[e.constructor.name])}},w=v.new(i.empty),C=v.new(i.empty);n.JsonError=p,n.FaultError=g,n.ListenerCancelled=y,n.dispatchErrorToError=function(e){if(e instanceof m)return e.value0;if(e instanceof p)return d.error(s.show(a.showJsonDecodeError)(e.value0));if(e instanceof g)return d.error("Server responded with `fault`: "+t.stringifyAeson(e.value0));if(e instanceof y)return d.error("Listener cancelled ("+e.value0+")");throw new Error("Failed pattern match at Ctl.Internal.QueryM.Dispatcher (line 47, column 1 - line 47, column 47): "+[e.constructor.name])},n.mkWebsocketDispatch=function(e){return function(n){var t=o.parseJsonWspResponseId(n);if(t instanceof u.Left)return r.pure(f.applicativeEffect)(new u.Left(new p(t.value0)));if(t instanceof u.Right)return function(){var r=v.read(e)(),o=i.lookup(l.ordString)(t.value0)(r);if(o instanceof c.Nothing)return new u.Left(new y(t.value0));if(o instanceof c.Just)return new u.Right(o.value0(n));throw new Error("Failed pattern match at Ctl.Internal.QueryM.Dispatcher (line 76, column 7 - line 78, column 51): "+[o.constructor.name])};throw new Error("Failed pattern match at Ctl.Internal.QueryM.Dispatcher (line 67, column 3 - line 78, column 51): "+[t.constructor.name])}},n.newDispatcher=C,n.newPendingRequests=w,n.showDispatchError=b}(c),function(e){"use strict";e["Ctl.Internal.Service.Helpers"]=e["Ctl.Internal.Service.Helpers"]||{};var n=e["Ctl.Internal.Service.Helpers"],t=e.Aeson,r=e["Control.Apply"],o=e["Control.Bind"],a=e["Ctl.Internal.Cardano.Types.Value"],u=e["Ctl.Internal.Types.ByteArray"],i=e["Ctl.Internal.Types.TokenName"],c=e["Data.Argonaut.Decode.Error"],l=e["Data.Either"],s=e["Data.Maybe"],f=e["Data.Tuple"],d=t.caseAesonString(new l.Left(new c.TypeMismatch("String"))),v=t.caseAesonObject(new l.Left(new c.TypeMismatch("Object"))),m=t.caseAesonArray(new l.Left(new c.TypeMismatch("Array")));n.aesonArray=m,n.aesonString=d,n.aesonObject=v,n.decodeAssetClass=function(e){return function(n){return function(t){var d=function(n){return function(t){return new c.TypeMismatch("In "+e+": Expected hex-encoded "+n+", got: "+t)}};return r.lift2(l.applyEither)(f.Tuple.create)(l.note(d("CurrencySymbol")(n))(o.bindFlipped(s.bindMaybe)(a.mkCurrencySymbol)(u.hexToByteArray(n))))(l.note(d("TokenName")(t))(o.bindFlipped(s.bindMaybe)(i.mkTokenName)(u.hexToByteArray(t))))}}}}(c),function(e){"use strict";e["Ctl.Internal.Types.Epoch"]=e["Ctl.Internal.Types.Epoch"]||{};var n=e["Ctl.Internal.Types.Epoch"],t=e.Aeson.decodeAesonBigInt;n.decodeAesonEpoch=t}(c),function(e){"use strict";e["Ctl.Internal.Types.EraSummaries"]=e["Ctl.Internal.Types.EraSummaries"]||{};var n=e["Ctl.Internal.Types.EraSummaries"],t=e.Aeson,r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Serialization.Address"],u=e["Ctl.Internal.Service.Helpers"],i=e["Ctl.Internal.Types.Epoch"],c=e["Data.BigInt"],l=e["Data.Either"],s=e["Data.Newtype"],f=c.semiringBigInt,d=t.decodeAesonBigInt,v=t.decodeAesonNumber,m={decodeAeson:u.aesonObject((function(e){return o.bind(l.bindEither)(t.getField(v)(e)("time"))((function(n){return o.bind(l.bindEither)(t.getField(a.decodeAesonSlot)(e)("slot"))((function(a){return o.bind(l.bindEither)(t.getField(i.decodeAesonEpoch)(e)("epoch"))((function(e){return r.pure(l.applicativeEither)(s.wrap()({time:n,slot:a,epoch:e}))}))}))}))}))},p=t.decodeAesonBigInt;n.decodeAesonEraSummaryTime=m,n.decodeAesonEpochLength=p,n.semiringSafeZone=f,n.decodeAesonSafeZone=d}(c),function(e){"use strict";e["Ctl.Internal.Types.Natural"]=e["Ctl.Internal.Types.Natural"]||{};var n=e["Ctl.Internal.Types.Natural"],t=e.Aeson,r=e["Control.Bind"],o=e["Control.Category"],a=e["Data.Argonaut.Decode.Error"],u=e["Data.BigInt"],i=e["Data.Boolean"],c=e["Data.Either"],l=e["Data.Function"],s=e["Data.Maybe"],f=e["Data.Ord"],d=e["Data.Ring"],v=e["Data.Semiring"],m=e["Data.Show"],p={show:function(e){return"(fromBigInt' (BigInt."+m.show(u.showBigInt)(e)+"))"}},g=u.semiringBigInt,y=u.ordBigInt,b=u.eqBigInt,w=function(e){return e},C=function(e){return function(n){return function(t){return function(r){if(f.greaterThanOrEq(n)(r)(v.zero(e)))return t(r);if(i.otherwise)return d.negate(u.ringBigInt)(t(r));throw new Error("Failed pattern match at Ctl.Internal.Types.Natural (line 67, column 1 - line 68, column 78): "+[t.constructor.name,r.constructor.name])}}}},h=function(e){return function(n){return function(t){return function(r){if(f.greaterThanOrEq(n)(r)(v.zero(e)))return new s.Just(t(r));if(i.otherwise)return s.Nothing.value;throw new Error("Failed pattern match at Ctl.Internal.Types.Natural (line 59, column 1 - line 60, column 79): "+[t.constructor.name,r.constructor.name])}}}},A=C(v.semiringInt)(f.ordInt)(u.fromInt),S=(h(v.semiringInt)(f.ordInt)(u.fromInt),C(u.semiringBigInt)(u.ordBigInt)(o.identity(o.categoryFn))),I=h(u.semiringBigInt)(u.ordBigInt)(o.identity(o.categoryFn)),T=r.composeKleisliFlipped(s.bindMaybe)(I)(u.fromString),D={decodeAeson:t.caseAesonBigInt(new c.Left(new a.TypeMismatch("Expected BigInt from Aeson decoding")))((function(e){return c.note(new a.TypeMismatch("Invalid Natural number: "+m.show(u.showBigInt)(e)))(I(e))}))};n["fromBigInt'"]=S,n["fromInt'"]=A,n.fromString=T,n.minus=function(e){var n,t=s.fromMaybe(v.zero(g)),r=(n=d.sub(u.ringBigInt),function(e){var t=l.on(n)(w)(e);return function(e){return I(t(e))}})(e);return function(e){return t(r(e))}},n.toBigInt=w,n.eqNatural=b,n.ordNatural=y,n.semiringNatural=g,n.showNatural=p,n.decodeAesonNatural=D}(c),function(e){"use strict";e["Heterogeneous.Folding"]=e["Heterogeneous.Folding"]||{};var n=e["Heterogeneous.Folding"],t=e.Record,r=e["Type.Proxy"],o=function(e){return e.foldlRecordRowList};n.hfoldl=function(e){return e.hfoldl},n.functionFolding={folding:function(e){return e}},n.constFolding=function(e){return{foldingWithIndex:function(n){return function(t){return e.folding(n)}}}},n.hfoldlRecord=function(){return function(e){return{hfoldl:function(n){return function(t){return o(e)(n)(t)(r.Proxy.value)}}}}},n.foldlRecordCons=function(e){return function(){return function(n){return function(a){return{foldlRecordRowList:function(u){return function(i){return function(c){return function(c){return o(a)(u)(n.foldingWithIndex(u)(r.Proxy.value)(i)(t.get(e)()(r.Proxy.value)(c)))(r.Proxy.value)(c)}}}}}}}}},n.foldlRecordNil={foldlRecordRowList:function(e){return function(e){return function(n){return function(n){return e}}}}}}(c),function(e){"use strict";e["Ctl.Internal.Types.ProtocolParameters"]=e["Ctl.Internal.Types.ProtocolParameters"]||{};var n=e["Ctl.Internal.Types.ProtocolParameters"],t=e["Data.Array"],r=e["Data.List"],o=e["Data.List.Types"],a=e["Data.Monoid"],u=e["Data.Newtype"],i=e["Data.Unfoldable"],c=e["Heterogeneous.Folding"],l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f=function(e){return function(n){return u.wrap()(t.reverse(r.toUnfoldable(i.unfoldableArray)(c.hfoldl(e)((function(e){return function(n){return new o.Cons(n,e)}}))(a.mempty(o.monoidList))(n))))}},d=f(c.hfoldlRecord()(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"bData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"bData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"blake2b_256-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"blake2b_256-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"blake2b_256-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekApplyCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekApplyCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekBuiltinCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekBuiltinCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekConstCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekConstCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekDelayCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekDelayCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekForceCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekForceCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekLamCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekLamCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekStartupCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekStartupCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekVarCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekVarCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseUnit-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseUnit-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"constrData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"constrData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsData-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsData-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsInteger-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"fstPair-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"fstPair-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"headList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"headList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"iData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"iData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"ifThenElse-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"ifThenElse-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"indexByteString-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"indexByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lengthOfByteString-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lengthOfByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsInteger-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanInteger-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"listData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"listData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mapData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mapData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkCons-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkCons-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilPairData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilPairData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkPairData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkPairData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"nullList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"nullList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha2_256-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha2_256-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha2_256-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha3_256-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha3_256-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha3_256-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sndPair-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sndPair-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"tailList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"tailList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"trace-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"trace-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unBData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unBData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unConstrData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unConstrData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unIData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unIData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unListData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unListData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unMapData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unMapData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEd25519Signature-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordNil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))),v=f(c.hfoldlRecord()(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"addInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendByteString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"appendString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"bData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"bData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"blake2b_256-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"blake2b_256-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"blake2b_256-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekApplyCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekApplyCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekBuiltinCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekBuiltinCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekConstCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekConstCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekDelayCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekDelayCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekForceCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekForceCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekLamCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekLamCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekStartupCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekStartupCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekVarCost-exBudgetCPU"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"cekVarCost-exBudgetMemory"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseUnit-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"chooseUnit-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"consByteString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"constrData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"constrData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"decodeUtf8-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"divideInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"encodeUtf8-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsData-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsData-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsInteger-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"equalsString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"fstPair-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"fstPair-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"headList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"headList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"iData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"iData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"ifThenElse-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"ifThenElse-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"indexByteString-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"indexByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lengthOfByteString-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lengthOfByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsByteString-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanEqualsInteger-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"lessThanInteger-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"listData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"listData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mapData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mapData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkCons-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkCons-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilPairData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkNilPairData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkPairData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"mkPairData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"modInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"multiplyInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"nullList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"nullList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"quotientInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-cpu-arguments-constant"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-memory-arguments-minimum"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"remainderInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"serialiseData-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"serialiseData-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"serialiseData-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"serialiseData-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha2_256-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha2_256-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha2_256-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha3_256-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha3_256-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sha3_256-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sliceByteString-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sndPair-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"sndPair-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-memory-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"subtractInteger-memory-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"tailList-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"tailList-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"trace-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"trace-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unBData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unBData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unConstrData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unConstrData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unIData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unIData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unListData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unListData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unMapData-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"unMapData-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEcdsaSecp256k1Signature-cpu-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEcdsaSecp256k1Signature-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifyEd25519Signature-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-cpu-arguments-intercept"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-cpu-arguments-slope"}})()(c.constFolding(c.functionFolding))(c.foldlRecordCons({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-memory-arguments"}})()(c.constFolding(c.functionFolding))(c.foldlRecordNil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))));n.CoinsPerUtxoByte=l,n.CoinsPerUtxoWord=s,n.convertPlutusV1CostModel=d,n.convertPlutusV2CostModel=v}(c),function(e){"use strict";e["Data.Ratio"]=e["Data.Ratio"]||{};var n=e["Data.Ratio"],t=e["Data.EuclideanRing"],r=e["Data.Ord"],o=e["Data.Semiring"],a=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),u=function(e){return function(n){return function(u){return function(i){var c=t.gcd(e.Eq0())(n)(u)(i),l=t.div(n)(i)(c);return new a(o.mul(n.CommutativeRing0().Ring0().Semiring0())(t.div(n)(u)(c))(r.signum(e)(n.CommutativeRing0().Ring0())(l)),r.abs(e)(n.CommutativeRing0().Ring0())(l))}}}};n.reduce=u,n.numerator=function(e){return e.value0},n.denominator=function(e){return e.value1},n.semiringRatio=function(e){return function(n){return{one:new a(o.one(n.CommutativeRing0().Ring0().Semiring0()),o.one(n.CommutativeRing0().Ring0().Semiring0())),mul:function(t){return function(r){return u(e)(n)(o.mul(n.CommutativeRing0().Ring0().Semiring0())(t.value0)(r.value0))(o.mul(n.CommutativeRing0().Ring0().Semiring0())(t.value1)(r.value1))}},zero:new a(o.zero(n.CommutativeRing0().Ring0().Semiring0()),o.one(n.CommutativeRing0().Ring0().Semiring0())),add:function(t){return function(r){return u(e)(n)(o.add(n.CommutativeRing0().Ring0().Semiring0())(o.mul(n.CommutativeRing0().Ring0().Semiring0())(t.value0)(r.value1))(o.mul(n.CommutativeRing0().Ring0().Semiring0())(t.value1)(r.value0)))(o.mul(n.CommutativeRing0().Ring0().Semiring0())(t.value1)(r.value1))}}}}}}(c),function(e){"use strict";e["Ctl.Internal.Types.Rational"]=e["Ctl.Internal.Types.Rational"]||{};var n=e["Ctl.Internal.Types.Rational"],t=e["Data.BigInt"],r=e["Data.Boolean"],o=e["Data.Eq"],a=e["Data.Maybe"],u=e["Data.Ratio"],i=e["Data.Semiring"],c=u.semiringRatio(t.ordBigInt)(t.euclideanRingBigInt),l={reduce:function(e){return function(n){if(o.eq(t.eqBigInt)(n)(i.zero(t.semiringBigInt)))return a.Nothing.value;if(r.otherwise)return new a.Just(u.reduce(t.ordBigInt)(t.euclideanRingBigInt)(e)(n));throw new Error("Failed pattern match at Ctl.Internal.Types.Rational (line 128, column 1 - line 131, column 48): "+[e.constructor.name,n.constructor.name])}}};n.reduce=function(e){return e.reduce},n.numerator=function(e){return u.numerator(e)},n.denominator=function(e){return u.denominator(e)},n.semiringRational=c,n.rationalComponentBigInt=l}(c),function(e){"use strict";e.fromDateTimeImpl=function(e,n,t,r,o,a,u){return function(e,n,t,r,o,a,u){var i=new Date(Date.UTC(e,n,t,r,o,a,u));return e>=0&&e<100&&i.setUTCFullYear(e),i}(e,n-1,t,r,o,a,u).getTime()},e.toDateTimeImpl=function(e){return function(n){var t=new Date(n);return e(t.getUTCFullYear())(t.getUTCMonth()+1)(t.getUTCDate())(t.getUTCHours())(t.getUTCMinutes())(t.getUTCSeconds())(t.getUTCMilliseconds())}}}(c["Data.DateTime.Instant"]=c["Data.DateTime.Instant"]||{}),function(e){"use strict";e.canonicalDateImpl=function(e,n,t,r){var o=function(e,n,t){var r=new Date(Date.UTC(e,n,t));return e>=0&&e<100&&r.setUTCFullYear(e),r}(n,t-1,r);return e(o.getUTCFullYear())(o.getUTCMonth()+1)(o.getUTCDate())}}(c["Data.Date"]=c["Data.Date"]||{}),function(e){"use strict";e["Data.Date.Component"]=e["Data.Date.Component"]||{};var n,t,r,o,a,u,i,c,l,s,f,d,v,m,p,g,y=e["Data.Date.Component"],b=e["Data.Boolean"],w=e["Data.Enum"],C=e["Data.Maybe"],h=e["Data.Ord"],A=e["Data.Ordering"],S=function(){function e(){}return e.value=new e,e}(),I=function(){function e(){}return e.value=new e,e}(),T=function(){function e(){}return e.value=new e,e}(),D=function(){function e(){}return e.value=new e,e}(),F=function(){function e(){}return e.value=new e,e}(),E=function(){function e(){}return e.value=new e,e}(),x=function(){function e(){}return e.value=new e,e}(),M=function(){function e(){}return e.value=new e,e}(),R=function(){function e(){}return e.value=new e,e}(),P=function(){function e(){}return e.value=new e,e}(),k=function(){function e(){}return e.value=new e,e}(),B=function(){function e(){}return e.value=new e,e}(),N=function(){function e(){}return e.value=new e,e}(),L=function(){function e(){}return e.value=new e,e}(),_=function(){function e(){}return e.value=new e,e}(),U=function(){function e(){}return e.value=new e,e}(),H=function(){function e(){}return e.value=new e,e}(),q=function(){function e(){}return e.value=new e,e}(),O=function(){function e(){}return e.value=new e,e}(),V=h.ordInt,W=h.ordInt,K={eq:function(e){return function(n){return e instanceof S&&n instanceof S||e instanceof I&&n instanceof I||e instanceof T&&n instanceof T||e instanceof D&&n instanceof D||e instanceof F&&n instanceof F||e instanceof E&&n instanceof E||e instanceof x&&n instanceof x}}},z={compare:function(e){return function(n){if(e instanceof S&&n instanceof S)return A.EQ.value;if(e instanceof S)return A.LT.value;if(n instanceof S)return A.GT.value;if(e instanceof I&&n instanceof I)return A.EQ.value;if(e instanceof I)return A.LT.value;if(n instanceof I)return A.GT.value;if(e instanceof T&&n instanceof T)return A.EQ.value;if(e instanceof T)return A.LT.value;if(n instanceof T)return A.GT.value;if(e instanceof D&&n instanceof D)return A.EQ.value;if(e instanceof D)return A.LT.value;if(n instanceof D)return A.GT.value;if(e instanceof F&&n instanceof F)return A.EQ.value;if(e instanceof F)return A.LT.value;if(n instanceof F)return A.GT.value;if(e instanceof E&&n instanceof E)return A.EQ.value;if(e instanceof E)return A.LT.value;if(n instanceof E)return A.GT.value;if(e instanceof x&&n instanceof x)return A.EQ.value;throw new Error("Failed pattern match at Data.Date.Component (line 154, column 1 - line 154, column 42): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return K}},J={eq:function(e){return function(n){return e instanceof M&&n instanceof M||e instanceof R&&n instanceof R||e instanceof P&&n instanceof P||e instanceof k&&n instanceof k||e instanceof B&&n instanceof B||e instanceof N&&n instanceof N||e instanceof L&&n instanceof L||e instanceof _&&n instanceof _||e instanceof U&&n instanceof U||e instanceof H&&n instanceof H||e instanceof q&&n instanceof q||e instanceof O&&n instanceof O}}},G={compare:function(e){return function(n){if(e instanceof M&&n instanceof M)return A.EQ.value;if(e instanceof M)return A.LT.value;if(n instanceof M)return A.GT.value;if(e instanceof R&&n instanceof R)return A.EQ.value;if(e instanceof R)return A.LT.value;if(n instanceof R)return A.GT.value;if(e instanceof P&&n instanceof P)return A.EQ.value;if(e instanceof P)return A.LT.value;if(n instanceof P)return A.GT.value;if(e instanceof k&&n instanceof k)return A.EQ.value;if(e instanceof k)return A.LT.value;if(n instanceof k)return A.GT.value;if(e instanceof B&&n instanceof B)return A.EQ.value;if(e instanceof B)return A.LT.value;if(n instanceof B)return A.GT.value;if(e instanceof N&&n instanceof N)return A.EQ.value;if(e instanceof N)return A.LT.value;if(n instanceof N)return A.GT.value;if(e instanceof L&&n instanceof L)return A.EQ.value;if(e instanceof L)return A.LT.value;if(n instanceof L)return A.GT.value;if(e instanceof _&&n instanceof _)return A.EQ.value;if(e instanceof _)return A.LT.value;if(n instanceof _)return A.GT.value;if(e instanceof U&&n instanceof U)return A.EQ.value;if(e instanceof U)return A.LT.value;if(n instanceof U)return A.GT.value;if(e instanceof H&&n instanceof H)return A.EQ.value;if(e instanceof H)return A.LT.value;if(n instanceof H)return A.GT.value;if(e instanceof q&&n instanceof q)return A.EQ.value;if(e instanceof q)return A.LT.value;if(n instanceof q)return A.GT.value;if(e instanceof O&&n instanceof O)return A.EQ.value;throw new Error("Failed pattern match at Data.Date.Component (line 61, column 1 - line 61, column 38): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return J}},j={bottom:-271820,top:275759,Ord0:function(){return V}},Q={bottom:S.value,top:x.value,Ord0:function(){return z}},Z={bottom:M.value,top:O.value,Ord0:function(){return G}},X={cardinality:547580,toEnum:function(e){if(e>=-271820&&e<=275759)return new C.Just(e);if(b.otherwise)return C.Nothing.value;throw new Error("Failed pattern match at Data.Date.Component (line 35, column 1 - line 40, column 24): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return j},Enum1:function(){return Y}},Y={succ:(r=w.toEnum(X),o=w.fromEnum(X),function(e){return r(o(e)+1|0)}),pred:(n=w.toEnum(X),t=w.fromEnum(X),function(e){return n(t(e)-1|0)}),Ord0:function(){return V}},$={cardinality:7,toEnum:function(e){return 1===e?new C.Just(S.value):2===e?new C.Just(I.value):3===e?new C.Just(T.value):4===e?new C.Just(D.value):5===e?new C.Just(F.value):6===e?new C.Just(E.value):7===e?new C.Just(x.value):C.Nothing.value},fromEnum:function(e){if(e instanceof S)return 1;if(e instanceof I)return 2;if(e instanceof T)return 3;if(e instanceof D)return 4;if(e instanceof F)return 5;if(e instanceof E)return 6;if(e instanceof x)return 7;throw new Error("Failed pattern match at Data.Date.Component (line 175, column 14 - line 182, column 16): "+[e.constructor.name])},Bounded0:function(){return Q},Enum1:function(){return ee}},ee={succ:(i=w.toEnum($),c=w.fromEnum($),function(e){return i(c(e)+1|0)}),pred:(a=w.toEnum($),u=w.fromEnum($),function(e){return a(u(e)-1|0)}),Ord0:function(){return z}},ne={cardinality:12,toEnum:function(e){return 1===e?new C.Just(M.value):2===e?new C.Just(R.value):3===e?new C.Just(P.value):4===e?new C.Just(k.value):5===e?new C.Just(B.value):6===e?new C.Just(N.value):7===e?new C.Just(L.value):8===e?new C.Just(_.value):9===e?new C.Just(U.value):10===e?new C.Just(H.value):11===e?new C.Just(q.value):12===e?new C.Just(O.value):C.Nothing.value},fromEnum:function(e){if(e instanceof M)return 1;if(e instanceof R)return 2;if(e instanceof P)return 3;if(e instanceof k)return 4;if(e instanceof B)return 5;if(e instanceof N)return 6;if(e instanceof L)return 7;if(e instanceof _)return 8;if(e instanceof U)return 9;if(e instanceof H)return 10;if(e instanceof q)return 11;if(e instanceof O)return 12;throw new Error("Failed pattern match at Data.Date.Component (line 87, column 14 - line 99, column 19): "+[e.constructor.name])},Bounded0:function(){return Z},Enum1:function(){return te}},te={succ:(f=w.toEnum(ne),d=w.fromEnum(ne),function(e){return f(d(e)+1|0)}),pred:(l=w.toEnum(ne),s=w.fromEnum(ne),function(e){return l(s(e)-1|0)}),Ord0:function(){return G}},re={bottom:1,top:31,Ord0:function(){return W}},oe={cardinality:31,toEnum:function(e){if(e>=1&&e<=31)return new C.Just(e);if(b.otherwise)return C.Nothing.value;throw new Error("Failed pattern match at Data.Date.Component (line 133, column 1 - line 138, column 23): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return re},Enum1:function(){return ae}},ae={succ:(p=w.toEnum(oe),g=w.fromEnum(oe),function(e){return p(g(e)+1|0)}),pred:(v=w.toEnum(oe),m=w.fromEnum(oe),function(e){return v(m(e)-1|0)}),Ord0:function(){return W}};y.January=M,y.February=R,y.March=P,y.April=k,y.May=B,y.June=N,y.July=L,y.August=_,y.September=U,y.October=H,y.November=q,y.December=O,y.Monday=S,y.Tuesday=I,y.Wednesday=T,y.Thursday=D,y.Friday=F,y.Saturday=E,y.Sunday=x,y.boundedEnumYear=X,y.boundedEnumMonth=ne,y.boundedEnumDay=oe,y.boundedEnumWeekday=$}(c),function(e){"use strict";e["Data.Date"]=e["Data.Date"]||{};var n=e["Data.Date"],t=e["Data.Date"],r=e["Data.Date.Component"],o=e["Data.Enum"],a=e["Data.Maybe"],u=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}();n.canonicalDate=function(e){return function(n){return function(i){return t.canonicalDateImpl((function(e){return function(n){return function(t){return new u(e,a.fromJust()(o.toEnum(r.boundedEnumMonth)(n)),t)}}}),e,o.fromEnum(r.boundedEnumMonth)(n),i)}}},n.year=function(e){return e.value0},n.month=function(e){return e.value1},n.day=function(e){return e.value2}}(c),function(e){"use strict";e["Data.DateTime"]=e["Data.DateTime"]||{};var n=e["Data.DateTime"],t=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}();n.DateTime=t}(c),function(e){"use strict";e["Data.Time"]=e["Data.Time"]||{};var n=e["Data.Time"],t=function(){function e(e,n,t,r){this.value0=e,this.value1=n,this.value2=t,this.value3=r}return e.create=function(n){return function(t){return function(r){return function(o){return new e(n,t,r,o)}}}},e}();n.Time=t,n.hour=function(e){return e.value0},n.minute=function(e){return e.value1},n.second=function(e){return e.value2},n.millisecond=function(e){return e.value3}}(c),function(e){"use strict";e["Data.DateTime.Instant"]=e["Data.DateTime.Instant"]||{};var n=e["Data.DateTime.Instant"],t=e["Data.DateTime.Instant"],r=e["Data.Boolean"],o=e["Data.Date"],a=e["Data.Date.Component"],u=e["Data.DateTime"],i=e["Data.Enum"],c=e["Data.Maybe"],l=e["Data.Time"],s=t.toDateTimeImpl((function(e){return function(n){return function(t){return function(r){return function(s){return function(f){return function(d){return new u.DateTime(o.canonicalDate(e)(c.fromJust()(i.toEnum(a.boundedEnumMonth)(n)))(t),new l.Time(r,s,f,d))}}}}}}}));n.instant=function(e){if(e>=-86399778816e5&&e<=8639977881599999)return new c.Just(e);if(r.otherwise)return c.Nothing.value;throw new Error("Failed pattern match at Data.DateTime.Instant (line 44, column 1 - line 44, column 41): "+[e.constructor.name])},n.unInstant=function(e){return e},n.fromDateTime=function(e){return t.fromDateTimeImpl(o.year(e.value0),i.fromEnum(a.boundedEnumMonth)(o.month(e.value0)),o.day(e.value0),l.hour(e.value1),l.minute(e.value1),l.second(e.value1),l.millisecond(e.value1))},n.toDateTime=s}(c),function(e){"use strict";e["Control.Monad.State"]=e["Control.Monad.State"]||{};var n=e["Control.Monad.State"],t=e["Data.Newtype"];n.runState=function(e){var n=t.unwrap();return function(t){return n(e(t))}}}(c),function(e){"use strict";e["Data.Formatter.Internal"]=e["Data.Formatter.Internal"]||{};var n=e["Data.Formatter.Internal"],t=e["Data.Foldable"];n.foldDigits=function(e){return t.foldl(e)((function(e){return function(n){return(10*e|0)+n|0}}))(0)}}(c),function(e){"use strict";e["Text.Parsing.Parser.Pos"]=e["Text.Parsing.Parser.Pos"]||{},e["Text.Parsing.Parser.Pos"].initialPos={line:1,column:1}}(c),function(e){"use strict";e["Text.Parsing.Parser"]=e["Text.Parsing.Parser"]||{};var n,t=e["Text.Parsing.Parser"],r=e["Control.Applicative"],o=e["Control.Apply"],a=e["Control.Bind"],u=e["Control.Lazy"],i=e["Control.Monad.Error.Class"],c=e["Control.Monad.Except.Trans"],l=e["Control.Monad.State.Class"],s=e["Control.Monad.State.Trans"],f=e["Control.Monad.Trans.Class"],d=e["Data.Either"],v=e["Data.Identity"],m=e["Data.Monoid"],p=e["Data.Newtype"],g=e["Data.Semigroup"],y=e["Data.Tuple"],b=e["Text.Parsing.Parser.Pos"],w=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),C=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),h=function(e){return e},A={lift:function(e){var n=f.lift(c.monadTransExceptT)(s.monadStateT(e)),t=f.lift(s.monadTransStateT)(e);return function(e){return n(t(e))}}},S=function(e){return c.monadStateExceptT(s.monadStateStateT(e))},I=(n=p.over()()(h),function(e){return n(c.mapExceptT(s.mapStateT(e)))}),T={defer:function(e){return u.defer(s.lazyStateT)((n=p.unwrap(),function(t){return c.runExceptT(n(e(t)))}));var n}},D=function(e){return c.functorExceptT(s.functorStateT(e))},F=function(e){return c.bindExceptT(s.monadStateT(e))},E=function(e){return function(n){return a.bindFlipped(F(e))(function(e){return function(n){return function(t){return i.throwError(function(e){return c.monadThrowExceptT(s.monadStateT(e))}(e))(new C(n,t))}}}(e)(n))(function(e){return l.gets(S(e))((function(e){return e.value1}))}(e))}},x=function(e){return c.applyExceptT(s.monadStateT(e))},M=function(e){return c.applicativeExceptT(s.monadStateT(e))},R=function(e){return{alt:function(n){return function(t){return c.ExceptT(s.StateT((function(o){return a.bind(e.Bind1())(s.runStateT(c.runExceptT(p.unwrap()(n)))(new w(o.value0,o.value1,!1)))((function(n){return n.value0 instanceof d.Left&&!n.value1.value2?s.runStateT(c.runExceptT(p.unwrap()(t)))(o):r.pure(e.Applicative0())(new y.Tuple(n.value0,n.value1))}))})))}},Functor0:function(){return D(e.Bind1().Apply0().Functor0())}}},P=function(e){return{empty:E(e)("No alternative"),Alt0:function(){return R(e)}}};t.ParseError=C,t.parseErrorMessage=function(e){return e.value0},t.parseErrorPosition=function(e){return e.value1},t.ParseState=w,t.ParserT=h,t.runParser=function(e){var n,t=p.unwrap(),r=(n=v.monadIdentity,function(e){return function(t){var r=new w(e,b.initialPos,!1);return s.evalStateT(n.Bind1().Apply0().Functor0())(c.runExceptT(p.unwrap()(t)))(r)}})(e);return function(e){return t(r(e))}},t.mapParserT=I,t.fail=E,t.lazyParserT=T,t.monoidParserT=function(e){return function(n){return{mempty:r.pure(M(e))(m.mempty(n)),Semigroup0:function(){return function(e){return function(n){return{append:o.lift2(x(e))(g.append(n))}}}(e)(n.Semigroup0())}}}},t.functorParserT=D,t.applyParserT=x,t.applicativeParserT=M,t.bindParserT=F,t.monadStateParserT=S,t.altParserT=R,t.plusParserT=P,t.alternativeParserT=function(e){return{Applicative0:function(){return M(e)},Plus1:function(){return P(e)}}},t.monadTransParserT=A}(c),function(e){"use strict";e["Text.Parsing.Parser.Combinators"]=e["Text.Parsing.Parser.Combinators"]||{};var n=e["Text.Parsing.Parser.Combinators"],t=e["Control.Alt"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Control.Monad.Except.Trans"],u=e["Control.Monad.State.Trans"],i=e["Control.Plus"],c=e["Data.Either"],l=e["Data.Foldable"],s=e["Data.Functor"],f=e["Data.Maybe"],d=e["Data.Newtype"],v=e["Data.Tuple"],m=e["Text.Parsing.Parser"],p=function(e){return function(n){return function(o){return t.alt(m.altParserT(e))(o)(r.pure(m.applicativeParserT(e))(n))}}};n.withErrorMessage=function(e){return function(n){return function(r){return t.alt(m.altParserT(e))(n)(m.fail(e)("Expected "+r))}}},n.option=p,n.optionMaybe=function(e){return function(n){return p(e)(f.Nothing.value)(s.map(m.functorParserT(e.Bind1().Apply0().Functor0()))(f.Just.create)(n))}},n.try=function(e){return function(n){return m.ParserT(a.ExceptT(u.StateT((function(t){return o.bind(e.Bind1())(u.runStateT(a.runExceptT(d.unwrap()(n)))(t))((function(n){return n.value0 instanceof c.Left?r.pure(e.Applicative0())(new v.Tuple(n.value0,new m.ParseState(n.value1.value0,n.value1.value1,t.value2))):r.pure(e.Applicative0())(new v.Tuple(n.value0,n.value1))}))}))))}},n.tryRethrow=function(e){return function(n){return m.ParserT(a.ExceptT(u.StateT((function(t){return o.bind(e.Bind1())(u.runStateT(a.runExceptT(d.unwrap()(n)))(t))((function(n){return n.value0 instanceof c.Left?r.pure(e.Applicative0())(new v.Tuple(new c.Left(new m.ParseError(n.value0.value0.value0,t.value1)),new m.ParseState(n.value1.value0,n.value1.value1,t.value2))):r.pure(e.Applicative0())(new v.Tuple(n.value0,n.value1))}))}))))}},n.choice=function(e){return function(n){return l.foldl(e)(t.alt(m.altParserT(n)))(i.empty(m.plusParserT(n)))}}}(c),function(e){"use strict";var n="function"==typeof Array.from,t="undefined"!=typeof Symbol&&null!=Symbol&&void 0!==Symbol.iterator&&"function"==typeof String.prototype[Symbol.iterator],r="function"==typeof String.prototype.fromCodePoint,o="function"==typeof String.prototype.codePointAt;e._unsafeCodePointAt0=function(e){return o?function(e){return e.codePointAt(0)}:e},e._singleton=function(e){return r?String.fromCodePoint:e},e._take=function(e){return function(n){return t?function(e){for(var t="",r=e[Symbol.iterator](),o=0;o=0&&e1){var t=u.fromEnum(u.boundedEnumChar)(f.charAt(1)(e));return p(t)?m(n)(t):n}return n})),C=r._toCodePointArray((function(e){return v.unfoldr(v.unfoldableArray)(b)(e)}))(w),h=function(e){return o.length(C(e))},A=(n=u.toEnumWithDefaults(u.boundedEnumChar)(a.bottom(a.boundedChar))(a.top(a.boundedChar)),function(e){return s.singleton(n(e))}),S=r._singleton((function(e){if(e<=65535)return A(e);var n=i.div(i.euclideanRingInt)(e-65536|0)(1024)+55296|0,t=i.mod(i.euclideanRingInt)(e-65536|0)(1024)+56320|0;return A(n)+A(t)})),I=function(e){return function(n){if(e<1)return"";var t=y(n);return t instanceof l.Just?S(t.value0.head)+I(e-1|0)(t.value0.tail):n}},T=r._take(I);t.uncons=y,t.length=h,t.indexOf=function(e){return function(n){return c.map(l.functorMaybe)((function(e){return h(s.take(e)(n))}))(s.indexOf(e)(n))}},t.take=T,t.drop=function(e){return function(n){return s.drop(s.length(T(e)(n)))(n)}},t.splitAt=function(e){return function(n){var t=T(e)(n);return{before:t,after:s.drop(s.length(t))(n)}}}}(c),function(e){"use strict";e["Text.Parsing.Parser.String"]=e["Text.Parsing.Parser.String"]||{};var n=e["Text.Parsing.Parser.String"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.State.Class"],a=e["Data.Array"],u=e["Data.Char"],i=e["Data.Eq"],c=e["Data.EuclideanRing"],l=e["Data.Function"],s=e["Data.Functor"],f=e["Data.Maybe"],d=e["Data.Show"],v=e["Data.String.CodePoints"],m=e["Data.String.CodeUnits"],p=e["Data.String.Common"],g=e["Text.Parsing.Parser"],y=e["Text.Parsing.Parser.Combinators"],b=e["Unsafe.Coerce"].unsafeCoerce,w=function(e){return function(n){var t=b(n);return 10===t||13===t?{line:e.line+1|0,column:1}:9===t?{line:e.line,column:(e.column+8|0)-c.mod(c.euclideanRingInt)(e.column-1|0)(8)|0}:{line:e.line,column:e.column+1|0}}},C=function(e){return function(n){return y.tryRethrow(e)(r.bind(g.bindParserT(e))(function(e){return y.tryRethrow(e)(r.bind(g.bindParserT(e))(s.map(g.functorParserT(e.Bind1().Apply0().Functor0()))(b)(function(e){return r.bind(g.bindParserT(e))(o.get(g.monadStateParserT(e)))((function(n){var a=v.uncons(n.value0);if(a instanceof f.Nothing)return g.fail(e)("Unexpected EOF");if(a instanceof f.Just)return r.discard(r.discardUnit)(g.bindParserT(e))(o.put(g.monadStateParserT(e))(new g.ParseState(a.value0.tail,w(n.value1)(a.value0.head),!0)))((function(){return t.pure(g.applicativeParserT(e))(a.value0.head)}));throw new Error("Failed pattern match at Text.Parsing.Parser.String (line 84, column 3 - line 88, column 16): "+[a.constructor.name])}))}(e)))((function(n){if(n>65535)return g.fail(e)("Not a Char");var r=u.fromCharCode(n);if(r instanceof f.Nothing)return g.fail(e)("Not a Char");if(r instanceof f.Just)return t.pure(g.applicativeParserT(e))(r.value0);throw new Error("Failed pattern match at Text.Parsing.Parser.String (line 75, column 8 - line 77, column 21): "+[r.constructor.name])})))}(e))((function(r){return n(r)?t.pure(g.applicativeParserT(e))(r):g.fail(e)("Predicate unsatisfied")})))}};n.string=function(e){return function(n){return r.bind(g.bindParserT(e))(o.get(g.monadStateParserT(e)))((function(a){var u,i=m.stripPrefix(n)(a.value0);return i instanceof f.Just?r.discard(r.discardUnit)(g.bindParserT(e))(o.put(g.monadStateParserT(e))(new g.ParseState(i.value0,(u=a.value1,function(e){var n,t=u,r=!1;function o(n,o){var a=v.uncons(o);if(a instanceof f.Nothing)return r=!0,n;if(a instanceof f.Just)return t=w(n)(a.value0.head),void(e=a.value0.tail);throw new Error("Failed pattern match at Text.Parsing.Parser.String (line 129, column 27 - line 131, column 70): "+[a.constructor.name])}for(;!r;)n=o(t,e);return n})(n),!0)))((function(){return t.pure(g.applicativeParserT(e))(n)})):g.fail(e)("Expected "+d.show(d.showString)(n))}))}},n.eof=function(e){return r.bind(g.bindParserT(e))(o.get(g.monadStateParserT(e)))((function(n){return t.unless(g.applicativeParserT(e))(p.null(n.value0))(g.fail(e)("Expected EOF"))}))},n.char=function(e){return function(n){return y.withErrorMessage(e)(C(e)((function(e){return e===n})))(d.show(d.showChar)(n))}},n.noneOf=function(e){return function(n){return y.withErrorMessage(e)(C(e)(l.flip(a.notElem(i.eqChar))(n)))("none of "+d.show(d.showArray(d.showChar))(n))}}}(c),function(e){"use strict";e["Data.Formatter.Parser.Utils"]=e["Data.Formatter.Parser.Utils"]||{};var n=e["Data.Formatter.Parser.Utils"],t=e["Control.Apply"],r=e["Data.Bifunctor"],o=e["Data.Functor"],a=e["Data.Identity"],u=e["Data.Show"],i=e["Text.Parsing.Parser"],c=e["Text.Parsing.Parser.Combinators"],l=e["Text.Parsing.Parser.String"],s=function(e){return i.parseErrorMessage(e)+" "+(n=i.parseErrorPosition(e),"(line "+u.show(u.showInt)(n.line)+", col "+u.show(u.showInt)(n.column)+")");var n};n.oneOfAs=function(e){return function(n){return function(t){return function(r){return function(a){return c.choice(n)(t)(o.map(e)((function(e){return o.voidLeft(i.functorParserT(t.Bind1().Apply0().Functor0()))(r(e.value0))(e.value1)}))(a))}}}}},n.runP=function(e){return function(n){return r.lmap(r.bifunctorEither)(s)(i.runParser(n)(t.applyFirst(i.applyParserT(a.monadIdentity))(e)(l.eof(a.monadIdentity))))}}}(c),function(e){"use strict";e["Data.Formatter.Parser.Number"]=e["Data.Formatter.Parser.Number"]||{};var n=e["Data.Formatter.Parser.Number"],t=e["Data.Foldable"],r=e["Data.Formatter.Parser.Utils"],o=e["Data.Functor"],a=e["Data.Tuple"],u=e["Text.Parsing.Parser.Combinators"],i=e["Text.Parsing.Parser.String"];n.parseDigit=function(e){return u.try(e)(r.oneOfAs(o.functorArray)(t.foldableArray)(e)(i.char(e))([new a.Tuple("0",0),new a.Tuple("1",1),new a.Tuple("2",2),new a.Tuple("3",3),new a.Tuple("4",4),new a.Tuple("5",5),new a.Tuple("6",6),new a.Tuple("7",7),new a.Tuple("8",8),new a.Tuple("9",9)]))}}(c),function(e){"use strict";e["Data.Time.Component"]=e["Data.Time.Component"]||{};var n,t,r,o,a,u,i,c,l,s,f,d,v,m,p,g,y=e["Data.Time.Component"],b=e["Data.Boolean"],w=e["Data.Enum"],C=e["Data.Maybe"],h=e["Data.Ord"],A=h.ordInt,S=h.ordInt,I=h.ordInt,T=h.ordInt,D={bottom:0,top:59,Ord0:function(){return A}},F={bottom:0,top:59,Ord0:function(){return S}},E={bottom:0,top:999,Ord0:function(){return I}},x={bottom:0,top:23,Ord0:function(){return T}},M={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new C.Just(e);if(b.otherwise)return C.Nothing.value;throw new Error("Failed pattern match at Data.Time.Component (line 90, column 1 - line 95, column 26): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return D},Enum1:function(){return R}},R={succ:(r=w.toEnum(M),o=w.fromEnum(M),function(e){return r(o(e)+1|0)}),pred:(n=w.toEnum(M),t=w.fromEnum(M),function(e){return n(t(e)-1|0)}),Ord0:function(){return A}},P={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new C.Just(e);if(b.otherwise)return C.Nothing.value;throw new Error("Failed pattern match at Data.Time.Component (line 61, column 1 - line 66, column 26): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return F},Enum1:function(){return k}},k={succ:(i=w.toEnum(P),c=w.fromEnum(P),function(e){return i(c(e)+1|0)}),pred:(a=w.toEnum(P),u=w.fromEnum(P),function(e){return a(u(e)-1|0)}),Ord0:function(){return S}},B={cardinality:1e3,toEnum:function(e){if(e>=0&&e<=999)return new C.Just(e);if(b.otherwise)return C.Nothing.value;throw new Error("Failed pattern match at Data.Time.Component (line 120, column 1 - line 125, column 31): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return E},Enum1:function(){return N}},N={succ:(f=w.toEnum(B),d=w.fromEnum(B),function(e){return f(d(e)+1|0)}),pred:(l=w.toEnum(B),s=w.fromEnum(B),function(e){return l(s(e)-1|0)}),Ord0:function(){return I}},L={cardinality:24,toEnum:function(e){if(e>=0&&e<=23)return new C.Just(e);if(b.otherwise)return C.Nothing.value;throw new Error("Failed pattern match at Data.Time.Component (line 32, column 1 - line 37, column 24): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return x},Enum1:function(){return _}},_={succ:(p=w.toEnum(L),g=w.fromEnum(L),function(e){return p(g(e)+1|0)}),pred:(v=w.toEnum(L),m=w.fromEnum(L),function(e){return v(m(e)-1|0)}),Ord0:function(){return T}};y.boundedEnumHour=L,y.boundedEnumMinute=P,y.boundedEnumSecond=M,y.boundedEnumMillisecond=B}(c),function(e){"use strict";e["Data.Formatter.DateTime"]=e["Data.Formatter.DateTime"]||{};var n,t,r,o,a,u=e["Data.Formatter.DateTime"],i=e["Control.Alt"],c=e["Control.Applicative"],l=e["Control.Apply"],s=e["Control.Bind"],f=e["Control.Category"],d=e["Control.Lazy"],v=e["Control.Monad.Reader.Class"],m=e["Control.Monad.Reader.Trans"],p=e["Control.Monad.State"],g=e["Control.Monad.State.Class"],y=e["Control.Monad.State.Trans"],b=e["Control.Monad.Trans.Class"],w=e["Data.Array"],C=e["Data.Date"],h=e["Data.Date.Component"],A=e["Data.DateTime"],S=e["Data.DateTime.Instant"],I=e["Data.Either"],T=e["Data.Enum"],D=e["Data.Foldable"],F=e["Data.Formatter.Internal"],E=e["Data.Formatter.Parser.Number"],x=e["Data.Formatter.Parser.Utils"],M=e["Data.Function"],R=e["Data.Functor"],P=e["Data.Identity"],k=e["Data.Int"],B=e["Data.List"],N=e["Data.List.Types"],L=e["Data.Maybe"],_=e["Data.Monoid"],U=e["Data.Ring"],H=e["Data.Semigroup"],q=e["Data.Semiring"],O=e["Data.Show"],V=e["Data.String.CodeUnits"],W=e["Data.Time"],K=e["Data.Time.Component"],z=e["Data.Tuple"],J=e["Data.Unit"],G=e["Text.Parsing.Parser"],j=e["Text.Parsing.Parser.Combinators"],Q=e["Text.Parsing.Parser.String"],Z=function(){function e(){}return e.value=new e,e}(),X=function(){function e(){}return e.value=new e,e}(),Y=function(){function e(){}return e.value=new e,e}(),$=function(){function e(){}return e.value=new e,e}(),ee=function(){function e(){}return e.value=new e,e}(),ne=function(){function e(){}return e.value=new e,e}(),te=function(){function e(){}return e.value=new e,e}(),re=function(){function e(){}return e.value=new e,e}(),oe=function(){function e(){}return e.value=new e,e}(),ae=function(){function e(){}return e.value=new e,e}(),ue=function(){function e(){}return e.value=new e,e}(),ie=function(){function e(){}return e.value=new e,e}(),ce=function(){function e(){}return e.value=new e,e}(),le=function(){function e(){}return e.value=new e,e}(),se=function(){function e(){}return e.value=new e,e}(),fe=function(){function e(){}return e.value=new e,e}(),de=function(){function e(){}return e.value=new e,e}(),ve=function(){function e(){}return e.value=new e,e}(),me=function(){function e(){}return e.value=new e,e}(),pe=function(){function e(){}return e.value=new e,e}(),ge=function(){function e(){}return e.value=new e,e}(),ye=function(){function e(){}return e.value=new e,e}(),be=function(){function e(){}return e.value=new e,e}(),we=function(){function e(){}return e.value=new e,e}(),Ce=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),he=function(e){return function(n){return s.bind(m.bindReaderT(I.bindEither))(v.ask(m.monadAskReaderT(I.monadEither)))((function(t){return b.lift(m.monadTransReaderT)(I.monadEither)(t.numn?new I.Left("Number is out of range [ "+O.show(O.showInt)(e)+", "+O.show(O.showInt)(n)+" ]"):new I.Right(J.unit))}))}},Ae=function(e){return function(n){return function(t){return function(r){return 0===t?c.pure(e.Applicative0())(N.Nil.value):l.apply(e.Applicative0().Apply0())(R.map(e.Plus1().Alt0().Functor0())(N.Cons.create)(r))(d.defer(n)((function(o){return Se(e)(n)(t-1|0)(r)})))}}}},Se=function(e){return function(n){return function(t){return function(r){return 0===t?c.pure(e.Applicative0())(N.Nil.value):i.alt(e.Plus1().Alt0())(Ae(e)(n)(t)(r))(c.pure(e.Applicative0())(N.Nil.value))}}}},Ie=R.mapFlipped(G.functorParserT(P.functorIdentity))(w.some(G.alternativeParserT(P.monadIdentity))(G.lazyParserT)(Q.noneOf(P.monadIdentity)(V.toCharArray("YMDEHhamsS"))))(V.fromCharArray),Te=function(e){return function(n){return function(t){return function(r){return s.bind(G.bindParserT(e))(Ae(G.alternativeParserT(e))(G.lazyParserT)(n)(E.parseDigit(e)))((function(o){var a=F.foldDigits(N.foldableList)(o),u=B.length(o),i=m.runReaderT(t)({length:u,num:a,maxLength:n});if(i instanceof I.Left)return G.fail(e)(r+"("+i.value0+")");if(i instanceof I.Right)return c.pure(G.applicativeParserT(e))(a);throw new Error("Failed pattern match at Data.Formatter.DateTime (line 336, column 3 - line 338, column 23): "+[i.constructor.name])}))}}}},De=function(e){return function(n){return function(t){return function(r){return s.bind(G.bindParserT(e))(R.map(G.functorParserT(e.Bind1().Apply0().Functor0()))(L.isJust)(j.optionMaybe(e)(Q.char(e)("-"))))((function(o){return R.map(G.functorParserT(e.Bind1().Apply0().Functor0()))(o?U.negate(U.ringInt):f.identity(f.categoryFn))(Te(e)(n)(t)(r))}))}}}},Fe={year:L.Nothing.value,month:L.Nothing.value,day:L.Nothing.value,hour:L.Nothing.value,minute:L.Nothing.value,second:L.Nothing.value,millisecond:L.Nothing.value,meridiem:L.Nothing.value},Ee=i.alt(G.altParserT(P.monadIdentity))(x.oneOfAs(R.functorArray)(D.foldableArray)(P.monadIdentity)((n=j.try(P.monadIdentity),t=Q.string(P.monadIdentity),function(e){return n(t(e))}))([new z.Tuple("YYYY",Y.value),new z.Tuple("YY",$.value),new z.Tuple("Y",ee.value),new z.Tuple("MMMM",ne.value),new z.Tuple("MMM",te.value),new z.Tuple("MM",re.value),new z.Tuple("DD",oe.value),new z.Tuple("D",ae.value),new z.Tuple("E",ie.value),new z.Tuple("X",ue.value),new z.Tuple("dddd",ce.value),new z.Tuple("ddd",le.value),new z.Tuple("HH",se.value),new z.Tuple("hh",fe.value),new z.Tuple("a",de.value),new z.Tuple("mm",me.value),new z.Tuple("m",ve.value),new z.Tuple("ss",ge.value),new z.Tuple("s",pe.value),new z.Tuple("SSS",ye.value),new z.Tuple("SS",we.value),new z.Tuple("S",be.value)]))(R.map(G.functorParserT(P.functorIdentity))(Ce.create)(Ie)),xe=B.some(G.alternativeParserT(P.monadIdentity))(G.lazyParserT)(Ee),Me=x.runP(xe),Re=s.bind(m.bindReaderT(I.bindEither))(v.ask(m.monadAskReaderT(I.monadEither)))((function(e){return b.lift(m.monadTransReaderT)(I.monadEither)(e.maxLength!==e.length?new I.Left("Expected "+O.show(O.showInt)(e.maxLength)+" digits but got "+O.show(O.showInt)(e.length)):new I.Right(J.unit))})),Pe=(r=function(e){return function(n){return s.bind(G.bindParserT(y.monadStateT(P.monadIdentity)))(n)((function(n){return b.lift(G.monadTransParserT)(y.monadStateT(P.monadIdentity))(g.modify_(y.monadStateStateT(P.monadIdentity))(M.flip(e)(new L.Just(n))))}))}},function(e){if(e instanceof Y)return r((function(e){return function(n){return{year:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second}}}))(De(y.monadStateT(P.monadIdentity))(4)(Re)("Incorrect full year"));if(e instanceof $)return r((function(e){return function(n){return{year:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second}}}))(De(y.monadStateT(P.monadIdentity))(2)(Re)("Incorrect 2-digit year"));if(e instanceof ee)return r((function(e){return function(n){return{year:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second}}}))(l.lift2(G.applyParserT(y.monadStateT(P.monadIdentity)))(q.mul(q.semiringInt))(j.option(y.monadStateT(P.monadIdentity))(1)(j.try(y.monadStateT(P.monadIdentity))(R.mapFlipped(G.functorParserT(y.functorStateT(P.functorIdentity)))(Q.string(y.monadStateT(P.monadIdentity))("-"))(M.const(-1)))))(R.mapFlipped(G.functorParserT(y.functorStateT(P.functorIdentity)))(B.some(G.alternativeParserT(y.monadStateT(P.monadIdentity)))(G.lazyParserT)(E.parseDigit(y.monadStateT(P.monadIdentity))))(F.foldDigits(N.foldableList))));if(e instanceof ne)return r((function(e){return function(n){return{month:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,second:e.second,year:e.year}}}))(R.map(G.functorParserT(y.functorStateT(P.functorIdentity)))(T.fromEnum(h.boundedEnumMonth))((n=y.monadStateT(P.monadIdentity),x.oneOfAs(R.functorArray)(D.foldableArray)(n)((t=j.try(n),o=Q.string(n),function(e){return t(o(e))}))([new z.Tuple("January",h.January.value),new z.Tuple("February",h.February.value),new z.Tuple("March",h.March.value),new z.Tuple("April",h.April.value),new z.Tuple("May",h.May.value),new z.Tuple("June",h.June.value),new z.Tuple("July",h.July.value),new z.Tuple("August",h.August.value),new z.Tuple("September",h.September.value),new z.Tuple("October",h.October.value),new z.Tuple("November",h.November.value),new z.Tuple("December",h.December.value)]))));var n,t,o;if(e instanceof te)return r((function(e){return function(n){return{month:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,second:e.second,year:e.year}}}))(R.map(G.functorParserT(y.functorStateT(P.functorIdentity)))(T.fromEnum(h.boundedEnumMonth))(function(e){return x.oneOfAs(R.functorArray)(D.foldableArray)(e)((n=j.try(e),t=Q.string(e),function(e){return n(t(e))}))([new z.Tuple("Jan",h.January.value),new z.Tuple("Feb",h.February.value),new z.Tuple("Mar",h.March.value),new z.Tuple("Apr",h.April.value),new z.Tuple("May",h.May.value),new z.Tuple("Jun",h.June.value),new z.Tuple("Jul",h.July.value),new z.Tuple("Aug",h.August.value),new z.Tuple("Sep",h.September.value),new z.Tuple("Oct",h.October.value),new z.Tuple("Nov",h.November.value),new z.Tuple("Dec",h.December.value)]);var n,t}(y.monadStateT(P.monadIdentity))));if(e instanceof re)return r((function(e){return function(n){return{month:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(H.append(m.semigroupReaderT(I.applyEither)(H.semigroupUnit))(he(1)(12))(Re))("Incorrect 2-digit month"));if(e instanceof oe)return r((function(e){return function(n){return{day:n,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(H.append(m.semigroupReaderT(I.applyEither)(H.semigroupUnit))(he(1)(31))(Re))("Incorrect day of month"));if(e instanceof ae)return r((function(e){return function(n){return{day:n,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(he(1)(31))("Incorrect day of month"));if(e instanceof ue)return s.bind(G.bindParserT(y.monadStateT(P.monadIdentity)))(R.map(G.functorParserT(y.functorStateT(P.functorIdentity)))(F.foldDigits(N.foldableList))(B.some(G.alternativeParserT(y.monadStateT(P.monadIdentity)))(G.lazyParserT)(E.parseDigit(y.monadStateT(P.monadIdentity)))))((function(e){var n=R.map(L.functorMaybe)(S.toDateTime)(S.instant(1e3*k.toNumber(e)));if(n instanceof L.Nothing)return G.fail(y.monadStateT(P.monadIdentity))("Incorrect timestamp");if(n instanceof L.Just)return b.lift(G.monadTransParserT)(y.monadStateT(P.monadIdentity))(g.put(y.monadStateStateT(P.monadIdentity))({year:new L.Just(T.fromEnum(h.boundedEnumYear)(C.year(n.value0.value0))),month:new L.Just(T.fromEnum(h.boundedEnumMonth)(C.month(n.value0.value0))),day:new L.Just(T.fromEnum(h.boundedEnumDay)(C.day(n.value0.value0))),hour:new L.Just(T.fromEnum(K.boundedEnumHour)(W.hour(n.value0.value1))),minute:new L.Just(T.fromEnum(K.boundedEnumMinute)(W.minute(n.value0.value1))),second:new L.Just(T.fromEnum(K.boundedEnumSecond)(W.second(n.value0.value1))),millisecond:new L.Just(T.fromEnum(K.boundedEnumMillisecond)(W.millisecond(n.value0.value1))),meridiem:L.Nothing.value}));throw new Error("Failed pattern match at Data.Formatter.DateTime (line 362, column 5 - line 373, column 10): "+[n.constructor.name])}));if(e instanceof ie)return R.void(G.functorParserT(y.functorStateT(P.functorIdentity)))(Te(y.monadStateT(P.monadIdentity))(1)(he(1)(7))("Incorrect day of week"));if(e instanceof ce)return r((function(e){return function(n){return{day:n,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(R.map(G.functorParserT(y.functorStateT(P.functorIdentity)))(T.fromEnum(h.boundedEnumWeekday))(function(e){return x.oneOfAs(R.functorArray)(D.foldableArray)(e)((n=j.try(e),t=Q.string(e),function(e){return n(t(e))}))([new z.Tuple("Monday",h.Monday.value),new z.Tuple("Tuesday",h.Tuesday.value),new z.Tuple("Wednesday",h.Wednesday.value),new z.Tuple("Thursday",h.Thursday.value),new z.Tuple("Friday",h.Friday.value),new z.Tuple("Saturday",h.Saturday.value),new z.Tuple("Sunday",h.Sunday.value)]);var n,t}(y.monadStateT(P.monadIdentity))));if(e instanceof le)return r((function(e){return function(n){return{day:n,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(R.map(G.functorParserT(y.functorStateT(P.functorIdentity)))(T.fromEnum(h.boundedEnumWeekday))(function(e){return x.oneOfAs(R.functorArray)(D.foldableArray)(e)((n=j.try(e),t=Q.string(e),function(e){return n(t(e))}))([new z.Tuple("Mon",h.Monday.value),new z.Tuple("Tue",h.Tuesday.value),new z.Tuple("Wed",h.Wednesday.value),new z.Tuple("Thu",h.Thursday.value),new z.Tuple("Fri",h.Friday.value),new z.Tuple("Sat",h.Saturday.value),new z.Tuple("Sun",h.Sunday.value)]);var n,t}(y.monadStateT(P.monadIdentity))));if(e instanceof se)return r((function(e){return function(n){return{hour:n,day:e.day,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(H.append(m.semigroupReaderT(I.applyEither)(H.semigroupUnit))(he(0)(24))(Re))("Incorrect 24 hour"));if(e instanceof fe)return r((function(e){return function(n){return{hour:n,day:e.day,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(H.append(m.semigroupReaderT(I.applyEither)(H.semigroupUnit))(he(0)(12))(Re))("Incorrect 12 hour"));if(e instanceof de)return r((function(e){return function(n){return{meridiem:n,day:e.day,hour:e.hour,millisecond:e.millisecond,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(function(e){return x.oneOfAs(R.functorArray)(D.foldableArray)(e)((n=j.try(e),t=Q.string(e),function(e){return n(t(e))}))([new z.Tuple("am",Z.value),new z.Tuple("AM",Z.value),new z.Tuple("pm",X.value),new z.Tuple("PM",X.value)]);var n,t}(y.monadStateT(P.monadIdentity)));if(e instanceof me)return r((function(e){return function(n){return{minute:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(H.append(m.semigroupReaderT(I.applyEither)(H.semigroupUnit))(he(0)(59))(Re))("Incorrect 2-digit minute"));if(e instanceof ve)return r((function(e){return function(n){return{minute:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(he(0)(59))("Incorrect minute"));if(e instanceof ge)return r((function(e){return function(n){return{second:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(H.append(m.semigroupReaderT(I.applyEither)(H.semigroupUnit))(he(0)(59))(Re))("Incorrect 2-digit second"));if(e instanceof pe)return r((function(e){return function(n){return{second:n,day:e.day,hour:e.hour,meridiem:e.meridiem,millisecond:e.millisecond,minute:e.minute,month:e.month,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(2)(he(0)(59))("Incorrect second"));if(e instanceof ye)return r((function(e){return function(n){return{millisecond:n,day:e.day,hour:e.hour,meridiem:e.meridiem,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(Te(y.monadStateT(P.monadIdentity))(3)(Re)("Incorrect millisecond"));if(e instanceof Ce)return R.void(G.functorParserT(y.functorStateT(P.functorIdentity)))(Q.string(y.monadStateT(P.monadIdentity))(e.value0));if(e instanceof be)return r((function(e){return function(n){return{millisecond:n,day:e.day,hour:e.hour,meridiem:e.meridiem,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(R.mapFlipped(G.functorParserT(y.functorStateT(P.functorIdentity)))(Te(y.monadStateT(P.monadIdentity))(1)(Re)("Incorrect 1-digit millisecond"))((function(e){return 100*e|0})));if(e instanceof we)return r((function(e){return function(n){return{millisecond:n,day:e.day,hour:e.hour,meridiem:e.meridiem,minute:e.minute,month:e.month,second:e.second,year:e.year}}}))(R.mapFlipped(G.functorParserT(y.functorStateT(P.functorIdentity)))(Te(y.monadStateT(P.monadIdentity))(2)(Re)("Incorrect 2-digit millisecond"))((function(e){return 10*e|0})));throw new Error("Failed pattern match at Data.Formatter.DateTime (line 341, column 25 - line 399, column 74): "+[e.constructor.name])}),ke=(o=P.monadIdentity,a=function(e){var n;return s.bind(G.bindParserT(o))(G.mapParserT((n=o,function(e){var t=p.runState(e)(Fe);return c.pure(n.Applicative0())(new z.Tuple(R.voidLeft(I.functorEither)(t.value0.value0)(t.value1),t.value0.value1))}))(D.foldMap(N.foldableList)(G.monoidParserT(y.monadStateT(P.monadIdentity))(_.monoidUnit))(Pe)(e)))((function(e){return I.either(G.fail(o))(c.pure(G.applicativeParserT(o)))((n=e,l.applySecond(I.applyEither)((t=n).hour instanceof L.Just&&24===t.hour.value0?D.for_(I.applicativeEither)(D.foldableArray)([t.minute,t.second,t.millisecond])((function(e){return c.when(I.applicativeEither)(L.fromMaybe(0)(e)>0)(new I.Left("When hour is 24, other time components must be 0"))})):c.pure(I.applicativeEither)(J.unit))(l.apply(I.applyEither)(R.map(I.functorEither)(A.DateTime.create)(l.apply(I.applyEither)(l.apply(I.applyEither)(R.map(I.functorEither)(C.canonicalDate)(L.maybe(new I.Left("Incorrect year"))(c.pure(I.applicativeEither))(T.toEnum(h.boundedEnumYear)(L.fromMaybe(0)(n.year)))))(L.maybe(new I.Left("Incorrect month"))(c.pure(I.applicativeEither))(T.toEnum(h.boundedEnumMonth)(L.fromMaybe(1)(n.month)))))(L.maybe(new I.Left("Incorrect day"))(c.pure(I.applicativeEither))(T.toEnum(h.boundedEnumDay)(function(e){return function(n){return e instanceof L.Just&&24===e.value0?n+1|0:n}}(n.hour)(L.fromMaybe(1)(n.day)))))))(l.apply(I.applyEither)(l.apply(I.applyEither)(l.apply(I.applyEither)(R.map(I.functorEither)(W.Time.create)(L.maybe(new I.Left("Incorrect hour"))(c.pure(I.applicativeEither))(T.toEnum(K.boundedEnumHour)(L.fromMaybe(0)(R.map(L.functorMaybe)(function(e){return function(n){if(e instanceof L.Just&&e.value0 instanceof Z&&12===n)return 0;if(e instanceof L.Just&&e.value0 instanceof X&&12===n)return 12;if(e instanceof L.Just&&e.value0 instanceof X)return n+12|0;if(e instanceof L.Just&&e.value0 instanceof Z)return n;if(e instanceof L.Nothing&&24===n)return 0;if(e instanceof L.Nothing)return n;throw new Error("Failed pattern match at Data.Formatter.DateTime (line 279, column 1 - line 279, column 44): "+[e.constructor.name,n.constructor.name])}}(n.meridiem))(n.hour))))))(L.maybe(new I.Left("Incorrect minute"))(c.pure(I.applicativeEither))(T.toEnum(K.boundedEnumMinute)(L.fromMaybe(0)(n.minute)))))(L.maybe(new I.Left("Incorrect second"))(c.pure(I.applicativeEither))(T.toEnum(K.boundedEnumSecond)(L.fromMaybe(0)(n.second)))))(L.maybe(new I.Left("Incorrect millisecond"))(c.pure(I.applicativeEither))(T.toEnum(K.boundedEnumMillisecond)(L.fromMaybe(0)(n.millisecond))))))));var n,t}))},function(e){return x.runP(a(e))});u.parseFormatString=Me,u.unformat=ke}(c),function(e){"use strict";e["Ctl.Internal.Types.SystemStart"]=e["Ctl.Internal.Types.SystemStart"]||{};var n,t=e["Ctl.Internal.Types.SystemStart"],r=e["Control.Alt"],o=e["Data.BigInt"],a=e["Data.DateTime.Instant"],u=e["Data.Either"],i=e["Data.Formatter.DateTime"],c=e["Data.Functor"],l=e["Data.Maybe"],s=e["Data.Newtype"],f=e["Data.String.CodePoints"],d="YYYY-MM-DDTHH:mm:ss",v="YYYY-MM-DDTHH:mm:ss.SSS",m=(n=l.fromJust(),function(e){return n(u.hush(i.parseFormatString(e)))});t.sysStartFromOgmiosTimestamp=function(e){var n=i.unformat(m(d))(f.take(f.length(d))(e)),t=i.unformat(m(v))(f.take(f.length(v))(e));return c.map(u.functorEither)(s.wrap())(r.alt(u.altEither)(t)(n))},t.sysStartUnixTime=function(e){return o.fromNumber(s.unwrap()(a.unInstant(a.fromDateTime(e))))}}(c),function(e){"use strict";e.lengthImpl=function(e){return Array.from(e).length},e.padEndPrimeImpl=function(e,n){return n.padEnd(e)},e.padStartPrimeImpl=function(e,n){return n.padStart(e)}}(c["Data.String.Utils"]=c["Data.String.Utils"]||{}),function(e){"use strict";e["Data.String.Utils"]=e["Data.String.Utils"]||{};var n=e["Data.String.Utils"],t=e["Data.String.Utils"],r=e["Data.String.CodePoints"],o=e["Data.String.CodeUnits"];n.padEnd=function(e){return function(n){var a=o.length(n),u=r.length(n);return function(e){return function(n){return t.padEndPrimeImpl(e,n)}}((e+a|0)-u|0)(n)}},n.padStart=function(e){return function(n){var a=o.length(n),u=r.length(n);return function(e){return function(n){return t.padStartPrimeImpl(e,n)}}((e+a|0)-u|0)(n)}}}(c),function(e){"use strict";e["Ctl.Internal.QueryM.Ogmios"]=e["Ctl.Internal.QueryM.Ogmios"]||{};var n,t,r,o,a,u,i,c,l,s,f,d,v,m,p,g,y,b,w,C,h,A,S=e["Ctl.Internal.QueryM.Ogmios"],I=e.Aeson,T=e["Control.Alt"],D=e["Control.Alternative"],F=e["Control.Applicative"],E=e["Control.Apply"],x=e["Control.Bind"],M=e["Control.Monad.Reader.Trans"],R=e["Ctl.Internal.Cardano.Types.NativeScript"],P=e["Ctl.Internal.Cardano.Types.ScriptRef"],k=e["Ctl.Internal.Cardano.Types.Transaction"],B=e["Ctl.Internal.Cardano.Types.Value"],N=e["Ctl.Internal.Deserialization.FromBytes"],L=e["Ctl.Internal.Helpers"],_=e["Ctl.Internal.QueryM.JsonWsp"],U=e["Ctl.Internal.Serialization.Address"],H=e["Ctl.Internal.Serialization.Hash"],q=e["Ctl.Internal.Types.BigNum"],O=e["Ctl.Internal.Types.ByteArray"],V=e["Ctl.Internal.Types.CborBytes"],W=e["Ctl.Internal.Types.EraSummaries"],K=e["Ctl.Internal.Types.Int"],z=e["Ctl.Internal.Types.Natural"],J=e["Ctl.Internal.Types.ProtocolParameters"],G=e["Ctl.Internal.Types.Rational"],j=e["Ctl.Internal.Types.RedeemerTag"],Q=e["Ctl.Internal.Types.RewardAddress"],Z=e["Ctl.Internal.Types.Scripts"],X=e["Ctl.Internal.Types.SystemStart"],Y=e["Ctl.Internal.Types.TokenName"],$=e["Ctl.Internal.Types.VRFKeyHash"],ee=e["Data.Argonaut.Decode.Error"],ne=e["Data.Array"],te=e["Data.Bifunctor"],re=e["Data.BigInt"],oe=e["Data.Either"],ae=e["Data.Eq"],ue=e["Data.Foldable"],ie=e["Data.Function"],ce=e["Data.Functor"],le=e["Data.Generic.Rep"],se=e["Data.Int"],fe=e["Data.List.Types"],de=e["Data.Map.Internal"],ve=e["Data.Maybe"],me=e["Data.Monoid"],pe=e["Data.Newtype"],ge=e["Data.Ord"],ye=e["Data.Semiring"],be=e["Data.Show"],we=e["Data.Show.Generic"],Ce=e["Data.String.Common"],he=e["Data.String.Utils"],Ae=e["Data.Traversable"],Se=e["Data.Tuple"],Ie=e["Data.Unfoldable"],Te=e["Foreign.Object"],De=e["Untagged.TypeCheck"],Fe=e["Untagged.Union"],Ee=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),xe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Me=function(e){return e},Re=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Pe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),ke=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Be=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ne=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Le=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),_e=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ue=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),He=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),qe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Oe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ve=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),We=De.hasRuntimeTypeString,Ke={to:function(e){if(e instanceof le.Inl)return new He(e.value0);if(e instanceof le.Inr)return new qe(e.value0);throw new Error("Failed pattern match at Ctl.Internal.QueryM.Ogmios (line 709, column 1 - line 709, column 46): "+[e.constructor.name])},from:function(e){if(e instanceof He)return new le.Inl(e.value0);if(e instanceof qe)return new le.Inr(e.value0);throw new Error("Failed pattern match at Ctl.Internal.QueryM.Ogmios (line 709, column 1 - line 709, column 46): "+[e.constructor.name])}},ze={to:function(e){if(e instanceof le.Inl)return new Re(e.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inl)return new Pe(e.value0.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inr&&e.value0.value0 instanceof le.Inl)return new ke(e.value0.value0.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inr&&e.value0.value0 instanceof le.Inr&&e.value0.value0.value0 instanceof le.Inl)return new Be(e.value0.value0.value0.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inr&&e.value0.value0 instanceof le.Inr&&e.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0 instanceof le.Inl)return new Ne(e.value0.value0.value0.value0.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inr&&e.value0.value0 instanceof le.Inr&&e.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0.value0 instanceof le.Inl)return new Le(e.value0.value0.value0.value0.value0.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inr&&e.value0.value0 instanceof le.Inr&&e.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof le.Inl)return new _e(e.value0.value0.value0.value0.value0.value0.value0);if(e instanceof le.Inr&&e.value0 instanceof le.Inr&&e.value0.value0 instanceof le.Inr&&e.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0.value0 instanceof le.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof le.Inr)return new Ue(e.value0.value0.value0.value0.value0.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.QueryM.Ogmios (line 695, column 1 - line 695, column 40): "+[e.constructor.name])},from:function(e){if(e instanceof Re)return new le.Inl(e.value0);if(e instanceof Pe)return new le.Inr(new le.Inl(e.value0));if(e instanceof ke)return new le.Inr(new le.Inr(new le.Inl(e.value0)));if(e instanceof Be)return new le.Inr(new le.Inr(new le.Inr(new le.Inl(e.value0))));if(e instanceof Ne)return new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inl(e.value0)))));if(e instanceof Le)return new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inl(e.value0))))));if(e instanceof _e)return new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inl(e.value0)))))));if(e instanceof Ue)return new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inr(new le.Inr(e.value0)))))));throw new Error("Failed pattern match at Ctl.Internal.QueryM.Ogmios (line 695, column 1 - line 695, column 40): "+[e.constructor.name])}},Je={show:we.genericShow(ze)(we.genericShowSum(we.genericShowConstructor(we.genericShowArgsArgument(be.showArray(be.showRecord()(be.showRecordFieldsCons({reflectSymbol:function(){return"redeemerIndex"}})(be.showRecordFieldsCons({reflectSymbol:function(){return"redeemerTag"}})(be.showRecordFieldsNil)(j.showRedeemerTag))(z.showNatural)))))({reflectSymbol:function(){return"ExtraRedeemers"}}))(we.genericShowSum(we.genericShowConstructor(we.genericShowArgsArgument(be.showRecord()(be.showRecordFieldsCons({reflectSymbol:function(){return"missing"}})(be.showRecordFieldsCons({reflectSymbol:function(){return"provided"}})(be.showRecordFieldsNil)(ve.showMaybe(be.showArray(be.showString))))(be.showArray(be.showString)))))({reflectSymbol:function(){return"MissingRequiredDatums"}}))(we.genericShowSum(we.genericShowConstructor(we.genericShowArgsArgument(be.showRecord()(be.showRecordFieldsCons({reflectSymbol:function(){return"missing"}})(be.showRecordFieldsCons({reflectSymbol:function(){return"resolved"}})(be.showRecordFieldsNil)(de.showMap(be.showRecord()(be.showRecordFieldsCons({reflectSymbol:function(){return"redeemerIndex"}})(be.showRecordFieldsCons({reflectSymbol:function(){return"redeemerTag"}})(be.showRecordFieldsNil)(j.showRedeemerTag))(z.showNatural)))(be.showString)))(be.showArray(be.showString)))))({reflectSymbol:function(){return"MissingRequiredScripts"}}))(we.genericShowSum(we.genericShowConstructor(we.genericShowArgsArgument(be.showRecord()(be.showRecordFieldsCons({reflectSymbol:function(){return"error"}})(be.showRecordFieldsCons({reflectSymbol:function(){return"traces"}})(be.showRecordFieldsNil)(be.showArray(be.showString)))(be.showString))))({reflectSymbol:function(){return"ValidatorFailed"}}))(we.genericShowSum(we.genericShowConstructor(we.genericShowArgsArgument(be.showRecord()(be.showRecordFieldsCons({reflectSymbol:function(){return"index"}})(be.showRecordFieldsCons({reflectSymbol:function(){return"txId"}})(be.showRecordFieldsNil)(be.showString))(be.showInt))))({reflectSymbol:function(){return"UnknownInputReferencedByRedeemer"}}))(we.genericShowSum(we.genericShowConstructor(we.genericShowArgsArgument(be.showRecord()(be.showRecordFieldsCons({reflectSymbol:function(){return"index"}})(be.showRecordFieldsCons({reflectSymbol:function(){return"txId"}})(be.showRecordFieldsNil)(be.showString))(be.showInt))))({reflectSymbol:function(){return"NonScriptInputReferencedByRedeemer"}}))(we.genericShowSum(we.genericShowConstructor(we.genericShowArgsArgument(ve.showMaybe(be.showRecord()(be.showRecordFieldsCons({reflectSymbol:function(){return"memory"}})(be.showRecordFieldsCons({reflectSymbol:function(){return"steps"}})(be.showRecordFieldsNil)(z.showNatural))(z.showNatural)))))({reflectSymbol:function(){return"IllFormedExecutionBudget"}}))(we.genericShowConstructor(we.genericShowArgsArgument(be.showString))({reflectSymbol:function(){return"NoCostModelForLanguage"}})))))))))},Ge={show:we.genericShow(Ke)(we.genericShowSum(we.genericShowConstructor(we.genericShowArgsArgument(be.showString))({reflectSymbol:function(){return"UnparsedError"}}))(we.genericShowConstructor(we.genericShowArgsArgument(de.showMap(be.showRecord()(be.showRecordFieldsCons({reflectSymbol:function(){return"redeemerIndex"}})(be.showRecordFieldsCons({reflectSymbol:function(){return"redeemerTag"}})(be.showRecordFieldsNil)(j.showRedeemerTag))(z.showNatural)))(be.showArray(Je))))({reflectSymbol:function(){return"ScriptFailures"}})))},je={encodeAeson:function(e){var n=de.toUnfoldable(Ie.unfoldableArray)(e),t=function(e){if(e instanceof R.ScriptPubkey)return I.encodeAeson(H.encodeAesonEd25519KeyHash)(e.value0);if(e instanceof R.ScriptAll)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonArray(I.encodeAesonAeson))(I.gEncodeAesonNil)({reflectSymbol:function(){return"all"}})())())({all:ce.map(ce.functorArray)(t)(e.value0)});if(e instanceof R.ScriptAny)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonArray(I.encodeAesonAeson))(I.gEncodeAesonNil)({reflectSymbol:function(){return"any"}})())())({any:ce.map(ce.functorArray)(t)(e.value0)});if(e instanceof R.ScriptNOfK)return I.encodeAeson(I.encodeAesonObject(I.encodeAesonArray(I.encodeAesonAeson)))(Te.singleton(re.toString(re.fromInt(e.value0)))(ce.map(ce.functorArray)(t)(e.value1)));if(e instanceof R.TimelockStart)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(q.encodeAesonBigNum)(I.gEncodeAesonNil)({reflectSymbol:function(){return"startsAt"}})())())({startsAt:e.value0});if(e instanceof R.TimelockExpiry)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(q.encodeAesonBigNum)(I.gEncodeAesonNil)({reflectSymbol:function(){return"expiresAt"}})())())({expiresAt:e.value0});throw new Error("Failed pattern match at Ctl.Internal.QueryM.Ogmios (line 1024, column 5 - line 1024, column 48): "+[e.constructor.name])},r=function(e){if(e instanceof P.NativeScriptRef)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonAeson)(I.gEncodeAesonNil)({reflectSymbol:function(){return"native"}})())())({native:t(e.value0)});if(e instanceof P.PlutusScriptRef&&e.value0.value1 instanceof Z.PlutusV1)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(O.encodeAesonByteArray)(I.gEncodeAesonNil)({reflectSymbol:function(){return"plutus:v1"}})())())({"plutus:v1":e.value0.value0});if(e instanceof P.PlutusScriptRef&&e.value0.value1 instanceof Z.PlutusV2)return I.encodeAeson(I.encodeAesonRecord(I.gEncodeAesonCons(O.encodeAesonByteArray)(I.gEncodeAesonNil)({reflectSymbol:function(){return"plutus:v2"}})())())({"plutus:v2":e.value0.value0});throw new Error("Failed pattern match at Ctl.Internal.QueryM.Ogmios (line 1039, column 5 - line 1039, column 42): "+[e.constructor.name])};return I.encodeAeson(I.encodeAesonArray(I.encodeAesonAeson))(ce.map(ce.functorArray)((function(e){return I.encodeAeson(I.encodeAesonTuple(I.encodeTupleAuxTuple(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonUInt)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"txId"}})())({reflectSymbol:function(){return"index"}})())())(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonMaybe(I.encodeAesonString))(I.gEncodeAesonCons(I.encodeAesonMaybe(I.encodeAesonString))(I.gEncodeAesonCons(I.encodeAesonMaybe(I.encodeAesonAeson))(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonAeson)(I.gEncodeAesonCons(I.encodeAesonBigInt)(I.gEncodeAesonNil)({reflectSymbol:function(){return"coins"}})())({reflectSymbol:function(){return"assets"}})())())(I.gEncodeAesonNil)({reflectSymbol:function(){return"value"}})())({reflectSymbol:function(){return"script"}})())({reflectSymbol:function(){return"datumHash"}})())({reflectSymbol:function(){return"datum"}})())({reflectSymbol:function(){return"address"}})())())))(new Se.Tuple({txId:e.value0.txId,index:e.value0.index},{address:e.value1.address,datumHash:e.value1.datumHash,datum:e.value1.datum,script:ce.map(ve.functorMaybe)(r)(e.value1.script),value:{coins:B.getLovelace(B.valueToCoin(e.value1.value)),assets:(n=B.getNonAdaAsset(e.value1.value),L.encodeMap(I.encodeAesonString)(I.encodeAesonBigInt)(ue.foldl(fe.foldableList)((function(e){return function(n){return de.insert(ge.ordString)((t=n.value0,function(e){var n=Y.getTokenName(e),r=O.byteArrayToHex(n),o=B.getCurrencySymbol(t),a=O.byteArrayToHex(o);return ae.eq(O.eqByteArray)(n)(me.mempty(O.monoidByteArray))?a:a+"."+r})(n.value1.value0))(n.value1.value1)(e);var t}}))(de.empty)(B.flattenNonAdaValue(n))))}}));var n}))(n))}},Qe={decodeAeson:(n=new ee.TypeMismatch("PParamRaional"),I.caseAesonString(new oe.Left(n))((function(e){var t=Ce.split("/")(e);return 2===t.length?oe.note(n)(x.bind(ve.bindMaybe)(re.fromString(t[0]))((function(e){return x.bind(ve.bindMaybe)(re.fromString(t[1]))((function(n){return ce.map(ve.functorMaybe)(Me)(G.reduce(G.rationalComponentBigInt)(e)(n))}))}))):new oe.Left(n)})))},Ze={decodeAeson:I.caseAesonString(new oe.Left(new ee.TypeMismatch("Timestamp string")))((t=ce.map(oe.functorEither)(pe.wrap()),r=te.lmap(te.bifunctorEither)(ee.TypeMismatch.create),function(e){return t(r(X.sysStartFromOgmiosTimestamp(e)))}))},Xe=I.decodeAesonString,Ye={decodeAeson:function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonObject(I.decodeAesonObject(I.decodeAesonAeson)))(e))((function(e){return x.bind(oe.bindEither)(Ae.for(oe.applicativeEither)(Ae.traversableArray)(Te.toUnfoldable(Ie.unfoldableArray)(e))((function(e){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(ce.map(ve.functorMaybe)(B.Coin))(I["getFieldOptional'"](I.decodeAesonBigInt)(e.value1)("rewards")))((function(n){return x.bind(oe.bindEither)(I["getFieldOptional'"](k.decodeAesonPoolPubKeyHash)(e.value1)("delegate"))((function(t){return F.pure(oe.applicativeEither)(new Se.Tuple(e.value0,{rewards:n,delegate:t}))}))}))})))((function(e){return F.pure(oe.applicativeEither)(de.fromFoldable(ge.ordString)(ue.foldableArray)(e))}))}))}},$e=I.decodeAesonBigInt,en=I.decodeAesonString,nn={decodeAeson:function(e){return x.bind(oe.bindEither)(I.decodeAeson(I["decodeAeson|+|"]()(en)(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(Xe))(I.gDecodeAesonCons(I.decodeAesonField1(U.decodeAesonSlot))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"slot"}})()())({reflectSymbol:function(){return"hash"}})()())()))(e))((function(e){return F.pure(oe.applicativeEither)(oe.either(Oe.create)(Ve.create)(Fe.toEither1(We)(e)))}))}},tn=new ee.TypeMismatch("Expected redeemer pointer to be encoded as: ^(spend|mint|certificate|withdrawal):[0-9]+$"),rn=function(e){return x.bind(ve.bindMaybe)(q.fromBigInt(G.numerator(e)))((function(n){return x.bind(ve.bindMaybe)(q.fromBigInt(G.denominator(e)))((function(e){return F.pure(ve.applicativeMaybe)({numerator:n,denominator:e})}))}))},on={decodeAeson:function(e){var n=function(e){return{mem:e.memory,steps:e.steps}};return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonFieldMaybe(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonFieldMaybe(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"verifyEd25519Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"unMapData-memory-arguments"}})()())({reflectSymbol:function(){return"unMapData-cpu-arguments"}})()())({reflectSymbol:function(){return"unListData-memory-arguments"}})()())({reflectSymbol:function(){return"unListData-cpu-arguments"}})()())({reflectSymbol:function(){return"unIData-memory-arguments"}})()())({reflectSymbol:function(){return"unIData-cpu-arguments"}})()())({reflectSymbol:function(){return"unConstrData-memory-arguments"}})()())({reflectSymbol:function(){return"unConstrData-cpu-arguments"}})()())({reflectSymbol:function(){return"unBData-memory-arguments"}})()())({reflectSymbol:function(){return"unBData-cpu-arguments"}})()())({reflectSymbol:function(){return"trace-memory-arguments"}})()())({reflectSymbol:function(){return"trace-cpu-arguments"}})()())({reflectSymbol:function(){return"tailList-memory-arguments"}})()())({reflectSymbol:function(){return"tailList-cpu-arguments"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sndPair-memory-arguments"}})()())({reflectSymbol:function(){return"sndPair-cpu-arguments"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha3_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha2_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"nullList-memory-arguments"}})()())({reflectSymbol:function(){return"nullList-cpu-arguments"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"mkPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkCons-memory-arguments"}})()())({reflectSymbol:function(){return"mkCons-cpu-arguments"}})()())({reflectSymbol:function(){return"mapData-memory-arguments"}})()())({reflectSymbol:function(){return"mapData-cpu-arguments"}})()())({reflectSymbol:function(){return"listData-memory-arguments"}})()())({reflectSymbol:function(){return"listData-cpu-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lengthOfByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lengthOfByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"indexByteString-memory-arguments"}})()())({reflectSymbol:function(){return"indexByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-memory-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-cpu-arguments"}})()())({reflectSymbol:function(){return"iData-memory-arguments"}})()())({reflectSymbol:function(){return"iData-cpu-arguments"}})()())({reflectSymbol:function(){return"headList-memory-arguments"}})()())({reflectSymbol:function(){return"headList-cpu-arguments"}})()())({reflectSymbol:function(){return"fstPair-memory-arguments"}})()())({reflectSymbol:function(){return"fstPair-cpu-arguments"}})()())({reflectSymbol:function(){return"equalsString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"equalsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsData-memory-arguments"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"constrData-memory-arguments"}})()())({reflectSymbol:function(){return"constrData-cpu-arguments"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"chooseUnit-memory-arguments"}})()())({reflectSymbol:function(){return"chooseUnit-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseList-memory-arguments"}})()())({reflectSymbol:function(){return"chooseList-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseData-memory-arguments"}})()())({reflectSymbol:function(){return"chooseData-cpu-arguments"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"blake2b_256-memory-arguments"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"bData-memory-arguments"}})()())({reflectSymbol:function(){return"bData-cpu-arguments"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-intercept"}})()())()))(I.gDecodeAesonCons(I.decodeAesonFieldMaybe(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(K.decodeAesonInt))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"verifyEcdsaSecp256k1Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifyEcdsaSecp256k1Signature-cpu-arguments"}})()())({reflectSymbol:function(){return"unMapData-memory-arguments"}})()())({reflectSymbol:function(){return"unMapData-cpu-arguments"}})()())({reflectSymbol:function(){return"unListData-memory-arguments"}})()())({reflectSymbol:function(){return"unListData-cpu-arguments"}})()())({reflectSymbol:function(){return"unIData-memory-arguments"}})()())({reflectSymbol:function(){return"unIData-cpu-arguments"}})()())({reflectSymbol:function(){return"unConstrData-memory-arguments"}})()())({reflectSymbol:function(){return"unConstrData-cpu-arguments"}})()())({reflectSymbol:function(){return"unBData-memory-arguments"}})()())({reflectSymbol:function(){return"unBData-cpu-arguments"}})()())({reflectSymbol:function(){return"trace-memory-arguments"}})()())({reflectSymbol:function(){return"trace-cpu-arguments"}})()())({reflectSymbol:function(){return"tailList-memory-arguments"}})()())({reflectSymbol:function(){return"tailList-cpu-arguments"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sndPair-memory-arguments"}})()())({reflectSymbol:function(){return"sndPair-cpu-arguments"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha3_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha2_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"serialiseData-memory-arguments-slope"}})()())({reflectSymbol:function(){return"serialiseData-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"serialiseData-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"serialiseData-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"nullList-memory-arguments"}})()())({reflectSymbol:function(){return"nullList-cpu-arguments"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"mkPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkCons-memory-arguments"}})()())({reflectSymbol:function(){return"mkCons-cpu-arguments"}})()())({reflectSymbol:function(){return"mapData-memory-arguments"}})()())({reflectSymbol:function(){return"mapData-cpu-arguments"}})()())({reflectSymbol:function(){return"listData-memory-arguments"}})()())({reflectSymbol:function(){return"listData-cpu-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lengthOfByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lengthOfByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"indexByteString-memory-arguments"}})()())({reflectSymbol:function(){return"indexByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-memory-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-cpu-arguments"}})()())({reflectSymbol:function(){return"iData-memory-arguments"}})()())({reflectSymbol:function(){return"iData-cpu-arguments"}})()())({reflectSymbol:function(){return"headList-memory-arguments"}})()())({reflectSymbol:function(){return"headList-cpu-arguments"}})()())({reflectSymbol:function(){return"fstPair-memory-arguments"}})()())({reflectSymbol:function(){return"fstPair-cpu-arguments"}})()())({reflectSymbol:function(){return"equalsString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"equalsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsData-memory-arguments"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"constrData-memory-arguments"}})()())({reflectSymbol:function(){return"constrData-cpu-arguments"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"chooseUnit-memory-arguments"}})()())({reflectSymbol:function(){return"chooseUnit-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseList-memory-arguments"}})()())({reflectSymbol:function(){return"chooseList-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseData-memory-arguments"}})()())({reflectSymbol:function(){return"chooseData-cpu-arguments"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"blake2b_256-memory-arguments"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"bData-memory-arguments"}})()())({reflectSymbol:function(){return"bData-cpu-arguments"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-intercept"}})()())()))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"plutus:v2"}})()())({reflectSymbol:function(){return"plutus:v1"}})()())()))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"steps"}})()())({reflectSymbol:function(){return"memory"}})()())()))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"steps"}})()())({reflectSymbol:function(){return"memory"}})()())()))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(Qe))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(Qe))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(Qe))(I.gDecodeAesonCons(I.decodeAesonField1(Qe))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"steps"}})()())({reflectSymbol:function(){return"memory"}})()())()))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonUInt))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"minor"}})()())({reflectSymbol:function(){return"major"}})()())()))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonBigInt))(I.gDecodeAesonCons(I.decodeAesonField1(Qe))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"treasuryExpansion"}})()())({reflectSymbol:function(){return"stakeKeyDeposit"}})()())({reflectSymbol:function(){return"protocolVersion"}})()())({reflectSymbol:function(){return"prices"}})()())({reflectSymbol:function(){return"poolRetirementEpochBound"}})()())({reflectSymbol:function(){return"poolInfluence"}})()())({reflectSymbol:function(){return"poolDeposit"}})()())({reflectSymbol:function(){return"monetaryExpansion"}})()())({reflectSymbol:function(){return"minPoolCost"}})()())({reflectSymbol:function(){return"minFeeConstant"}})()())({reflectSymbol:function(){return"minFeeCoefficient"}})()())({reflectSymbol:function(){return"maxValueSize"}})()())({reflectSymbol:function(){return"maxTxSize"}})()())({reflectSymbol:function(){return"maxExecutionUnitsPerTransaction"}})()())({reflectSymbol:function(){return"maxExecutionUnitsPerBlock"}})()())({reflectSymbol:function(){return"maxCollateralInputs"}})()())({reflectSymbol:function(){return"maxBlockHeaderSize"}})()())({reflectSymbol:function(){return"maxBlockBodySize"}})()())({reflectSymbol:function(){return"desiredNumberOfPools"}})()())({reflectSymbol:function(){return"costModels"}})()())({reflectSymbol:function(){return"collateralPercentage"}})()())({reflectSymbol:function(){return"coinsPerUtxoWord"}})()())({reflectSymbol:function(){return"coinsPerUtxoByte"}})()())())(e))((function(e){return x.bind(oe.bindEither)((t=e,oe.note(new ee.TypeMismatch("ExUnitPrices"))(x.bind(ve.bindMaybe)(rn(t.prices.memory))((function(e){return x.bind(ve.bindMaybe)(rn(t.prices.steps))((function(n){return F.pure(ve.applicativeMaybe)({memPrice:e,stepPrice:n})}))})))))((function(t){return x.bind(oe.bindEither)(ve.maybe(new oe.Left(new ee.AtKey("coinsPerUtxoByte or coinsPerUtxoWord",ee.MissingValue.value)))(F.pure(oe.applicativeEither))(T.alt(ve.altMaybe)(ce.map(ve.functorMaybe)((function(e){return J.CoinsPerUtxoByte.create(B.Coin(e))}))(e.coinsPerUtxoByte))(ce.map(ve.functorMaybe)((function(e){return J.CoinsPerUtxoWord.create(B.Coin(e))}))(e.coinsPerUtxoWord))))((function(r){return F.pure(oe.applicativeEither)({protocolVersion:new Se.Tuple(e.protocolVersion.major,e.protocolVersion.minor),decentralization:ye.zero(G.semiringRational),extraPraosEntropy:ve.Nothing.value,maxBlockHeaderSize:e.maxBlockHeaderSize,maxBlockBodySize:e.maxBlockBodySize,maxTxSize:e.maxTxSize,txFeeFixed:e.minFeeConstant,txFeePerByte:e.minFeeCoefficient,stakeAddressDeposit:e.stakeKeyDeposit,stakePoolDeposit:e.poolDeposit,minPoolCost:e.minPoolCost,poolRetireMaxEpoch:e.poolRetirementEpochBound,stakePoolTargetNum:e.desiredNumberOfPools,poolPledgeInfluence:pe.unwrap()(e.poolInfluence),monetaryExpansion:pe.unwrap()(e.monetaryExpansion),treasuryCut:pe.unwrap()(e.treasuryExpansion),coinsPerUtxoUnit:r,costModels:de.fromFoldable(Z.ordLanguage)(ue.foldableArray)(ne.catMaybes([F.pure(ve.applicativeMaybe)(new Se.Tuple(Z.PlutusV1.value,J.convertPlutusV1CostModel(e.costModels["plutus:v1"]))),ce.map(ve.functorMaybe)((function(e){return n=J.convertPlutusV2CostModel(e),new Se.Tuple(Z.PlutusV2.value,n);var n}))(e.costModels["plutus:v2"])])),prices:t,maxTxExUnits:n(e.maxExecutionUnitsPerTransaction),maxBlockExUnits:n(e.maxExecutionUnitsPerBlock),maxValueSize:e.maxValueSize,collateralPercent:e.collateralPercentage,maxCollateralInputs:e.maxCollateralInputs})}))}));var t}))}},an=function(e){return _.mkCallType(e)({type:"jsonwsp/request",version:"1.0",servicename:"ogmios"})},un=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:ie.const({query:"chainTip"})}),cn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:ie.const({query:"currentEpoch"})}),ln=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonArray(I.encodeAesonString))(I.gEncodeAesonNil)({reflectSymbol:function(){return"delegationsAndRewards"}})())())(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:function(e){return{query:{delegationsAndRewards:e}}}}),sn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:ie.const({query:"eraSummaries"})}),fn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:ie.const({query:"poolIds"})}),dn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:ie.const({query:"currentProtocolParameters"})}),vn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"query"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"Query",args:ie.const({query:"systemStart"})}),mn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"submit"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"SubmitTx",args:function(e){return{submit:V.cborBytesToHex(Se.snd(e))}}}),pn=function(e){return function(n){return function(t){return x.composeKleisli(oe.bindEither)(ie.flip(I.getField(e))(n))(t)}}},gn=an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(je)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"evaluate"}})())({reflectSymbol:function(){return"additionalUtxoSet"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"EvaluateTx",args:function(e){return{evaluate:V.cborBytesToHex(e.value0),additionalUtxoSet:e.value1}}}),yn=function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonString)(e))((function(e){var n=Ce.split("/")(e);return 2===n.length?x.bind(oe.bindEither)(oe.note(new ee.TypeMismatch("BigNum"))(q.fromString(n[0])))((function(e){return x.bind(oe.bindEither)(oe.note(new ee.TypeMismatch("BigNum"))(q.fromString(n[1])))((function(n){return F.pure(oe.applicativeEither)({numerator:e,denominator:n})}))})):new oe.Left(new ee.TypeMismatch("UnitInterval"))}))},bn=function(e){return oe.note(tn)(2===(n=Ce.split(":")(e)).length?E.apply(ve.applyMaybe)(ce.map(ve.functorMaybe)((function(e){return function(n){return{redeemerTag:e,redeemerIndex:n}}}))(j.fromString(n[0])))(z.fromString(n[1])):ve.Nothing.value);var n},wn=function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonObject(I.decodeAesonAeson))(e))((function(e){return x.bind(oe.bindEither)(x.bind(oe.bindEither)(I.getField(I.decodeAesonString)(e)("hash"))((n=oe.note(new ee.TypeMismatch("PoolMetadataHash")),t=ce.map(ve.functorMaybe)(k.PoolMetadataHash),function(e){return n(t(O.hexToByteArray(e)))})))((function(n){return x.bind(oe.bindEither)(ce.mapFlipped(oe.functorEither)(I.getField(I.decodeAesonString)(e)("url"))(k.URL))((function(e){return F.pure(oe.applicativeEither)({hash:n,url:e})}))}));var n,t}))},Cn=function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonString)(e))((n=oe.note(new ee.TypeMismatch("Ipv6")),function(e){return n((t=e,r=Ce.split(":")(t),o=ne.length(r)<8?x.bind(x.bindArray)(r)((function(e){return""===e?ne.replicate(1+(8-ne.length(r)|0)|0)(""):F.pure(F.applicativeArray)(e)})):r,x.discard(x.discardUnit)(ve.bindMaybe)(D.guard(ve.alternativeMaybe)(8===ne.length(o)))((function(){var e=Ce.replaceAll(" ")("0")(ue.fold(ue.foldableArray)(me.monoidString)(ce.mapFlipped(ce.functorArray)(o)(he.padStart(4))));return ce.map(ve.functorMaybe)(k.Ipv6)(O.hexToByteArray(e))}))));var t,r,o}));var n},hn=function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonString)(e))((function(e){var n,t=Ce.split(".")(e);return 4===t.length?x.bind(oe.bindEither)(Ae.for(oe.applicativeEither)(Ae.traversableArray)(t)((n=oe.note(new ee.TypeMismatch("Ipv4")),function(e){return n(se.fromString(e))})))((function(e){return ce.map(oe.functorEither)(k.Ipv4)(oe.note(new ee.TypeMismatch("Ipv4"))(O.byteArrayFromIntArray(e)))})):new oe.Left(new ee.TypeMismatch("Ipv4"))}))},An=function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonObject(I.decodeAesonAeson))(e))((function(e){var n=x.bind(oe.bindEither)(I.getField(I.decodeAesonMaybe(I.decodeAesonInt))(e)("port"))((function(n){return x.bind(oe.bindEither)(I.getField(I.decodeAesonString)(e)("hostname"))((function(e){return F.pure(oe.applicativeEither)(new k.SingleHostName({port:n,dnsName:e}))}))})),t=x.bind(oe.bindEither)(I["getFieldOptional'"](I.decodeAesonInt)(e)("port"))((function(n){return x.bind(oe.bindEither)(x.bind(oe.bindEither)(I["getFieldOptional'"](I.decodeAesonAeson)(e)("ipv4"))(Ae.traverse(Ae.traversableMaybe)(oe.applicativeEither)(hn)))((function(t){return x.bind(oe.bindEither)(x.bind(oe.bindEither)(I["getFieldOptional'"](I.decodeAesonAeson)(e)("ipv6"))(Ae.traverse(Ae.traversableMaybe)(oe.applicativeEither)(Cn)))((function(e){return F.pure(oe.applicativeEither)(new k.SingleHostAddr({port:n,ipv4:t,ipv6:e}))}))}))})),r=x.bind(oe.bindEither)(I.getField(I.decodeAesonString)(e)("hostname"))((function(e){return F.pure(oe.applicativeEither)(new k.MultiHostName({dnsName:e}))}));return T.alt(oe.altEither)(T.alt(oe.altEither)(n)(t))(r)}))},Sn={decodeAeson:function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonObject(I.decodeAesonObject(I.decodeAesonAeson)))(e))((function(e){return x.bind(oe.bindEither)(Ae.for(oe.applicativeEither)(Ae.traversableArray)(Te.toUnfoldable(Ie.unfoldableArray)(e))((function(e){return x.bind(oe.bindEither)(I.getField(I.decodeAesonString)(e.value1)("vrf"))((function(n){return x.bind(oe.bindEither)(oe.note(new ee.TypeMismatch("VRFKeyHash"))(O.hexToByteArray(n)))((function(n){return x.bind(oe.bindEither)(oe.note(new ee.TypeMismatch("VRFKeyHash"))(ce.map(ve.functorMaybe)($.VRFKeyHash)(N.fromBytes(N.fromBytesVRFKeyHash)(pe.wrap()(n)))))((function(n){return x.bind(oe.bindEither)(I.getField(q.decodeAesonBigNum)(e.value1)("pledge"))((function(t){return x.bind(oe.bindEither)(I.getField(q.decodeAesonBigNum)(e.value1)("cost"))((function(r){return x.bind(oe.bindEither)(x.bindFlipped(oe.bindEither)(yn)(I.getField(I.decodeAesonAeson)(e.value1)("margin")))((function(o){return x.bind(oe.bindEither)(I.getField(Q.decodeAesonRewardAddress)(e.value1)("rewardAccount"))((function(a){return x.bind(oe.bindEither)(I.getField(I.decodeAesonArray(H.decodeAesonEd25519KeyHash))(e.value1)("owners"))((function(u){return x.bind(oe.bindEither)(I.getField(I.decodeAesonArray(I.decodeAesonAeson))(e.value1)("relays"))((function(i){return x.bind(oe.bindEither)(Ae.for(oe.applicativeEither)(Ae.traversableArray)(i)(An))((function(i){return x.bind(oe.bindEither)(x.bind(oe.bindEither)(I["getFieldOptional'"](I.decodeAesonAeson)(e.value1)("metadata"))(Ae.traverse(Ae.traversableMaybe)(oe.applicativeEither)(wn)))((function(c){return F.pure(oe.applicativeEither)(new Se.Tuple(e.value0,{vrfKeyhash:n,pledge:t,cost:r,margin:o,rewardAccount:a,poolOwners:u,relays:i,poolMetadata:c}))}))}))}))}))}))}))}))}))}))}))}))})))((function(e){return F.pure(oe.applicativeEither)(de.fromFoldable(ge.ordString)(ue.foldableArray)(e))}))}))}},In=I.caseAesonObject(new oe.Left(new ee.TypeMismatch("Expected Object"))),Tn={decodeAeson:(o=ce.map(oe.functorEither)((function(e){return e})),a=In(x.composeKleisli(oe.bindEither)(ie.flip(I.getField(I.decodeAesonObject(I.decodeAesonAeson)))("AwaitAcquired"))(ie.flip(I.getField(U.decodeAesonSlot))("slot"))),function(e){return o(a(e))})},Dn={decodeAeson:(u=ie.const(new oe.Left(new ee.TypeMismatch("Expected ScriptFailure"))),i=pn(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonString))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonArray(I.decodeAesonString)))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"traces"}})()())({reflectSymbol:function(){return"error"}})()())())("validatorFailed")((function(e){return F.pure(oe.applicativeEither)(new Be(e))})),c=pn(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonString))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"txId"}})()())({reflectSymbol:function(){return"index"}})()())())("unknownInputReferencedByRedeemer")((function(e){return F.pure(oe.applicativeEither)(new Ne(e))})),l=pn(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonInt))(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonString))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"txId"}})()())({reflectSymbol:function(){return"index"}})()())())("nonScriptInputReferencedByRedeemer")((function(e){return F.pure(oe.applicativeEither)(new Le(e))})),s=pn(I.decodeAesonString)("noCostModelForLanguage")((function(e){return F.pure(oe.applicativeEither)(new Ue(e))})),f=pn(I.decodeAesonObject(I.decodeAesonAeson))("missingRequiredScripts")((function(e){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(Te.toUnfoldable(Ie.unfoldableArray))(I.getField(I.decodeAesonObject(I.decodeAesonString))(e)("resolved")))((function(n){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(de.fromFoldable(ge.ordRecord()(ge.ordRecordCons(ge.ordRecordCons(ge.ordRecordNil)()({reflectSymbol:function(){return"redeemerTag"}})(j.ordRedeemerTag))()({reflectSymbol:function(){return"redeemerIndex"}})(z.ordNatural)))(ue.foldableArray))(Ae.for(oe.applicativeEither)(Ae.traversableArray)(n)((function(e){return ce.map(oe.functorEither)((function(n){return new Se.Tuple(n,e.value1)}))(bn(e.value0))}))))((function(n){return x.bind(oe.bindEither)(I.getField(I.decodeAesonArray(I.decodeAesonString))(e)("missing"))((function(e){return F.pure(oe.applicativeEither)(new ke({resolved:n,missing:e}))}))}))}))})),d=pn(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(I.decodeAesonArray(I.decodeAesonString)))(I.gDecodeAesonCons(I.decodeAesonFieldMaybe(I.decodeAesonArray(I.decodeAesonString)))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"provided"}})()())({reflectSymbol:function(){return"missing"}})()())())("missingRequiredDatums")((function(e){return F.pure(oe.applicativeEither)(new Pe(e))})),v=pn(I.decodeAesonMaybe(I.decodeAesonRecord(I.gDecodeAesonCons(I.decodeAesonField1(z.decodeAesonNatural))(I.gDecodeAesonCons(I.decodeAesonField1(z.decodeAesonNatural))(I.gDecodeAesonRowNil)({reflectSymbol:function(){return"steps"}})()())({reflectSymbol:function(){return"memory"}})()())()))("illFormedExecutionBudget")((function(e){return F.pure(oe.applicativeEither)(new _e(e))})),m=ce.map(M.functorReaderT(oe.functorEither))(Re.create)(pn(I.decodeAesonArray(I.decodeAesonString))("extraRedeemers")(Ae.traverse(Ae.traversableArray)(oe.applicativeEither)(bn))),p=T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(T.alt(M.altReaderT(oe.altEither))(m)(d))(f))(i))(c))(l))(v))(s))(u),In(M.runReaderT(p)))},Fn={decodeAeson:In((function(e){return T.alt(oe.altEither)(x.bind(oe.bindEither)(x.bind(oe.bindEither)(I.getField(I.decodeAesonObject(I.decodeAesonAeson))(e)("SubmitSuccess"))(ie.flip(I.getField(I.decodeAesonString))("txId")))((t=ve.maybe(new oe.Left(new ee.TypeMismatch("Expected hexstring")))((n=F.pure(oe.applicativeEither),function(e){return n(Ee.create(e))})),function(e){return t(O.hexToByteArray(e))})))(ce.map(oe.functorEither)(xe.create)(I.getField(I.decodeAesonArray(I.decodeAesonAeson))(e)("SubmitFail")));var n,t}))},En={decodeAeson:function(){var e=T.alt(M.altReaderT(oe.altEither))((function(e){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(Te.toUnfoldable(Ie.unfoldableArray))(x.bind(oe.bindEither)(I.getField(I.decodeAesonObject(I.decodeAesonAeson))(e)("EvaluationFailure"))(ie.flip(I.getField(I.decodeAesonObject(I.decodeAesonAeson)))("ScriptFailures"))))((function(e){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(de.fromFoldable(ge.ordRecord()(ge.ordRecordCons(ge.ordRecordCons(ge.ordRecordNil)()({reflectSymbol:function(){return"redeemerTag"}})(j.ordRedeemerTag))()({reflectSymbol:function(){return"redeemerIndex"}})(z.ordNatural)))(ue.foldableArray))(Ae.for(oe.applicativeEither)(Ae.traversableArray)(e)((function(e){return x.bind(oe.bindEither)(I.decodeAeson(I.decodeAesonArray(Dn))(e.value1))((function(n){return ce.map(oe.functorEither)((function(e){return new Se.Tuple(e,n)}))(bn(e.value0))}))}))))((function(e){return F.pure(oe.applicativeEither)(new qe(e))}))}))}))((function(e){return F.pure(oe.applicativeEither)(new He(I.stringifyAeson(I.encodeAeson(I.encodeAesonObject(I.encodeAesonAeson))(e))))}));return In(M.runReaderT(e))}()},xn={decodeAeson:(g=function(e){return x.bind(oe.bindEither)(bn(e.value0))((function(n){return ie.flip(In)(e.value1)((function(e){return x.bind(oe.bindEither)(I.getField(z.decodeAesonNatural)(e)("memory"))((function(t){return x.bind(oe.bindEither)(I.getField(z.decodeAesonNatural)(e)("steps"))((function(e){return F.pure(oe.applicativeEither)(new Se.Tuple(n,{memory:t,steps:e}))}))}))}))}))},In((function(e){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(Te.toUnfoldable(Ie.unfoldableArray))(I.getField(I.decodeAesonObject(I.decodeAesonAeson))(e)("EvaluationResult")))((function(e){return ce.map(oe.functorEither)((n=de.fromFoldable(ge.ordRecord()(ge.ordRecordCons(ge.ordRecordCons(ge.ordRecordNil)()({reflectSymbol:function(){return"redeemerTag"}})(j.ordRedeemerTag))()({reflectSymbol:function(){return"redeemerIndex"}})(z.ordNatural)))(ue.foldableArray),function(e){return n(e)}))(Ae.traverse(Ae.traversableArray)(oe.applicativeEither)(g)(e));var n}))})))},Mn={decodeAeson:function(e){return T.alt(oe.altEither)(ce.map(oe.functorEither)((t=pe.wrap(),function(e){return t(oe.Right.create(e))}))(I.decodeAeson(xn)(e)))(ce.map(oe.functorEither)((n=pe.wrap(),function(e){return n(oe.Left.create(e))}))(I.decodeAeson(En)(e)));var n,t}},Rn=I.caseAesonArray(new oe.Left(new ee.TypeMismatch("Expected Array"))),Pn={decodeAeson:(h=function(e){return x.bind(oe.bindEither)(I.getField(W.decodeAesonEpochLength)(e)("epochLength"))((function(n){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(pe.wrap())(ce.map(oe.functorEither)(ye.mul(ye.semiringNumber)(1e3))(I.getField(I.decodeAesonNumber)(e)("slotLength"))))((function(t){return x.bind(oe.bindEither)(ce.map(oe.functorEither)(ve.fromMaybe(ye.zero(W.semiringSafeZone)))(I.getField(I.decodeAesonMaybe(W.decodeAesonSafeZone))(e)("safeZone")))((function(e){return F.pure(oe.applicativeEither)(pe.wrap()({epochLength:n,slotLength:t,safeZone:e}))}))}))}))},A=In((function(e){return x.bind(oe.bindEither)(I.getField(W.decodeAesonEraSummaryTime)(e)("start"))((function(n){return x.bind(oe.bindEither)(I.getField(I.decodeAesonAeson)(e)("end"))((function(t){return x.bind(oe.bindEither)(I.isNull(t)?F.pure(oe.applicativeEither)(ve.Nothing.value):ce.map(oe.functorEither)(ve.Just.create)(I.decodeAeson(W.decodeAesonEraSummaryTime)(t)))((function(t){return x.bind(oe.bindEither)(x.bindFlipped(oe.bindEither)(h)(I.getField(I.decodeAesonObject(I.decodeAesonAeson))(e)("parameters")))((function(e){return F.pure(oe.applicativeEither)(pe.wrap()({start:n,end:t,parameters:e}))}))}))}))}))})),Rn((w=ce.map(oe.functorEither)((y=pe.wrap(),b=pe.wrap(),function(e){return y(b(e))})),C=Ae.traverse(Ae.traversableArray)(oe.applicativeEither)(A),function(e){return w(C(e))})))},kn=("AwaitAcquire",an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonNil)())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"AwaitAcquire",args:ie.const({})}));S.CtChainOrigin=Oe,S.CtChainPoint=Ve,S.ExtraRedeemers=Re,S.MissingRequiredDatums=Pe,S.MissingRequiredScripts=ke,S.ValidatorFailed=Be,S.UnknownInputReferencedByRedeemer=Ne,S.NonScriptInputReferencedByRedeemer=Le,S.IllFormedExecutionBudget=_e,S.NoCostModelForLanguage=Ue,S.SubmitTxSuccess=Ee,S.SubmitFail=xe,S.UnparsedError=He,S.ScriptFailures=qe,S.acquireMempoolSnapshotCall=kn,S.aesonObject=In,S.evaluateTxCall=gn,S.queryPoolIdsCall=fn,S.mempoolSnapshotHasTxCall=function(e){return an(I.encodeAesonRecord(I.gEncodeAesonCons(I.encodeAesonRecord(I.gEncodeAesonCons(O.encodeAesonByteArray)(I.gEncodeAesonNil)({reflectSymbol:function(){return"id"}})())())(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonCons(I.encodeAesonString)(I.gEncodeAesonNil)({reflectSymbol:function(){return"version"}})())({reflectSymbol:function(){return"type"}})())({reflectSymbol:function(){return"servicename"}})())({reflectSymbol:function(){return"mirror"}})())({reflectSymbol:function(){return"methodname"}})())({reflectSymbol:function(){return"args"}})())())({methodname:"HasTx",args:function(e){return{id:e}}})},S.queryChainTipCall=un,S.queryCurrentEpochCall=cn,S.queryEraSummariesCall=sn,S.queryProtocolParametersCall=dn,S.querySystemStartCall=vn,S.queryDelegationsAndRewards=ln,S.submitTxCall=mn,S.slotLengthFactor=1e3,S.decodeAesonMempoolSnapsho=Tn,S.decodeAesonSubmitTxR=Fn,S.decodeAesonOgmiosSystemSt=Ze,S.decodeAesonCurrentEpoch=$e,S.decodeAesonOgmiosEraSumma=Pn,S.decodeAesonDelegationsAnd=Ye,S.decodeAesonPoolParameters=Sn,S.decodeAesonTxEvaluationR=Mn,S.showTxEvaluationFailure=Ge,S.decodeAesonOgmiosProtocol=on,S.decodeAesonChainTipQR=nn}(c),function(e){"use strict";e["Ctl.Internal.ServerConfig"]=e["Ctl.Internal.ServerConfig"]||{};var n=e["Ctl.Internal.ServerConfig"],t=e["Ctl.Internal.Helpers"],r=e["Data.Maybe"],o=e["Data.UInt"],a=function(e){return function(n){return(n.secure?e+"s":e)+"://"+n.host+":"+t.concatPaths(o.toString(n.port))(r.fromMaybe("")(n.path))}},u=a("ws"),i=a("http"),c={port:o.fromInt(1337),host:"localhost",secure:!1,path:r.Nothing.value},l={port:o.fromInt(4008),host:"localhost",secure:!1,path:new r.Just("kupo")};n.defaultKupoServerConfig=l,n.defaultOgmiosWsConfig=c,n.mkHttpUrl=i,n.mkWsUrl=u}(c),function(e){"use strict";e["Ctl.Internal.Service.Error"]=e["Ctl.Internal.Service.Error"]||{};var n=e["Ctl.Internal.Service.Error"],t=e.Aeson,r=e.Affjax,o=e["Affjax.StatusCode"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.Service.Helpers"],c=e["Data.Argonaut.Decode.Error"],l=e["Data.Either"],s=e["Data.Generic.Rep"],f=e["Data.Show"],d=e["Data.Show.Generic"],v=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),m=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),p=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),g=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),y=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),b=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),w=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),C={to:function(e){if(e instanceof s.Inl)return new v(e.value0);if(e instanceof s.Inr)return new m(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Service.Error (line 87, column 1 - line 87, column 39): "+[e.constructor.name])},from:function(e){if(e instanceof v)return new s.Inl(e.value0);if(e instanceof m)return new s.Inr(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Service.Error (line 87, column 1 - line 87, column 39): "+[e.constructor.name])}},h={show:d.genericShow({to:function(e){return e},from:function(e){return e}})(d.genericShowConstructor(d.genericShowArgsArgument(f.showRecord()(f.showRecordFieldsCons({reflectSymbol:function(){return"error"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"message"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"statusCode"}})(f.showRecordFieldsNil)(f.showInt))(f.showString))(f.showString))))({reflectSymbol:function(){return"BlockfrostError"}}))},A={show:d.genericShow(C)(d.genericShowSum(d.genericShowConstructor(d.genericShowArgsArgument(h))({reflectSymbol:function(){return"ServiceBlockfrostError"}}))(d.genericShowConstructor(d.genericShowArgsArgument(f.showString))({reflectSymbol:function(){return"ServiceOtherError"}})))},S={show:function(e){if(e instanceof p)return"(ClientHttpError "+r.printError(e.value0)+")";if(e instanceof g)return"(ClientHttpResponseError "+f.show(o.showStatusCode)(e.value0)+" "+f.show(A)(e.value1)+")";if(e instanceof y)return"(ClientDecodeJsonError ("+f.show(f.showString)(e.value0)+") "+f.show(c.showJsonDecodeError)(e.value1)+")";if(e instanceof b)return"(ClientEncodingError "+e.value0+")";if(e instanceof w)return"(ClientOtherError "+e.value0+")";throw new Error("Failed pattern match at Ctl.Internal.Service.Error (line 54, column 1 - line 76, column 13): "+[e.constructor.name])}},I={decodeAeson:i.aesonObject((function(e){return u.bind(l.bindEither)(t.getField(t.decodeAesonInt)(e)("status_code"))((function(n){return u.bind(l.bindEither)(t.getField(t.decodeAesonString)(e)("error"))((function(r){return u.bind(l.bindEither)(t.getField(t.decodeAesonString)(e)("message"))((function(e){return a.pure(l.applicativeEither)({statusCode:n,error:r,message:e})}))}))}))}))};n.ClientHttpError=p,n.ClientHttpResponseError=g,n.ClientDecodeJsonError=y,n.ClientOtherError=w,n.ServiceBlockfrostError=v,n.ServiceOtherError=m,n.showClientError=S,n.decodeAesonBlockfrostErro=I}(c),function(e){"use strict";e["Ctl.Internal.Types.Chain"]=e["Ctl.Internal.Types.Chain"]||{};var n=e["Ctl.Internal.Types.Chain"],t=function(){function e(){}return e.value=new e,e}(),r=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}();n.TipAtGenesis=t,n.Tip=r}(c),function(e){"use strict";e["Ctl.Internal.QueryM"]=e["Ctl.Internal.QueryM"]||{};var n,t,r,o,a,u,i=e["Ctl.Internal.QueryM"],c=e.Aeson,l=e["Control.Applicative"],s=e["Control.Bind"],f=e["Control.Category"],d=e["Control.Monad.Error.Class"],v=e["Control.Monad.Reader.Class"],m=e["Control.Monad.Reader.Trans"],p=e["Control.Parallel.Class"],g=e["Ctl.Internal.Cardano.Types.Transaction"],y=e["Ctl.Internal.Helpers"],b=e["Ctl.Internal.JsWebSocket"],w=e["Ctl.Internal.Logging"],C=e["Ctl.Internal.QueryM.Dispatcher"],h=e["Ctl.Internal.QueryM.JsonWsp"],A=e["Ctl.Internal.QueryM.Ogmios"],S=e["Ctl.Internal.ServerConfig"],I=e["Ctl.Internal.Service.Error"],T=e["Ctl.Internal.Types.ByteArray"],D=e["Ctl.Internal.Types.Chain"],F=e["Data.Argonaut.Decode.Error"],E=e["Data.Bifunctor"],x=e["Data.Boolean"],M=e["Data.Either"],R=e["Data.Eq"],P=e["Data.Foldable"],k=e["Data.Function"],B=e["Data.Functor"],N=e["Data.Log.Level"],L=e["Data.Map.Internal"],_=e["Data.Maybe"],U=e["Data.Newtype"],H=e["Data.Ord"],q=e["Data.Show"],O=e["Data.Tuple"],V=e["Data.Unfoldable"],W=e["Data.Unit"],K=e.Effect,z=e["Effect.Aff"],J=e["Effect.Aff.Class"],G=e["Effect.Class"],j=e["Effect.Exception"],Q=e["Effect.Ref"],Z=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),X=m.monadReaderT(z.monadAff),Y=m.monadEffectReader(z.monadEffectAff),$=m.monadAskReaderT(z.monadAff),ee=J.monadAffReader(J.monadAffAff),ne=function(e){return m.functorReaderT(e)},te=function(e){return m.bindReaderT(e)},re={log:function(e){return s.bind(te(z.bindAff))(v.asks($)((function(e){return e.config})))((function(n){var t=_.fromMaybe(y.logWithLevel(z.monadEffectAff))(n.customLogger);return J.liftAff(ee)(t(n.logLevel)(e))}))},MonadEffect0:function(){return Y}},oe=function(e){return m.applicativeReaderT(e)},ae={parallel:(o=U.wrap(),a=p.parallel(p.monadParReaderT(z.parallelAff)),u=U.unwrap(),function(e){return o(a(u(e)))}),sequential:(n=U.wrap(),t=p.sequential(p.monadParReaderT(z.parallelAff)),r=U.unwrap(),function(e){return n(t(r(e)))}),Monad0:function(){return X},Applicative1:function(){return oe(z.applicativeParAff)}},ue=function(e){return e.value0},ie=function(e){return function(n){return function(t){return function(r){return function(o){return function(a){return s.bind(z.bindAff)(G.liftEffect(z.monadEffectAff)(h.buildRequest(r)(a)))((function(r){var u=c.stringifyAeson(r.body),i=o(e);return z.makeAff((function(e){return function(){return i.addMessageListener(r.id)((function(n){return function(){return i.removeMessageListener(r.id)(),n instanceof M.Left&&n.value0 instanceof C.ListenerCancelled?W.unit:e(E.lmap(E.bifunctorEither)(C.dispatchErrorToError)(n))()}}))(),i.addRequest(r.id)(new O.Tuple(u,a))(),b._wsSend(n)(t(N.Debug.value))(u)(),function(e){return s.discard(s.discardUnit)(z.bindAff)(G.liftEffect(z.monadEffectAff)(i.removeMessageListener(r.id)))((function(){return G.liftEffect(z.monadEffectAff)(d.throwError(d.monadThrowEffect)(e))}))}}}))}))}}}}}},ce=function(e){return function(n){return function(t){return function(){return Q.modify_(L.delete(H.ordString)(t))(e)(),Q.modify_(L.delete(H.ordString)(t))(n)()}}}},le=function(e){return function(n){return function(t){return function(r){return k.flip(Q.modify_)(n)(L.insert(H.ordString)(t)((function(n){return r(function(){var t=A.aesonObject(k.flip(c.getFieldOptional(e))("result"))(n);if(t instanceof M.Left)return new M.Left(new C.JsonError(t.value0));if(t instanceof M.Right&&t.value0 instanceof _.Just)return new M.Right(t.value0.value0);if(t instanceof M.Right&&t.value0 instanceof _.Nothing)return new M.Left(new C.FaultError(n));throw new Error("Failed pattern match at Ctl.Internal.QueryM (line 667, column 9 - line 670, column 51): "+[t.constructor.name])}())})))}}}},se=function(e){return function(n){return function(t){return{addMessageListener:le(e)(n),removeMessageListener:ce(n)(t),addRequest:function(e){return function(n){return Q.modify_(L.insert(H.ordString)(e)(n.value0))(t)}}}}}},fe=function(e){return function(n){return{addMessageListener:le(A.decodeAesonSubmitTxR)(e),removeMessageListener:ce(e)(n),addRequest:function(e){return function(t){return Q.modify_(L.insert(H.ordString)(e)(new O.Tuple(t.value0,t.value1.value0)))(n)}}}}},de=function(e){return e.value1},ve=function(e){return ie(de(e))(ue(e))},me=s.bind(te(z.bindAff))(v.asks($)((function(e){return e.config.logLevel})))((function(e){return s.bind(te(z.bindAff))(v.asks($)((function(e){return e.config.customLogger})))((function(n){return l.pure(oe(z.applicativeAff))(w.mkLogger(e)(n))}))})),pe=function(e){return function(n){return function(t){return s.bind(te(z.bindAff))(v.asks($)((function(e){return de(e.runtime.ogmiosWs)})))((function(r){return s.bind(te(z.bindAff))(v.asks($)((function(e){return ue(e.runtime.ogmiosWs)})))((function(o){return function(e){return function(n){return function(t){return function(r){return function(o){return s.bind(te(z.bindAff))(me)((function(a){return J.liftAff(ee)(ie(e)(n)(a)(t)(r)(o))}))}}}}}(r)(o)(e)(n)(t)}))}))}}},ge=B.map(ne(z.functorAff))((function(e){if(e instanceof A.CtChainOrigin)return D.TipAtGenesis.value;if(e instanceof A.CtChainPoint)return new D.Tip(U.wrap()({slot:e.value0.slot,blockHeaderHash:U.wrap()(U.unwrap()(e.value0.hash))}));throw new Error("Failed pattern match at Ctl.Internal.QueryM (line 292, column 25 - line 295, column 52): "+[e.constructor.name])}))(pe(A.queryChainTipCall)((function(e){return e.chainTip}))(W.unit)),ye=new F.TypeMismatch("default error"),be=function(e){return function(n){return function(t){return function(r){return function(o){return function(a){var u=function(e){return function(n){return function(r){return G.liftEffect(z.monadEffectAff)(t(N.Debug.value)(e+": "+q.show(q.showBoolean)(n)+" TxHash: "+q.show(T.showByteArray)(r)))}}};return function(){var i=Q.read(a)();return l.unless(K.applicativeEffect)(L.isEmpty(i))(function(e){return function(n){return function(t){return k.flip(z.runAff_)(function(e){return function(n){return ve(e)(n)(A.acquireMempoolSnapshotCall)((function(e){return e.acquireMempool}))(W.unit)}}(e)(n))((function(e){if(e instanceof M.Left)return function(){return n(N.Error.value)("Failed to acquire a mempool snapshot: Error: "+q.show(j.showError)(e.value0))(),z.launchAff_(t(_.Nothing.value))()};if(e instanceof M.Right)return z.launchAff_(t(new _.Just(e.value0)));throw new Error("Failed pattern match at Ctl.Internal.QueryM (line 339, column 62 - line 345, column 47): "+[e.constructor.name])}))}}}(e)(t)((function(f){if(f instanceof _.Nothing)return G.liftEffect(z.monadEffectAff)(P.traverse_(K.applicativeEffect)(L.foldableMap)((function(e){return r(O.fst(e))}))(i));if(f instanceof _.Just)return s.discard(s.discardUnit)(z.bindAff)(z.delay(U.wrap()(5e3)))((function(){var d=L.toUnfoldable(V.unfoldableArray)(i);return P.for_(z.applicativeAff)(P.foldableArray)(d)((function(i){return(d=f.value0,function(i){return function(f){return function(v){var m=c.encodeAeson(c.encodeAesonRecord(c.gEncodeAesonCons(c.encodeAesonRecord(c.gEncodeAesonCons(c.encodeAesonRecord(c.gEncodeAesonCons(T.encodeAesonByteArray)(c.gEncodeAesonNil)({reflectSymbol:function(){return"txId"}})())())(c.gEncodeAesonNil)({reflectSymbol:function(){return"SubmitSuccess"}})())())(c.gEncodeAesonNil)({reflectSymbol:function(){return"result"}})())())({result:{SubmitSuccess:{txId:v}}});return s.bind(z.bindAff)(function(e){return function(n){return function(t){return ve(e)(n)(A.mempoolSnapshotHasTxCall(t))((function(e){return e.mempoolHasTx}))}}}(e)(t)(d)(v))((function(e){return s.discard(s.discardUnit)(z.bindAff)(u("Tx in the mempool")(e)(v))((function(){return s.bind(z.bindAff)(e?l.pure(z.applicativeAff)(!1):s.bind(z.bindAff)(n(v))((function(e){return s.discard(s.discardUnit)(z.bindAff)(u("Tx confirmed")(e)(v))((function(){return s.discard(s.discardUnit)(z.bindAff)(l.unless(z.applicativeAff)(e)(G.liftEffect(z.monadEffectAff)(r(f))))((function(){return l.pure(z.applicativeAff)(!e)}))}))})))((function(e){return l.unless(z.applicativeAff)(e)(G.liftEffect(z.monadEffectAff)((function(){Q.modify_(L.delete(H.ordString)(i))(a)();var e=Q.read(o)();return Q.modify_(L.delete(H.ordString)(i))(o)(),_.maybe(l.pure(K.applicativeEffect)(W.unit))((function(e){return e(m)}))(L.lookup(H.ordString)(i)(e))()})))}))}))}))}}})(i.value0)(i.value1.value0)(i.value1.value1);var d}))}));throw new Error("Failed pattern match at Ctl.Internal.QueryM (line 505, column 41 - line 514, column 70): "+[f.constructor.name])})))()}}}}}}};i.evaluateTxOgmios=function(e){return function(n){return s.bind(te(z.bindAff))(v.asks($)((function(e){return ue(e.runtime.ogmiosWs)})))((function(t){return s.bind(te(z.bindAff))(v.asks($)((function(e){return de(e.runtime.ogmiosWs)})))((function(r){return s.bind(te(z.bindAff))(v.asks($)((function(e){return e.config})))((function(o){return J.liftAff(ee)(ie(r)(t)(w.mkLogger(o.logLevel)(o.customLogger))(A.evaluateTxCall)((function(e){return e.evaluate}))(new O.Tuple(e,n)))}))}))}))}},i.getChainTip=ge,i.getProtocolParametersAff=function(e){return function(n){return ve(e)(n)(A.queryProtocolParametersCall)((function(e){return e.getProtocolParameters}))(W.unit)}},i.getSystemStartAff=function(e){return function(n){return B.map(z.functorAff)(U.unwrap())(ve(e)(n)(A.querySystemStartCall)((function(e){return e.systemStart}))(W.unit))}},i.handleAffjaxResponse=function(e){return function(n){if(n instanceof M.Left)return new M.Left(new I.ClientHttpError(n.value0));if(n instanceof M.Right){if(n.value0.status<200||n.value0.status>299)return new M.Left(new I.ClientHttpResponseError(U.wrap()(n.value0.status),new I.ServiceOtherError(n.value0.body)));if(x.otherwise)return E.lmap(E.bifunctorEither)(I.ClientDecodeJsonError.create(n.value0.body))(s.composeKleisliFlipped(M.bindEither)(c.decodeAeson(e))(c.parseJsonStringToAeson)(n.value0.body))}throw new Error("Failed pattern match at Ctl.Internal.QueryM (line 366, column 1 - line 370, column 31): "+[n.constructor.name])}},i.mkOgmiosRequest=pe,i.mkOgmiosWebSocketAff=function(e){return function(n){return function(t){return s.bind(z.bindAff)(G.liftEffect(z.monadEffectAff)(function(e){return function(n){return function(){var t=C.newDispatcher(),r=C.newPendingRequests(),o=C.newPendingRequests(),a=function(e){return new Z(e,{chainTip:se(A.decodeAesonChainTipQR)(t)(r),evaluate:se(A.decodeAesonTxEvaluationR)(t)(r),getProtocolParameters:se(A.decodeAesonOgmiosProtocol)(t)(r),eraSummaries:se(A.decodeAesonOgmiosEraSumma)(t)(r),currentEpoch:se(A.decodeAesonCurrentEpoch)(t)(r),systemStart:se(A.decodeAesonOgmiosSystemSt)(t)(r),acquireMempool:se(A.decodeAesonMempoolSnapsho)(t)(r),mempoolHasTx:se(c.decodeAesonBoolean)(t)(r),submit:fe(t)(o),poolIds:se(c.decodeAesonArray(g.decodeAesonPoolPubKeyHash))(t)(r),poolParameters:se(A.decodeAesonPoolParameters)(t)(r),delegationsAndRewards:se(A.decodeAesonDelegationsAnd)(t)(r)})};return{serviceName:"ogmios",dispatcher:t,logger:e,typedWebSocket:a,resendPendingRequests:function(u){var i=b._wsSend(u)(e(N.Debug.value));return function(){return s.bind(K.bindEffect)(Q.read(r))(P.traverse_(K.applicativeEffect)(L.foldableMap)(i))(),be(a(u))(n)(e)(i)(t)(o)()}}}}}}(n)(e)))((function(e){return z.makeAff(function(e){return function(n){return function(t){return function(){var r=b._mkWebSocket(e.logger(N.Debug.value))(n)(),o=C.mkWebsocketDispatch(e.dispatcher),a=b._onWsError(r)((function(n){return function(){return b._wsFinalize(r)(),b._wsClose(r)(),e.logger(N.Error.value)("First connection to "+e.serviceName+" WebSocket failed. Terminating. Error: "+n)(),t(new M.Left(j.error(n)))()}}))(),u=Q.new(!1)();return b._onWsConnect(r)((function(){var n=Q.read(u)();if(n)return e.logger(N.Debug.value)(e.serviceName+" WebSocket connection re-established, resending pending requests...")(),e.resendPendingRequests(r)();if(!n)return e.logger(N.Debug.value)("Connection to "+e.serviceName+" established")(),Q.write(!0)(u)(),b._removeOnWsError(r)(a)(),b._onWsMessage(r)(e.logger(N.Debug.value))(function(e){return function(n){return function(t){return function(){var r=d.liftEither(d.monadThrowEffect)(E.lmap(E.bifunctorEither)(k.const(j.error("Unable to parse response")))(c.parseJsonStringToAeson(t)))(),o=P.foldl(P.foldableArray)(function(e){return function(n){return function(t){return function(){var r=n();return M.isRight(r)?n():t(e)()}}}}(r))(l.pure(K.applicativeEffect)(new M.Left(new C.JsonError(ye))))(n)();return M.either((function(n){return l.unless(K.applicativeEffect)(n instanceof C.JsonError&&R.eq(F.eqJsonDecodeError)(n.value0)(ye))(e(N.Error.value)("unexpected error on input: "+t+" Error:"+q.show(C.showDispatchError)(n)))}))(f.identity(f.categoryFn))(o)()}}}}(e.logger)([o]))(),B.void(K.functorEffect)(b._onWsError(r)((function(n){return e.logger(N.Debug.value)(e.serviceName+" WebSocket error ("+n+"). Reconnecting...")})))(),t(new M.Right(e.typedWebSocket(r)))();throw new Error("Failed pattern match at Ctl.Internal.QueryM (line 456, column 54 - line 473, column 48): "+[n.constructor.name])}))(),function(e){return G.liftEffect(z.monadEffectAff)((function(){return b._wsFinalize(r)(),b._wsClose(r)(),t(new M.Left(e))()}))}}}}}(e)(S.mkWsUrl(t)))}))}}},i.submitTxOgmios=function(e){return function(n){return s.bind(te(z.bindAff))(v.asks($)((function(e){return ue(e.runtime.ogmiosWs)})))((function(t){return s.bind(te(z.bindAff))(v.asks($)((function(e){return de(e.runtime.ogmiosWs)})))((function(r){return s.bind(te(z.bindAff))(v.asks($)((function(e){return e.config})))((function(o){return J.liftAff(ee)(ie(r)(t)(w.mkLogger(o.logLevel)(o.customLogger))(A.submitTxCall)((function(e){return e.submit}))(new O.Tuple(e,n)))}))}))}))}},i.underlyingWebSocket=ue,i.functorQueryMT=ne,i.applicativeQueryMT=oe,i.bindQueryMT=te,i.monadQueryMTAff=X,i.monadEffectQueryMTAff=Y,i.monadAffQueryMTAff=ee,i.monadAskQueryEnvQueryMTAf=$,i.monadLoggerQueryMTAff=re,i.parallelQueryMTParAffQuer=ae}(c),function(e){"use strict";e["Ctl.Internal.Contract.QueryHandle.Error"]=e["Ctl.Internal.Contract.QueryHandle.Error"]||{};var n=e["Ctl.Internal.Contract.QueryHandle.Error"],t=function(){function e(){}return e.value=new e,e}(),r=function(){function e(){}return e.value=new e,e}(),o=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}();n.GetTxMetadataTxNotFoundError=t,n.GetTxMetadataMetadataEmptyOrMissingError=r,n.GetTxMetadataClientError=o}(c),function(e){let n;n=t(1164),n=t(6359)(n),e._convertNativeScript=e=>t=>{switch(t.kind()){case n.NativeScriptKind.ScriptPubkey:return e.scriptPubkey(t.as_script_pubkey());case n.NativeScriptKind.ScriptAll:return e.scriptAll(t.as_script_all());case n.NativeScriptKind.ScriptAny:return e.scriptAny(t.as_script_any());case n.NativeScriptKind.ScriptNOfK:return e.scriptNOfK(t.as_script_n_of_k());case n.NativeScriptKind.TimelockStart:return e.timelockStart(t.as_timelock_start());case n.NativeScriptKind.TimelockExpiry:return e.timelockExpiry(t.as_timelock_expiry());default:throw"Impossible native script kind: "+t.kind()}};const r=e=>n=>n[e]();e.scriptPubkey_addr_keyhash=r("addr_keyhash"),e.scriptAllScripts=e=>e.unpackFromProperty("native_scripts"),e.scriptAnyScripts=e=>e.unpackFromProperty("native_scripts"),e.scriptNOfKScripts=e=>e.unpackFromProperty("native_scripts"),e.scriptNOfK_n=r("n"),e.timelockStart_slot=r("slot_bignum"),e.timelockExpiry_slot=r("slot_bignum")}(c["Ctl.Internal.Deserialization.NativeScript"]=c["Ctl.Internal.Deserialization.NativeScript"]||{}),function(e){"use strict";e["Ctl.Internal.Deserialization.NativeScript"]=e["Ctl.Internal.Deserialization.NativeScript"]||{};var n=e["Ctl.Internal.Deserialization.NativeScript"],t=e["Ctl.Internal.Deserialization.NativeScript"],r=e["Control.Applicative"],o=e["Control.Apply"],a=e["Control.Bind"],u=e["Ctl.Internal.Cardano.Types.NativeScript"],i=e["Ctl.Internal.Deserialization.FromBytes"],c=e["Ctl.Internal.FfiHelpers"],l=e["Ctl.Internal.Serialization.Address"],s=e["Data.Argonaut.Decode.Error"],f=e["Data.Either"],d=e["Data.Function"],v=e["Data.Functor"],m=e["Data.Newtype"],p=function(e){return t._convertNativeScript({scriptPubkey:function(e){return u.ScriptPubkey.create(t.scriptPubkey_addr_keyhash(e))},scriptAll:(s=v.map(v.functorArray)(p),f=t.scriptAllScripts(c.containerHelper),function(e){return u.ScriptAll.create(s(f(e)))}),scriptAny:(a=v.map(v.functorArray)(p),i=t.scriptAnyScripts(c.containerHelper),function(e){return u.ScriptAny.create(a(i(e)))}),scriptNOfK:o.apply(o.applyFn)(v.map(v.functorFn)(u.ScriptNOfK.create)(t.scriptNOfK_n))((n=v.map(v.functorArray)(p),r=t.scriptNOfKScripts(c.containerHelper),function(e){return n(r(e))})),timelockStart:function(e){return u.TimelockStart.create(l.Slot(t.timelockStart_slot(e)))},timelockExpiry:function(e){return u.TimelockExpiry.create(l.Slot(t.timelockExpiry_slot(e)))}})(e);var n,r,a,i,s,f};n.convertNativeScript=p,n.decodeNativeScript=function(e){return a.bind(f.bindEither)(d.flip(f.note)(i.fromBytes(i.fromBytesNativeScript)(m.wrap()(e)))(new s.TypeMismatch("decodeNativeScript: from_bytes() call failed")))((function(e){return r.pure(f.applicativeEither)(p(e))}))}}(c),function(e){let n;n=t(1164),n=t(6359)(n),e._convertPlutusData=e=>t=>{switch(t.kind()){case n.PlutusDataKind.ConstrPlutusData:return e.constr(t.as_constr_plutus_data());case n.PlutusDataKind.Map:return e.map(t.as_map());case n.PlutusDataKind.List:return e.list(t.as_list());case n.PlutusDataKind.Integer:return e.integer(t.as_integer());case n.PlutusDataKind.Bytes:return e.bytes(t.as_bytes());default:throw"Impossible PlutusData kind: "+t.kind()}},e._unpackPlutusList=e=>e.unpack,e._ConstrPlutusData_alternative=e=>e.alternative(),e._ConstrPlutusData_data=e=>e.data(),e._unpackPlutusMap=e=>n=>t=>{const r=e.unpack(t.keys()),o=[];for(let e of r)o.push(n(e)(t.get(e)));return o}}(c["Ctl.Internal.Deserialization.PlutusData"]=c["Ctl.Internal.Deserialization.PlutusData"]||{}),function(e){e._BigInt_to_str=e=>e.to_str()}(c["Ctl.Internal.Deserialization.BigInt"]=c["Ctl.Internal.Deserialization.BigInt"]||{}),function(e){"use strict";e["Ctl.Internal.Deserialization.BigInt"]=e["Ctl.Internal.Deserialization.BigInt"]||{};var n=e["Ctl.Internal.Deserialization.BigInt"],t=e["Ctl.Internal.Deserialization.BigInt"],r=e["Data.BigInt"];n.convertBigInt=function(e){return r.fromString(t._BigInt_to_str(e))}}(c),function(e){"use strict";e["Ctl.Internal.Deserialization.PlutusData"]=e["Ctl.Internal.Deserialization.PlutusData"]||{};var n,t,r,o,a=e["Ctl.Internal.Deserialization.PlutusData"],u=e["Ctl.Internal.Deserialization.PlutusData"],i=e["Control.Bind"],c=e["Ctl.Internal.Deserialization.BigInt"],l=e["Ctl.Internal.Deserialization.FromBytes"],s=e["Ctl.Internal.FfiHelpers"],f=e["Ctl.Internal.FromData"],d=e["Ctl.Internal.Types.PlutusData"],v=e["Data.Functor"],m=e["Data.Maybe"],p=e["Data.Tuple"],g=function(e){return new d.Integer(m.fromJust()(c.convertBigInt(e)))},y=d.Bytes.create,b=(n=v.map(v.functorArray)((function(e){return new p.Tuple(C(e.value0),C(e.value1))})),t=u._unpackPlutusMap(s.containerHelper)(p.Tuple.create),function(e){return d.Map.create(n(t(e)))}),w=(r=v.map(v.functorArray)((function(e){return C(e)})),o=u._unpackPlutusList(s.containerHelper),function(e){return d.List.create(r(o(e)))}),C=function(e){return u._convertPlutusData({constr:h,map:b,list:w,integer:g,bytes:y})(e)},h=function(e){var n=v.map(v.functorArray)(C)(u._unpackPlutusList(s.containerHelper)(u._ConstrPlutusData_data(e))),t=u._ConstrPlutusData_alternative(e);return new d.Constr(t,n)};a.convertPlutusData=C,a.deserializeData=function(e){return i.composeKleisliFlipped(m.bindMaybe)((n=f.fromData(e),function(e){return n(C(e))}))(l.fromBytes(l.fromBytesPlutusData));var n}}(c),function(e){let n;n=t(1164),n=t(6359)(n),e._txBody=e=>e.body();e._unpackMetadatums=e=>e.unpackKeyIndexed,e._unpackMetadataMap=e=>e.unpackKeyIndexed,e._unpackMetadataList=e=>e.unpack,e._convertMetadatum=e=>t=>{switch(t.kind()){case n.TransactionMetadatumKind.MetadataMap:return e.from_map(t.as_map());case n.TransactionMetadatumKind.MetadataList:return e.from_list(t.as_list());case n.TransactionMetadatumKind.Int:return e.from_int(t.as_int());case n.TransactionMetadatumKind.Bytes:return e.from_bytes(t.as_bytes());case n.TransactionMetadatumKind.Text:return e.from_text(t.as_text());default:throw"Could not convert to known types."}}}(c["Ctl.Internal.Deserialization.Transaction"]=c["Ctl.Internal.Deserialization.Transaction"]||{}),function(e){"use strict";e["Ctl.Internal.Deserialization.Transaction"]=e["Ctl.Internal.Deserialization.Transaction"]||{};var n=e["Ctl.Internal.Deserialization.Transaction"],t=e["Ctl.Internal.Deserialization.Transaction"],r=e["Ctl.Internal.FfiHelpers"],o=e["Ctl.Internal.Types.BigNum"],a=e["Ctl.Internal.Types.TransactionMetadata"],u=e["Data.Bifunctor"],i=e["Data.Foldable"],c=e["Data.Functor"],l=e["Data.Map.Internal"],s=e["Data.Newtype"],f=function(e){return t._convertMetadatum({from_bytes:a.Bytes.create,from_int:a.Int.create,from_text:a.Text.create,from_map:d,from_list:v})(e)},d=function(e){return new a.MetadataMap(l.fromFoldable(a.ordTransactionMetadatum)(i.foldableArray)(c.map(c.functorArray)(u.bimap(u.bifunctorTuple)(f)(f))(t._unpackMetadataMap(r.containerHelper)(e))))},v=function(e){return new a.MetadataList(c.map(c.functorArray)(f)(t._unpackMetadataList(r.containerHelper)(e)))};n.convertGeneralTransactionMetadata=function(e){return s.wrap()(l.fromFoldable(a.ordTransactionMetadatumLa)(i.foldableArray)(c.map(c.functorArray)(u.bimap(u.bifunctorTuple)((function(e){return a.TransactionMetadatumLabel(o.toBigInt(e))}))(f))(t._unpackMetadatums(r.containerHelper)(e))))},n._txBody=t._txBody}(c),function(e){"use strict";e["Ctl.Internal.QueryM.Kupo"]=e["Ctl.Internal.QueryM.Kupo"]||{};var n,t,r,o,a,u,i,c,l,s,f,d=e["Ctl.Internal.QueryM.Kupo"],v=e.Aeson,m=e.Affjax,p=e["Affjax.ResponseFormat"],g=e["Control.Alt"],y=e["Control.Applicative"],b=e["Control.Apply"],w=e["Control.Bind"],C=e["Control.Monad.Error.Class"],h=e["Control.Monad.Except.Trans"],A=e["Control.Monad.Reader.Class"],S=e["Control.Parallel"],I=e["Control.Parallel.Class"],T=e["Ctl.Internal.Cardano.Types.ScriptRef"],D=e["Ctl.Internal.Cardano.Types.Value"],F=e["Ctl.Internal.Contract.QueryHandle.Error"],E=e["Ctl.Internal.Deserialization.FromBytes"],x=e["Ctl.Internal.Deserialization.NativeScript"],M=e["Ctl.Internal.Deserialization.PlutusData"],R=e["Ctl.Internal.Deserialization.Transaction"],P=e["Ctl.Internal.QueryM"],k=e["Ctl.Internal.Serialization.Address"],B=e["Ctl.Internal.Serialization.Hash"],N=e["Ctl.Internal.ServerConfig"],L=e["Ctl.Internal.Service.Error"],_=e["Ctl.Internal.Service.Helpers"],U=e["Ctl.Internal.Types.BigNum"],H=e["Ctl.Internal.Types.ByteArray"],q=e["Ctl.Internal.Types.CborBytes"],O=e["Ctl.Internal.Types.Datum"],V=e["Ctl.Internal.Types.OutputDatum"],W=e["Ctl.Internal.Types.RawBytes"],K=e["Ctl.Internal.Types.Scripts"],z=e["Ctl.Internal.Types.TokenName"],J=e["Ctl.Internal.Types.Transaction"],G=e["Data.Argonaut.Decode.Error"],j=e["Data.Array"],Q=e["Data.Bifunctor"],Z=e["Data.Boolean"],X=e["Data.Either"],Y=e["Data.Foldable"],$=e["Data.Function"],ee=e["Data.Functor"],ne=e["Data.HTTP.Method"],te=e["Data.Map.Internal"],re=e["Data.Maybe"],oe=e["Data.Monoid"],ae=e["Data.Newtype"],ue=e["Data.String.CodePoints"],ie=e["Data.Traversable"],ce=e["Data.Tuple"],le=e["Data.UInt"],se=e["Data.Unfoldable"],fe=e["Effect.Aff"],de=e["Effect.Aff.Class"],ve=e["Foreign.Object"],me=function(){function e(){}return e.value=new e,e}(),pe=function(){function e(){}return e.value=new e,e}(),ge=function(){function e(){}return e.value=new e,e}(),ye=function(){function e(){}return e.value=new e,e}(),be=function(){function e(){}return e.value=new e,e}(),we={decodeAeson:(n=ee.map(X.functorEither)((function(e){return e.created_at.slot_no})),t=v.decodeAeson(v.decodeAesonRecord(v.gDecodeAesonCons(v.decodeAesonField1(v.decodeAesonRecord(v.gDecodeAesonCons(v.decodeAesonField1(k.decodeAesonSlot))(v.gDecodeAesonRowNil)({reflectSymbol:function(){return"slot_no"}})()())()))(v.gDecodeAesonRowNil)({reflectSymbol:function(){return"created_at"}})()())()),function(e){return n(t(e))})},Ce={decodeAeson:_.aesonString((function(e){return"native"===e?y.pure(X.applicativeEither)(me.value):"plutus:v1"===e?y.pure(X.applicativeEither)(pe.value):"plutus:v2"===e?y.pure(X.applicativeEither)(ge.value):new X.Left(new G.TypeMismatch("language: expected 'native' or 'plutus:v{1|2}', got: "+e))}))},he={decodeAeson:function(e){if(v.isNull(e))return y.pure(X.applicativeEither)(re.Nothing.value);if(Z.otherwise)return _.aesonObject((function(e){return w.bind(X.bindEither)(v.getField(Ce)(e)("language"))((function(n){return w.bind(X.bindEither)(v.getField(H.decodeAesonByteArray)(e)("script"))((function(e){return ee.map(X.functorEither)((function(e){return re.Just.create(e)}))(function(){if(n instanceof me)return ee.map(X.functorEither)(T.NativeScriptRef.create)(x.decodeNativeScript(e));if(n instanceof pe)return y.pure(X.applicativeEither)(new T.PlutusScriptRef(K.plutusV1Script(e)));if(n instanceof ge)return y.pure(X.applicativeEither)(new T.PlutusScriptRef(K.plutusV2Script(e)));throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 396, column 13 - line 402, column 68): "+[n.constructor.name])}())}))}))}))(e);throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 388, column 1 - line 402, column 68): "+[e.constructor.name])}},Ae={decodeAeson:w.composeKleisli(X.bindEither)(v.decodeAeson(v.decodeAesonArray(v.decodeAesonRecord(v.gDecodeAesonCons(v.decodeAesonField1(q.decodeAesonCborBytes))(v.gDecodeAesonRowNil)({reflectSymbol:function(){return"raw"}})()())())))((function(e){return 1===e.length?w.bind(X.bindEither)($.flip(X.note)(E.fromBytes(E.fromBytesGeneralTransacti)(e[0].raw))(new G.TypeMismatch("Hexadecimal encoded Metadata")))((function(e){return y.pure(X.applicativeEither)(new re.Just(R.convertGeneralTransactionMetadata(e)))})):0===e.length?new X.Right(re.Nothing.value):new X.Left(new G.TypeMismatch("Singleton or Empty Array"))}))},Se={decodeAeson:_.aesonString((function(e){return"hash"===e?y.pure(X.applicativeEither)(ye.value):"inline"===e?y.pure(X.applicativeEither)(be.value):new X.Left(new G.TypeMismatch("datum_type: expected 'hash' or 'inline', got: "+e))}))},Ie={decodeAeson:(r=function(e){var n=function(n){return function(t){return new G.TypeMismatch("In "+e.value0+": Expected hex-encoded "+n+", got: "+t)}},t=function(){var n,t=ue.indexOf(".")(e.value0);if(t instanceof re.Nothing)return new ce.Tuple(e.value0,oe.mempty(oe.monoidString));if(t instanceof re.Just)return n=ue.splitAt(t.value0)(e.value0),new ce.Tuple(n.before,ue.drop(1)(n.after));throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 255, column 13 - line 260, column 72): "+[t.constructor.name])}();return b.apply(X.applyEither)(b.apply(X.applyEither)(ee.map(X.functorEither)(D.mkSingletonNonAdaAsset)(X.note(n("CurrencySymbol")(t.value0))(w.bindFlipped(re.bindMaybe)(D.mkCurrencySymbol)(H.hexToByteArray(t.value0)))))(X.note(n("TokenName")(t.value1))(w.bindFlipped(re.bindMaybe)(z.mkTokenName)(H.hexToByteArray(t.value1)))))(y.pure(X.applicativeEither)(e.value1))},o=w.composeKleisli(X.bindEither)($.flip(v.getField(v.decodeAesonAeson))("value"))(_.aesonObject((function(e){return w.bind(X.bindEither)(v.getField(D.decodeAesonCoin)(e)("coins"))((function(n){return w.bind(X.bindEither)(ee.mapFlipped(X.functorEither)(v.getFieldOptional(v.decodeAesonObject(v.decodeAesonBigInt))(e)("assets"))((t=re.fromMaybe(oe.mempty(oe.monoidArray)),o=ee.map(re.functorMaybe)(ve.toUnfoldable(se.unfoldableArray)),function(e){return t(o(e))})))((function(e){return ee.map(X.functorEither)((t=D.mkValue(n),o=Y.fold(Y.foldableArray)(D.monoidNonAdaAsset),function(e){return t(o(e))}))(ie.traverse(ie.traversableArray)(X.applicativeEither)(r)(e));var t,o}));var t,o}))}))),_.aesonObject((function(e){return w.bind(X.bindEither)(function(e){return w.bind(X.bindEither)(v.getField(v.decodeAesonString)(e)("address"))((function(e){return X.note(new G.TypeMismatch("Expected bech32 or base16 encoded Shelley address"))(g.alt(re.altMaybe)(k.addressFromBech32(e))(w.bindFlipped(re.bindMaybe)(E.fromBytes(E.fromBytesAddress))(q.hexToCborBytes(e))))}))}(e))((function(n){return w.bind(X.bindEither)(o(e))((function(t){return w.bind(X.bindEither)(function(e){return w.bind(X.bindEither)(v["getFieldOptional'"](J.decodeAesonDataHash)(e)("datum_hash"))(ie.traverse(ie.traversableMaybe)(X.applicativeEither)((function(n){return ee.map(X.functorEither)(ce.Tuple.create(n))(v.getField(Se)(e)("datum_type"))})))}(e))((function(r){return w.bind(X.bindEither)(v["getFieldOptional'"](B.decodeAesonScriptHash)(e)("script_hash"))((function(e){return y.pure(X.applicativeEither)(ae.wrap()({address:n,amount:t,datumHash:r,scriptHash:e}))}))}))}))}))})))},Te={decodeAeson:(l=w.composeKleisli(X.bindEither)($.flip(v.getField(v.decodeAesonString))("transaction_id"))((function(e){return function(e){if(e instanceof re.Nothing)return new X.Left(new G.TypeMismatch("Expected hexstring"));if(e instanceof re.Just)return y.pure(X.applicativeEither)(e.value0);throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 305, column 61 - line 307, column 63): "+[e.constructor.name])}(H.hexToByteArray(e))})),s=_.aesonObject((function(e){return w.bind(X.bindEither)(l(e))((function(n){return w.bind(X.bindEither)(v.getField(v.decodeAesonUInt)(e)("output_index"))((function(e){return y.pure(X.applicativeEither)({transactionId:n,index:e})}))}))})),f=function(e){return b.apply(X.applyEither)(ee.map(X.functorEither)(ce.Tuple.create)(s(e)))(v.decodeAeson(Ie)(e))},_.aesonArray((i=ee.map(X.functorEither)((a=ae.wrap(),u=te.fromFoldable(J.ordTransactionInput)(Y.foldableArray),function(e){return a(u(e))})),c=ie.traverse(ie.traversableArray)(X.applicativeEither)(f),function(e){return i(c(e))})))},De={decodeAeson:function(e){if(v.isNull(e))return y.pure(X.applicativeEither)(re.Nothing.value);if(Z.otherwise)return w.bind(X.bindEither)(_.aesonObject($.flip(v.getFieldOptional(q.decodeAesonCborBytes))("datum"))(e))((n=y.pure(X.applicativeEither),t=w.bindFlipped(re.bindMaybe)(M.deserializeData(O.fromDataDatum)),function(e){return n(t(e))}));var n,t;throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 354, column 1 - line 359, column 65): "+[e.constructor.name])}},Fe=ae.unwrap(),Ee=ae.unwrap(),xe=function(e){return function(n){return m.request({method:new X.Left(ne.GET.value),url:N.mkHttpUrl(e)+n,headers:m.defaultRequest.headers,content:m.defaultRequest.content,username:m.defaultRequest.username,password:m.defaultRequest.password,withCredentials:m.defaultRequest.withCredentials,responseFormat:p.string,timeout:m.defaultRequest.timeout})}},Me=function(e){return w.bind(P.bindQueryMT(fe.bindAff))(A.asks(P.monadAskQueryEnvQueryMTAf)((function(e){return e.config.kupoConfig})))((function(n){return de.liftAff(P.monadAffQueryMTAff)(xe(n)(e))}))},Re=function(e){return function(n){return h.runExceptT((t="/matches/*@"+H.byteArrayToHex(n),w.bind(h.bindExceptT(fe.monadAff))(ee.map(fe.functorAff)(P.handleAffjaxResponse(v.decodeAesonArray(we)))(xe(e)(t)))((function(e){return y.pure(h.applicativeExceptT(fe.monadAff))(ee.mapFlipped(re.functorMaybe)(j.uncons(e))((function(e){return e.head})))}))));var t}},Pe=function(e){return w.bind(P.bindQueryMT(fe.bindAff))(A.asks(P.monadAskQueryEnvQueryMTAf)((function(e){return e.config.kupoConfig})))((function(n){return de.liftAff(P.monadAffQueryMTAff)(Re(n)(e))}))},ke=function(e){var n,t,r="/scripts/"+W.rawBytesToHex(B.scriptHashToBytes(e));return ee.mapFlipped(P.functorQueryMT(fe.functorAff))(Me(r))((n=ee.map(X.functorEither)(Fe),t=P.handleAffjaxResponse(he),function(e){return n(t(e))}))},Be=function(e){var n,t,r="/datums/"+H.byteArrayToHex(e);return ee.mapFlipped(P.functorQueryMT(fe.functorAff))(Me(r))((n=ee.map(X.functorEither)(Ee),t=P.handleAffjaxResponse(De),function(e){return n(t(e))}))},Ne=function(e){return h.runExceptT(S.parTraverse(I.monadParExceptT(P.parallelQueryMTParAffQuer))(te.traversableMap)((function(e){return h.ExceptT(function(e){var n=function(){if(e.scriptHash instanceof re.Nothing)return y.pure(P.applicativeQueryMT(fe.applicativeAff))(new X.Right(re.Nothing.value));if(e.scriptHash instanceof re.Just)return h.runExceptT(w.bind(h.bindExceptT(P.monadQueryMTAff))(ke(e.scriptHash.value0))((function(e){return h.except(P.applicativeQueryMT(fe.applicativeAff))(ee.map(X.functorEither)(re.Just.create)($.flip(X.note)(e)(new L.ClientOtherError("Kupo: Failed to resolve reference script"))))})));throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 336, column 5 - line 341, column 72): "+[e.scriptHash.constructor.name])}(),t=function(){if(e.datumHash instanceof re.Nothing)return y.pure(P.applicativeQueryMT(fe.applicativeAff))(new X.Right(V.NoOutputDatum.value));if(e.datumHash instanceof re.Just&&e.datumHash.value0.value1 instanceof ye)return y.pure(P.applicativeQueryMT(fe.applicativeAff))(new X.Right(new V.OutputDatumHash(e.datumHash.value0.value0)));if(e.datumHash instanceof re.Just&&e.datumHash.value0.value1 instanceof be)return h.runExceptT(w.bind(h.bindExceptT(P.monadQueryMTAff))(Be(e.datumHash.value0.value0))((function(e){return h.except(P.applicativeQueryMT(fe.applicativeAff))(ee.map(X.functorEither)(V.OutputDatum.create)($.flip(X.note)(e)(new L.ClientOtherError("Kupo: Failed to resolve inline datum"))))})));throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 325, column 5 - line 332, column 68): "+[e.datumHash.constructor.name])}();return h.runExceptT(b.apply(h.applyExceptT(P.monadQueryMTAff))(ee.map(h.functorExceptT(P.functorQueryMT(fe.functorAff)))((function(n){return function(t){return{address:e.address,amount:e.amount,datum:n,scriptRef:t}}}))(t))(n))}(e))}))(e))};d.getDatumByHash=Be,d.getScriptByHash=ke,d.getTxMetadata=function(e){return h.runExceptT(w.bind(h.bindExceptT(P.monadQueryMTAff))(ee.map(P.functorQueryMT(fe.functorAff))(Q.lmap(Q.bifunctorEither)(F.GetTxMetadataClientError.create))(Pe(e)))((function(n){if(n instanceof re.Nothing)return C.throwError(h.monadThrowExceptT(P.monadQueryMTAff))(F.GetTxMetadataTxNotFoundError.value);if(n instanceof re.Just){var t="/metadata/"+U.toString(ae.unwrap()(n.value0))+"?transaction_id="+H.byteArrayToHex(ae.unwrap()(e));return w.bind(h.bindExceptT(P.monadQueryMTAff))(ee.map(P.functorQueryMT(fe.functorAff))((r=Q.lmap(Q.bifunctorEither)(F.GetTxMetadataClientError.create),o=P.handleAffjaxResponse(Ae),function(e){return r(o(e))}))(Me(t)))((function(e){var n=e;if(n instanceof re.Nothing)return C.throwError(h.monadThrowExceptT(P.monadQueryMTAff))(F.GetTxMetadataMetadataEmptyOrMissingError.value);if(n instanceof re.Just){if(te.isEmpty(ae.unwrap()(n.value0)))return C.throwError(h.monadThrowExceptT(P.monadQueryMTAff))(F.GetTxMetadataMetadataEmptyOrMissingError.value);if(Z.otherwise)return y.pure(h.applicativeExceptT(P.monadQueryMTAff))(n.value0)}throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 178, column 7 - line 183, column 39): "+[n.constructor.name])}))}var r,o;throw new Error("Failed pattern match at Ctl.Internal.QueryM.Kupo (line 167, column 72 - line 183, column 39): "+[n.constructor.name])})))},d.getUtxoByOref=function(e){var n,t=(n=H.byteArrayToHex(ae.unwrap()(e.transactionId)),"/matches/"+le.toString(e.index)+"@"+n+"?unspent");return h.runExceptT(w.bind(h.bindExceptT(P.monadQueryMTAff))(ee.map(P.functorQueryMT(fe.functorAff))(P.handleAffjaxResponse(Te))(Me(t)))((function(n){return w.bind(h.bindExceptT(P.monadQueryMTAff))(Ne(n))((function(n){return y.pure(h.applicativeExceptT(P.monadQueryMTAff))(te.lookup(J.ordTransactionInput)(e)(n))}))})))},d.isTxConfirmed=Pe,d.isTxConfirmedAff=Re,d.utxosAt=function(e){return h.runExceptT((n="/matches/"+k.addressBech32(e)+"?unspent",w.bind(h.bindExceptT(P.monadQueryMTAff))(ee.map(P.functorQueryMT(fe.functorAff))(P.handleAffjaxResponse(Te))(Me(n)))((function(e){return Ne(e)}))));var n}}(c),function(e){"use strict";e["Control.Monad.Logger.Class"]=e["Control.Monad.Logger.Class"]||{};var n=e["Control.Monad.Logger.Class"],t=e["Control.Bind"],r=e["Control.Monad.Except.Trans"],o=e["Control.Monad.Reader.Trans"],a=e["Control.Monad.Trans.Class"],u=e["Data.JSDate"],i=e["Data.Log.Level"],c=e["Effect.Class"],l=function(e){return e.log},s=function(e){return function(n){return function(r){return function(o){return t.bind(e.MonadEffect0().Monad0().Bind1())(c.liftEffect(e.MonadEffect0())(u.now))((a=l(e),function(e){return a({level:n,message:o,tags:r,timestamp:e})}));var a}}}};n.log=l,n.trace=function(e){return s(e)(i.Trace.value)},n.debug=function(e){return s(e)(i.Debug.value)},n.info=function(e){return s(e)(i.Info.value)},n.warn=function(e){return s(e)(i.Warn.value)},n.error=function(e){return s(e)(i.Error.value)},n.monadLoggerExceptT=function(e){return{log:(n=a.lift(r.monadTransExceptT)(e.MonadEffect0().Monad0()),t=l(e),function(e){return n(t(e))}),MonadEffect0:function(){return r.monadEffectExceptT(e.MonadEffect0())}};var n,t},n.monadLoggerReaderT=function(e){return{log:(n=a.lift(o.monadTransReaderT)(e.MonadEffect0().Monad0()),t=l(e),function(e){return n(t(e))}),MonadEffect0:function(){return o.monadEffectReader(e.MonadEffect0())}};var n,t}}(c),function(e){"use strict";e["Control.Monad.Maybe.Trans"]=e["Control.Monad.Maybe.Trans"]||{};var n=e["Control.Monad.Maybe.Trans"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad"],a=e["Data.Functor"],u=e["Data.Maybe"],i=function(e){return{map:function(n){return function(t){return a.map(e)(a.map(u.functorMaybe)(n))(t)}}}},c=function(e){return{Applicative0:function(){return f(e)},Bind1:function(){return l(e)}}},l=function(e){return{bind:function(n){return function(o){return r.bind(e.Bind1())(n)((function(n){if(n instanceof u.Nothing)return t.pure(e.Applicative0())(u.Nothing.value);if(n instanceof u.Just)return o(n.value0);throw new Error("Failed pattern match at Control.Monad.Maybe.Trans (line 55, column 11 - line 57, column 42): "+[n.constructor.name])}))}},Apply0:function(){return s(e)}}},s=function(e){return{apply:o.ap(c(e)),Functor0:function(){return i(e.Bind1().Apply0().Functor0())}}},f=function(e){return{pure:(n=t.pure(e.Applicative0()),function(e){return n(u.Just.create(e))}),Apply0:function(){return s(e)}};var n};n.runMaybeT=function(e){return e},n.functorMaybeT=i,n.bindMaybeT=l}(c),function(e){let n;n=t(1164),n=t(6359)(n);const r=e=>n=>t=>()=>n["set_"+e](t);e.hashTransaction=e=>()=>n.hash_transaction(e),e.newValueFromAssets=e=>()=>n.Value.new_from_assets(e),e.valueSetCoin=r("coin"),e.newTransactionInput=e=>t=>()=>n.TransactionInput.new(e,t),e.newTransactionInputs=()=>n.TransactionInputs.new(),e.addTransactionInput=e=>n=>()=>e.add(n),e.newTransactionOutput=e=>t=>()=>n.TransactionOutput.new(e,t),e.newTransactionOutputs=()=>n.TransactionOutputs.new(),e.addTransactionOutput=e=>n=>()=>e.add(n),e.newTransactionBody=e=>t=>r=>()=>n.TransactionBody.new_tx_body(e,t,r),e.setTxIsValid=e=>n=>()=>e.set_is_valid(n),e.newTransaction=e=>t=>r=>()=>n.Transaction.new(e,t,r),e.newTransaction_=e=>t=>()=>n.Transaction.new(e,t),e.newMultiAsset=()=>n.MultiAsset.new(),e.insertMultiAsset=e=>n=>t=>()=>e.insert(n,t),e.newAssets=()=>n.Assets.new(),e.insertAssets=e=>n=>t=>()=>e.insert(n,t),e.newAssetName=e=>()=>n.AssetName.new(e),e.transactionOutputSetDataHash=r("data_hash"),e.transactionOutputSetPlutusData=r("plutus_data"),e.transactionOutputSetScriptRef=r("script_ref"),e.scriptRefNewNativeScript=e=>n.ScriptRef.new_native_script(e),e.scriptRefNewPlutusScript=e=>n.ScriptRef.new_plutus_script(e),e.makeVkeywitness=e=>t=>()=>n.make_vkey_witness(e,t),e.publicKeyHash=e=>e.hash(),e.newCostmdls=()=>n.Costmdls.new(),e.costmdlsSetCostModel=e=>n=>t=>()=>e.insert(n,t),e.newCostModel=()=>n.CostModel.new(),e.costModelSetCost=e=>n=>t=>()=>e.set(n,t),e.newPlutusV1=()=>n.Language.new_plutus_v1(),e.newPlutusV2=()=>n.Language.new_plutus_v2(),e._hashScriptData=e=>t=>r=>()=>{const o=n.PlutusList.new();return r.forEach((e=>o.add(e))),n.hash_script_data(e,t,o)},e._hashScriptDataNoDatums=e=>t=>()=>n.hash_script_data(e,t),e.newRedeemers=()=>n.Redeemers.new(),e.addRedeemer=e=>n=>()=>e.add(n),e.setTxBodyReferenceInputs=e=>n=>()=>e.set_reference_inputs(n),e.setTxBodyScriptDataHash=r("script_data_hash"),e.setTxBodyMint=r("mint"),e.newMint=()=>n.Mint.new(),e._bigIntToInt=e=>t=>{try{const r=t.to_str();return"-"==r[0]?e.just(n.Int.new_negative(n.BigNum.from_str(r.slice(1)))):e.just(n.Int.new(n.BigNum.from_str(r)))}catch(n){return e.nothing}},e.newMintAssets=n.MintAssets.new,e.insertMintAssets=e=>n=>t=>()=>e.insert(n,t),e.insertMintAsset=e=>n=>t=>()=>e.insert(n,t),e.networkIdTestnet=()=>n.NetworkId.testnet(),e.networkIdMainnet=()=>n.NetworkId.mainnet(),e.setTxBodyCollateralReturn=e=>n=>()=>e.set_collateral_return(n),e.setTxBodyTotalCollateral=e=>n=>()=>e.set_total_collateral(n),e.setTxBodyTtl=r("ttl"),e.setTxBodyCerts=r("certs"),e.newCertificates=()=>n.Certificates.new(),e.newStakeRegistrationCertificate=e=>()=>n.Certificate.new_stake_registration(n.StakeRegistration.new(e)),e.newStakeDeregistrationCertificate=e=>()=>n.Certificate.new_stake_deregistration(n.StakeDeregistration.new(e)),e.newStakeDelegationCertificate=e=>t=>()=>n.Certificate.new_stake_delegation(n.StakeDelegation.new(e,t)),e.newPoolRegistrationCertificate=e=>t=>r=>o=>a=>u=>i=>c=>l=>()=>n.Certificate.new_pool_registration(n.PoolRegistration.new(n.PoolParams.new(e,t,r,o,a,u,i,c,l))),e.newUnitInterval=e=>t=>()=>n.UnitInterval.new(e,t),e.newPoolRetirementCertificate=e=>t=>()=>n.Certificate.new_pool_retirement(n.PoolRetirement.new(e,t)),e.newGenesisKeyDelegationCertificate=e=>t=>r=>()=>n.Certificate.new_genesis_key_delegation(n.GenesisKeyDelegation.new(e,t,r)),e.addCert=e=>n=>()=>e.add(n),e.setTxBodyCollateral=r("collateral"),e.setTxBodyNetworkId=r("network_id"),e.transactionBodySetRequiredSigners=e=>t=>r=>()=>t.set_required_signers(e.pack(n.Ed25519KeyHashes,r)),e.transactionBodySetValidityStartInterval=r("validity_start_interval_bignum"),e.transactionBodySetAuxiliaryDataHash=e=>n=>()=>e.set_auxiliary_data_hash(n),e.convertPoolOwners=e=>t=>()=>e.pack(n.Ed25519KeyHashes,t),e.packRelays=e=>t=>e.pack(n.Relays,t),e.newIpv4=e=>()=>n.Ipv4.new(e),e.newIpv6=e=>()=>n.Ipv6.new(e),e.newSingleHostAddr=e=>t=>r=>()=>n.Relay.new_single_host_addr(n.SingleHostAddr.new(e,t,r)),e.newSingleHostName=e=>t=>()=>n.Relay.new_single_host_name(n.SingleHostName.new(e,n.DNSRecordAorAAAA.new(t))),e.newMultiHostName=e=>()=>n.Relay.new_multi_host_name(n.MultiHostName.new(n.DNSRecordSRV.new(e))),e.newPoolMetadata=e=>t=>()=>n.PoolMetadata.new(n.URL.new(e),t),e.newMoveInstantaneousRewardToOtherPot=e=>t=>()=>n.MoveInstantaneousReward.new_to_other_pot(e,t),e.newMoveInstantaneousRewardToStakeCreds=e=>t=>()=>n.MoveInstantaneousReward.new_to_stake_creds(e,t),e.newMIRToStakeCredentials=e=>t=>()=>e.packMap(n.MIRToStakeCredentials,t),e.newMoveInstantaneousRewardsCertificate=e=>()=>n.Certificate.new_move_instantaneous_rewards_cert(n.MoveInstantaneousRewardsCert.new(e)),e.newWithdrawals=e=>t=>()=>e.packMap(n.Withdrawals,t),e.setTxBodyWithdrawals=r("withdrawals"),e.setTxBodyUpdate=r("update"),e.newUpdate=e=>t=>()=>n.Update.new(e,t),e.ppuSetMinfeeA=r("minfee_a"),e.ppuSetMinfeeB=r("minfee_b"),e.ppuSetMaxBlockBodySize=r("max_block_body_size"),e.ppuSetMaxTxSize=r("max_tx_size"),e.ppuSetMaxBlockHeaderSize=r("max_block_header_size"),e.ppuSetKeyDeposit=r("key_deposit"),e.ppuSetPoolDeposit=r("pool_deposit"),e.ppuSetMaxEpoch=r("max_epoch"),e.ppuSetNOpt=r("n_opt"),e.ppuSetPoolPledgeInfluence=r("pool_pledge_influence"),e.ppuSetExpansionRate=r("expansion_rate"),e.ppuSetTreasuryGrowthRate=r("treasury_growth_rate"),e.newProtocolVersion=e=>t=>()=>n.ProtocolVersion.new(e,t),e.ppuSetProtocolVersion=e=>n=>()=>e.set_protocol_version(n),e.ppuSetMinPoolCost=r("min_pool_cost"),e.ppuSetAdaPerUtxoByte=r("ada_per_utxo_byte"),e.ppuSetCostModels=r("cost_models"),e.newExUnitPrices=e=>t=>()=>n.ExUnitPrices.new(e,t),e.ppuSetExecutionCosts=r("execution_costs"),e.ppuSetMaxTxExUnits=r("max_tx_ex_units"),e.ppuSetMaxBlockExUnits=r("max_block_ex_units"),e.ppuSetMaxValueSize=r("max_value_size"),e.ppuSetCollateralPercentage=r("collateral_percentage"),e.ppuSetMaxCollateralInputs=r("max_collateral_inputs"),e.newProtocolParamUpdate=()=>n.ProtocolParamUpdate.new(),e.newProposedProtocolParameterUpdates=e=>t=>()=>e.packMap(n.ProposedProtocolParameterUpdates,t)}(c["Ctl.Internal.Serialization"]=c["Ctl.Internal.Serialization"]||{}),function(e){let n;n=t(1164),n=t(6359)(n);const r=e=>n=>t=>()=>n["set_"+e](t);e.newAuxiliaryData=()=>n.AuxiliaryData.new(),e.setAuxiliaryDataNativeScripts=r("native_scripts"),e.setAuxiliaryDataPlutusScripts=r("plutus_scripts"),e.setAuxiliaryDataGeneralTransactionMetadata=r("metadata"),e.newGeneralTransactionMetadata=e=>t=>()=>e.packMap(n.GeneralTransactionMetadata,t),e.newMetadataMap=e=>t=>()=>n.TransactionMetadatum.new_map(e.packMap(n.MetadataMap,t)),e.newMetadataList=e=>t=>()=>n.TransactionMetadatum.new_list(e.pack(n.MetadataList,t)),e.newMetadataInt=e=>()=>n.TransactionMetadatum.new_int(e),e.newMetadataBytes=e=>()=>n.TransactionMetadatum.new_bytes(e),e.newMetadataText=e=>()=>n.TransactionMetadatum.new_text(e)}(c["Ctl.Internal.Serialization.AuxiliaryData"]=c["Ctl.Internal.Serialization.AuxiliaryData"]||{}),function(e){let n;n=t(1164),n=t(6359)(n);const r=e=>t=>n.NativeScript[e](t);e.mkScriptPubkey=e=>n.ScriptPubkey.new(e),e.nativeScript_new_script_pubkey=r("new_script_pubkey"),e.nativeScript_new_script_all=r("new_script_all"),e.nativeScript_new_script_any=r("new_script_any"),e.nativeScript_new_script_n_of_k=r("new_script_n_of_k"),e.nativeScript_new_timelock_start=r("new_timelock_start"),e.nativeScript_new_timelock_expiry=r("new_timelock_expiry"),e._packNativeScripts=e=>t=>e.pack(n.NativeScripts,t),e.mkScriptAll=e=>n.ScriptAll.new(e),e.mkScriptAny=e=>n.ScriptAny.new(e),e.mkScriptNOfK=e=>t=>n.ScriptNOfK.new(e,t),e.mkTimelockExpiry=e=>n.TimelockExpiry.new_timelockexpiry(e),e.mkTimelockStart=e=>n.TimelockStart.new_timelockstart(e)}(c["Ctl.Internal.Serialization.NativeScript"]=c["Ctl.Internal.Serialization.NativeScript"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.NativeScript"]=e["Ctl.Internal.Serialization.NativeScript"]||{};var n,t=e["Ctl.Internal.Serialization.NativeScript"],r=e["Ctl.Internal.Serialization.NativeScript"],o=e["Ctl.Internal.Cardano.Types.NativeScript"],a=e["Ctl.Internal.FfiHelpers"],u=e["Data.Functor"],i=r._packNativeScripts(a.containerHelper),c=function(e){if(e instanceof o.ScriptPubkey)return n=e.value0,r.nativeScript_new_script_pubkey(r.mkScriptPubkey(n));var n,t,a;if(e instanceof o.ScriptAll)return t=e.value0,r.nativeScript_new_script_all(r.mkScriptAll(i(u.map(u.functorArray)(c)(t))));if(e instanceof o.ScriptAny)return function(e){return r.nativeScript_new_script_any(r.mkScriptAny(i(u.map(u.functorArray)(c)(e))))}(e.value0);if(e instanceof o.ScriptNOfK)return(a=e.value0,function(e){return r.nativeScript_new_script_n_of_k(r.mkScriptNOfK(a)(i(u.map(u.functorArray)(c)(e))))})(e.value1);if(e instanceof o.TimelockStart)return function(e){return r.nativeScript_new_timelock_start(r.mkTimelockStart(e))}(e.value0);if(e instanceof o.TimelockExpiry)return function(e){return r.nativeScript_new_timelock_expiry(r.mkTimelockExpiry(e))}(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Serialization.NativeScript (line 38, column 23 - line 44, column 54): "+[e.constructor.name])},l=(n=u.map(u.functorArray)(c),function(e){return i(n(e))});t.convertNativeScript=c,t.convertNativeScripts=l}(c),function(e){let n;n=t(1164),n=t(6359)(n),e.newPlutusV1Script=e=>n.PlutusScript.new(e),e.newPlutusV2Script=e=>n.PlutusScript.new_v2(e)}(c["Ctl.Internal.Serialization.PlutusScript"]=c["Ctl.Internal.Serialization.PlutusScript"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.PlutusScript"]=e["Ctl.Internal.Serialization.PlutusScript"]||{};var n=e["Ctl.Internal.Serialization.PlutusScript"],t=e["Ctl.Internal.Serialization.PlutusScript"],r=e["Ctl.Internal.Types.Scripts"];n.convertPlutusScript=function(e){return function(){if(e.value1 instanceof r.PlutusV1)return t.newPlutusV1Script;if(e.value1 instanceof r.PlutusV2)return t.newPlutusV2Script;throw new Error("Failed pattern match at Ctl.Internal.Serialization.PlutusScript (line 24, column 11 - line 26, column 36): "+[e.value1.constructor.name])}()(e.value0)}}(c),function(e){let n;n=t(1164),n=t(6359)(n),e.newTransactionWitnessSet=()=>n.TransactionWitnessSet.new(),e.newVkeyFromPublicKey=e=>()=>n.Vkey.new(e),e.newVkeywitnesses=()=>n.Vkeywitnesses.new(),e.newVkeywitness=e=>t=>()=>n.Vkeywitness.new(e,t),e.addVkeywitness=e=>n=>()=>e.add(n),e.newPlutusScripts=()=>n.PlutusScripts.new(),e.addPlutusScript=e=>n=>()=>e.add(n),e.transactionWitnessSetSetVkeys=e=>n=>()=>e.set_vkeys(n),e.txWitnessSetSetPlutusScripts=e=>n=>()=>e.set_plutus_scripts(n),e.transactionWitnessSetSetNativeScripts=e=>n=>()=>e.set_native_scripts(n),e._wsSetBootstraps=e=>t=>r=>()=>t.set_bootstraps(e.pack(n.BootstrapWitnesses,r)),e.newBootstrapWitness=e=>t=>r=>o=>()=>{n.BootstrapWitness.new(e,t,r,o)},e._wsSetPlutusData=e=>t=>r=>()=>t.set_plutus_data(e.pack(n.PlutusList,r)),e.newRedeemer=e=>t=>r=>o=>()=>n.Redeemer.new(e,t,r,o),e._newRedeemerTag=e=>()=>n.RedeemerTag["new_"+e](),e.newExUnits=e=>t=>n.ExUnits.new(e,t),e._wsSetRedeemers=e=>t=>r=>()=>t.set_redeemers(e.pack(n.Redeemers,r)),e._wsSetPlutusScripts=e=>t=>r=>()=>t.set_plutus_scripts(e.pack(n.PlutusScripts,r))}(c["Ctl.Internal.Serialization.WitnessSet"]=c["Ctl.Internal.Serialization.WitnessSet"]||{}),function(e){let n;n=t(1164),n=t(6359)(n),e._mkPlutusData_bytes=e=>n.PlutusData.new_bytes(e),e._mkPlutusData_list=e=>n.PlutusData.new_list(e),e._mkPlutusData_map=e=>n.PlutusData.new_map(e),e._mkPlutusData_integer=e=>n.PlutusData.new_integer(e),e._mkPlutusData_constr=e=>n.PlutusData.new_constr_plutus_data(e),e._packPlutusList=e=>t=>e.pack(n.PlutusList,t),e._mkConstrPlutusData=e=>t=>n.ConstrPlutusData.new(e,t),e._bigIntFromString=e=>t=>{try{return e.just(n.BigInt.from_str(t))}catch(n){return e.nothing}},e._packMap=e=>t=>r=>{const o=n.PlutusMap.new();for(let n of r)o.insert(e(n),t(n));return o}}(c["Ctl.Internal.Serialization.PlutusData"]=c["Ctl.Internal.Serialization.PlutusData"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.PlutusData"]=e["Ctl.Internal.Serialization.PlutusData"]||{};var n=e["Ctl.Internal.Serialization.PlutusData"],t=e["Ctl.Internal.Serialization.PlutusData"],r=e["Ctl.Internal.FfiHelpers"],o=e["Ctl.Internal.Types.PlutusData"],a=e["Data.BigInt"],u=e["Data.Functor"],i=e["Data.Maybe"],c=e["Data.Tuple"],l=function(e){if(e instanceof o.Constr)return s(e.value0)(e.value1);if(e instanceof o.Map)return n=e.value0,f=u.mapFlipped(u.functorArray)(n)((function(e){return new c.Tuple(l(e.value0),l(e.value1))})),t._mkPlutusData_map(t._packMap(c.fst)(c.snd)(f));var n,f,d;if(e instanceof o.List)return function(e){return t._mkPlutusData_list(t._packPlutusList(r.containerHelper)(u.map(u.functorArray)(l)(e)))}(e.value0);if(e instanceof o.Integer)return d=e.value0,t._mkPlutusData_integer(function(e){return i.fromJust()(t._bigIntFromString(r.maybeFfiHelper)(a.toString(e)))}(d));if(e instanceof o.Bytes)return t._mkPlutusData_bytes(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Serialization.PlutusData (line 31, column 23 - line 36, column 37): "+[e.constructor.name])},s=function(e){return function(n){return t._mkPlutusData_constr(t._mkConstrPlutusData(e)(t._packPlutusList(r.containerHelper)(u.map(u.functorArray)(l)(n))))}};n.convertPlutusData=l}(c),function(e){"use strict";e["Ctl.Internal.Serialization.WitnessSet"]=e["Ctl.Internal.Serialization.WitnessSet"]||{};var n=e["Ctl.Internal.Serialization.WitnessSet"],t=e["Ctl.Internal.Serialization.WitnessSet"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Cardano.Types.Transaction"],u=e["Ctl.Internal.FfiHelpers"],i=e["Ctl.Internal.Serialization.NativeScript"],c=e["Ctl.Internal.Serialization.PlutusData"],l=e["Ctl.Internal.Serialization.PlutusScript"],s=e["Ctl.Internal.Types.BigNum"],f=e["Ctl.Internal.Types.RedeemerTag"],d=e["Data.Foldable"],v=e["Data.Functor"],m=e["Data.Maybe"],p=e["Data.Traversable"],g=e.Effect,y=e["Effect.Exception"],b=function(e){return function(n){return e(u.containerHelper)(n)}},w=function(e){return t.newVkeyFromPublicKey(a.convertPubKey(e))},C=function(e){return function(){var n=w(e.value0)(),r=a.convertEd25519Signature(e.value1);return t.newVkeywitness(n)(r)()}},h=function(e){return function(){var n=t.newVkeywitnesses();return d.traverse_(g.applicativeEffect)(d.foldableArray)(o.composeKleisli(g.bindEffect)(C)(t.addVkeywitness(n)))(e)(),n}},A=function(e){return m.maybe(y.throw("Failed to construct ExUnits"))(r.pure(g.applicativeEffect))(o.bind(m.bindMaybe)(s.fromBigInt(e.mem))((function(n){return o.bind(m.bindMaybe)(s.fromBigInt(e.steps))((function(e){return r.pure(m.applicativeMaybe)(t.newExUnits(n)(e))}))})))},S=function(e){return function(){var n,o=(n=e.tag,t._newRedeemerTag(function(e){if(e instanceof f.Spend)return"spend";if(e instanceof f.Mint)return"mint";if(e instanceof f.Cert)return"cert";if(e instanceof f.Reward)return"reward";throw new Error("Failed pattern match at Ctl.Internal.Serialization.WitnessSet (line 130, column 42 - line 134, column 25): "+[e.constructor.name])}(n)))(),a=m.maybe(y.throw("Failed to convert redeemer index"))(r.pure(g.applicativeEffect))(s.fromBigInt(e.index))(),u=c.convertPlutusData(e.data),i=A(e.exUnits)();return t.newRedeemer(o)(a)(u)(i)()}},I=function(e){return function(){var n=w(e.vkey)(),r=a.convertEd25519Signature(e.signature);return t.newBootstrapWitness(n)(r)(e.chainCode)(e.attributes)()}};n.setPlutusData=function(e){return function(n){return b(t._wsSetPlutusData)(n)(e)}},n.setRedeemers=function(e){return function(n){return b(t._wsSetRedeemers)(n)(e)}},n.setPlutusScripts=function(e){return function(n){return b(t._wsSetPlutusScripts)(n)(e)}},n.convertWitnessSet=function(e){return function(){var n,r,a,s=t.newTransactionWitnessSet();return d.for_(g.applicativeEffect)(d.foldableMaybe)(e.vkeys)(o.composeKleisli(g.bindEffect)(h)(t.transactionWitnessSetSetVkeys(s)))(),d.for_(g.applicativeEffect)(d.foldableMaybe)(e.nativeScripts)((n=t.transactionWitnessSetSetNativeScripts(s),function(e){return n(i.convertNativeScripts(e))}))(),d.for_(g.applicativeEffect)(d.foldableMaybe)(e.bootstraps)(o.composeKleisli(g.bindEffect)(p.traverse(p.traversableArray)(g.applicativeEffect)(I))(t._wsSetBootstraps(u.containerHelper)(s)))(),d.for_(g.applicativeEffect)(d.foldableMaybe)(e.plutusScripts)((function(e){return function(){var n,r=t.newPlutusScripts();return d.for_(g.applicativeEffect)(d.foldableArray)(e)((n=t.addPlutusScript(r),function(e){return n(l.convertPlutusScript(e))}))(),t.txWitnessSetSetPlutusScripts(s)(r)()}}))(),d.for_(g.applicativeEffect)(d.foldableMaybe)(e.plutusData)((r=t._wsSetPlutusData(u.containerHelper)(s),a=v.map(v.functorArray)(c.convertPlutusData),function(e){return r(a(e))}))(),d.for_(g.applicativeEffect)(d.foldableMaybe)(e.redeemers)(o.composeKleisli(g.bindEffect)(p.traverse(p.traversableArray)(g.applicativeEffect)(S))(t._wsSetRedeemers(u.containerHelper)(s)))(),s}},n.convertRedeemer=S,n.convertExUnits=A,n.newPlutusScripts=t.newPlutusScripts,n.addPlutusScript=t.addPlutusScript}(c),function(e){"use strict";e["Ctl.Internal.Serialization.AuxiliaryData"]=e["Ctl.Internal.Serialization.AuxiliaryData"]||{};var n=e["Ctl.Internal.Serialization.AuxiliaryData"],t=e["Ctl.Internal.Serialization.AuxiliaryData"],r=e["Control.Apply"],o=e["Control.Bind"],a=e["Ctl.Internal.FfiHelpers"],u=e["Ctl.Internal.Helpers"],i=e["Ctl.Internal.Serialization.NativeScript"],c=e["Ctl.Internal.Serialization.PlutusScript"],l=e["Ctl.Internal.Serialization.WitnessSet"],s=e["Ctl.Internal.Types.BigNum"],f=e["Ctl.Internal.Types.TransactionMetadata"],d=e["Data.Foldable"],v=e["Data.Functor"],m=e["Data.Map.Internal"],p=e["Data.Traversable"],g=e["Data.Tuple"],y=e["Data.Unfoldable"],b=e.Effect,w=function(e){if(e instanceof f.MetadataMap)return o.bindFlipped(b.bindEffect)(t.newMetadataMap(a.containerHelper))(p.for(b.applicativeEffect)(p.traversableArray)(m.toUnfoldable(y.unfoldableArray)(e.value0))((function(e){return r.apply(b.applyEffect)(v.map(b.functorEffect)(g.Tuple.create)(w(e.value0)))(w(e.value1))})));if(e instanceof f.MetadataList)return o.bindFlipped(b.bindEffect)(t.newMetadataList(a.containerHelper))(p.traverse(p.traversableArray)(b.applicativeEffect)(w)(e.value0));if(e instanceof f.Int)return t.newMetadataInt(e.value0);if(e instanceof f.Bytes)return t.newMetadataBytes(e.value0);if(e instanceof f.Text)return t.newMetadataText(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Serialization.AuxiliaryData (line 115, column 31 - line 124, column 38): "+[e.constructor.name])},C=function(e){return o.bindFlipped(b.bindEffect)(t.newGeneralTransactionMetadata(a.containerHelper))(p.for(b.applicativeEffect)(p.traversableArray)(m.toUnfoldable(y.unfoldableArray)(e))((function(e){return function(){var n=u.fromJustEff("convertGeneralTransactionMetadata: failing to convert MetadataumLabel")(s.fromBigInt(e.value0))(),t=w(e.value1)();return new g.Tuple(n,t)}})))};n.convertAuxiliaryData=function(e){return function(){var n,r=t.newAuxiliaryData();return d.for_(b.applicativeEffect)(d.foldableMaybe)(e.metadata)(o.composeKleisli(b.bindEffect)(C)(t.setAuxiliaryDataGeneralTransactionMetadata(r)))(),d.for_(b.applicativeEffect)(d.foldableMaybe)(e.nativeScripts)((n=t.setAuxiliaryDataNativeScripts(r),function(e){return n(i.convertNativeScripts(e))}))(),d.for_(b.applicativeEffect)(d.foldableMaybe)(e.plutusScripts)((function(e){return function(){var n,o=l.newPlutusScripts();return d.for_(b.applicativeEffect)(d.foldableArray)(e)((n=l.addPlutusScript(o),function(e){return n(c.convertPlutusScript(e))}))(),t.setAuxiliaryDataPlutusScripts(r)(o)()}}))(),r}}}(c),function(e){let n;n=t(1164),n=t(6359)(n),e._BigInt_from_str=e=>t=>{try{return e.just(n.BigInt.from_str(t))}catch(n){return e.nothing}}}(c["Ctl.Internal.Serialization.BigInt"]=c["Ctl.Internal.Serialization.BigInt"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.BigInt"]=e["Ctl.Internal.Serialization.BigInt"]||{};var n,t=e["Ctl.Internal.Serialization.BigInt"],r=e["Ctl.Internal.Serialization.BigInt"],o=e["Ctl.Internal.FfiHelpers"],a=e["Data.BigInt"],u=(n=r._BigInt_from_str(o.maybeFfiHelper),function(e){return n(a.toString(e))});t.convertBigInt=u}(c),function(e){"use strict";e["Ctl.Internal.Serialization"]=e["Ctl.Internal.Serialization"]||{};var n=e["Ctl.Internal.Serialization"],t=e["Ctl.Internal.Serialization"],r=e["Control.Applicative"],o=e["Control.Apply"],a=e["Control.Bind"],u=e["Ctl.Internal.Cardano.Types.ScriptRef"],i=e["Ctl.Internal.Cardano.Types.Transaction"],c=e["Ctl.Internal.Cardano.Types.Value"],l=e["Ctl.Internal.Deserialization.FromBytes"],s=e["Ctl.Internal.FfiHelpers"],f=e["Ctl.Internal.Helpers"],d=e["Ctl.Internal.Serialization.Address"],v=e["Ctl.Internal.Serialization.AuxiliaryData"],m=e["Ctl.Internal.Serialization.BigInt"],p=e["Ctl.Internal.Serialization.Hash"],g=e["Ctl.Internal.Serialization.NativeScript"],y=e["Ctl.Internal.Serialization.PlutusData"],b=e["Ctl.Internal.Serialization.PlutusScript"],w=e["Ctl.Internal.Serialization.WitnessSet"],C=e["Ctl.Internal.Types.BigNum"],h=e["Ctl.Internal.Types.OutputDatum"],A=e["Ctl.Internal.Types.RewardAddress"],S=e["Ctl.Internal.Types.Scripts"],I=e["Ctl.Internal.Types.TokenName"],T=e["Ctl.Internal.Types.VRFKeyHash"],D=e["Data.Foldable"],F=e["Data.FoldableWithIndex"],E=e["Data.Functor"],x=e["Data.Map.Internal"],M=e["Data.Maybe"],R=e["Data.Newtype"],P=e["Data.Set"],k=e["Data.Traversable"],B=e["Data.Tuple"],N=e["Data.UInt"],L=e["Data.Unfoldable"],_=e["Data.Unit"],U=e.Effect,H=e["Untagged.Union"],q=function(e){return t.newUnitInterval(e.numerator)(e.denominator)},O=function(e){return a.bindFlipped(U.bindEffect)(t.newWithdrawals(s.containerHelper))(k.for(U.applicativeEffect)(k.traversableArray)(x.toUnfoldable(L.unfoldableArray)(e))((function(e){return E.map(U.functorEffect)(B.Tuple.create(A.unRewardAddress(e.value0)))(f.fromJustEff("convertWithdrawals: Failed to convert BigNum")(C.fromBigInt(e.value1)))})))},V=function(e){return function(){var n=l.fromBytesEffect(l.fromBytesTransactionHash)(R.wrap()(R.unwrap()(e.transactionId)))();return t.newTransactionInput(n)(e.index)()}},W=function(e){return function(n){return function(){var r=t.newTransactionInputs();return D.traverse_(U.applicativeEffect)(e)(a.composeKleisli(U.bindEffect)(V)(t.addTransactionInput(r)))(n)(),r}}},K=function(e){return function(){var n,r,o,i,s=(n=e.amount,r=c["getNonAdaAsset'"](n),o=c["valueToCoin'"](n),function(){var e=t.newMultiAsset();F.forWithIndex_(U.applicativeEffect)(x.foldableWithIndexMap)(r)((function(n){return function(r){var o=p.scriptHashFromBytes(c.getCurrencySymbol(n));return function(){var n=f.fromJustEff("scriptHashFromBytes failed while converting value")(o)(),a=t.newAssets();return F.forWithIndex_(U.applicativeEffect)(x.foldableWithIndexMap)(r)((function(e){return function(n){var r=I.getTokenName(e);return function(){var e=t.newAssetName(r)(),o=f.fromJustEff("convertValue: number must not be negative")(C.fromBigInt(n))();return t.insertAssets(a)(e)(o)()}}}))(),t.insertMultiAsset(e)(n)(a)()}}}))();var n=t.newValueFromAssets(e)();return a.bindFlipped(U.bindEffect)(t.valueSetCoin(n))(f.fromJustEff("convertValue: coin value must not be negative")(C.fromBigInt(o)))(),n})(),d=t.newTransactionOutput(e.address)(s)();return function(){if(e.datum instanceof h.NoOutputDatum)return _.unit;if(e.datum instanceof h.OutputDatumHash)return D.for_(U.applicativeEffect)(D.foldableMaybe)(l.fromBytes(l.fromBytesDataHash)(R.wrap()(R.unwrap()(e.datum.value0))))(t.transactionOutputSetDataHash(d))();if(e.datum instanceof h.OutputDatum)return t.transactionOutputSetPlutusData(d)(y.convertPlutusData(R.unwrap()(e.datum.value0)))();throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 810, column 3 - line 818, column 28): "+[e.datum.constructor.name])}(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.scriptRef)((i=t.transactionOutputSetScriptRef(d),function(e){return i(function(e){if(e instanceof u.NativeScriptRef)return t.scriptRefNewNativeScript(g.convertNativeScript(e.value0));if(e instanceof u.PlutusScriptRef)return t.scriptRefNewPlutusScript(b.convertPlutusScript(e.value0));throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 823, column 1 - line 823, column 45): "+[e.constructor.name])}(e))}))(),d}},z=function(e){return a.composeKleisli(U.bindEffect)((n=f.fromJustEff("Failed to convert script data hash"),r=l.fromBytes(l.fromBytesPoolMetadataHash),o=R.wrap(),function(e){return n(r(o(e)))}))(t.newPoolMetadata(e.url))(e.hash);var n,r,o},J=function(e){if(e instanceof d.TestnetId)return t.networkIdTestnet;if(e instanceof d.MainnetId)return t.networkIdMainnet;throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 757, column 20 - line 759, column 34): "+[e.constructor.name])},G=function(e){var n=c.unwrapNonAdaAsset(e);return function(){var e=t.newMint();return F.forWithIndex_(U.applicativeEffect)(x.foldableWithIndexMap)(n)((function(n){return function(r){var o=p.scriptHashFromBytes(c.getCurrencySymbol(n));return function(){var n=f.fromJustEff("scriptHashFromBytes failed while converting value")(o)(),a=t.newMintAssets();return F.forWithIndex_(U.applicativeEffect)(x.foldableWithIndexMap)(r)((function(e){return function(n){var r=I.getTokenName(e);return function(){var e=t.newAssetName(r)(),o=f.fromJustEff("convertMint: failed to convert BigInt")(m.convertBigInt(n))(),u=f.fromJustEff("convertMint: numeric overflow or underflow")(t._bigIntToInt(s.maybeFfiHelper)(o))();return t.insertMintAsset(a)(e)(u)()}}}))(),t.insertMintAssets(e)(n)(a)()}}}))(),e}},j=function(e){return a.join(U.bindEffect)(o.apply(U.applyEffect)(E.map(U.functorEffect)(t.newExUnitPrices)(q(e.memPrice)))(q(e.stepPrice)))},Q=function(e){return function(){var n=t.newCostmdls();return F.forWithIndex_(U.applicativeEffect)(x.foldableWithIndexMap)(e)((function(e){return function(r){return function(){var o=function(){if(e instanceof S.PlutusV1)return t.newPlutusV1();if(e instanceof S.PlutusV2)return t.newPlutusV2();throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 860, column 18 - line 862, column 32): "+[e.constructor.name])}(),a=function(e){return function(){var n=t.newCostModel();return F.forWithIndex_(U.applicativeEffect)(F.foldableWithIndexArray)(e)((function(e){return function(r){return t.costModelSetCost(n)(e)(r)}}))(),n}}(r)();return t.costmdlsSetCostModel(n)(o)(a)()}}}))(),n}},Z=function(e){return function(){var n,r=(n=e.proposedProtocolParameterUpdates,a.bindFlipped(U.bindEffect)(t.newProposedProtocolParameterUpdates(s.containerHelper))(k.for(U.applicativeEffect)(k.traversableArray)(x.toUnfoldable(L.unfoldableArray)(R.unwrap()(n)))((function(e){return o.apply(U.applyEffect)(E.map(U.functorEffect)(B.Tuple.create)(f.fromJustEff("Failed to convert genesis hash")(l.fromBytes(l.fromBytesGenesisHash)(R.wrap()(R.unwrap()(e.value0))))))(function(e){return function(){var n,r,o,u,i,c,l,s,d,v,m,p,g,y,b,h,A,S=t.newProtocolParamUpdate();return D.for_(U.applicativeEffect)(D.foldableMaybe)(e.minfeeA)(a.composeKleisliFlipped(U.bindEffect)(t.ppuSetMinfeeA(S))((n=f.fromJustEff("convertProtocolParamUpdate: min_fee_a must not be negative"),r=R.unwrap(),function(e){return n(C.fromBigInt(r(e)))})))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.minfeeB)(a.composeKleisliFlipped(U.bindEffect)(t.ppuSetMinfeeB(S))((o=f.fromJustEff("convertProtocolParamUpdate: min_fee_b must not be negative"),u=R.unwrap(),function(e){return o(C.fromBigInt(u(e)))})))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxBlockBodySize)((i=t.ppuSetMaxBlockBodySize(S),function(e){return i(N.toInt(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxTxSize)((c=t.ppuSetMaxTxSize(S),function(e){return c(N.toInt(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxBlockHeaderSize)((l=t.ppuSetMaxBlockHeaderSize(S),function(e){return l(N.toInt(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.keyDeposit)(a.composeKleisliFlipped(U.bindEffect)(t.ppuSetKeyDeposit(S))((s=f.fromJustEff("convertProtocolParamUpdate: key_deposit must not be negative"),d=R.unwrap(),function(e){return s(C.fromBigInt(d(e)))})))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.poolDeposit)(a.composeKleisliFlipped(U.bindEffect)(t.ppuSetPoolDeposit(S))((v=f.fromJustEff("convertProtocolParamUpdate: pool_deposit must not be negative"),m=R.unwrap(),function(e){return v(C.fromBigInt(m(e)))})))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxEpoch)((p=t.ppuSetMaxEpoch(S),g=R.unwrap(),function(e){return p(N.toInt(g(e)))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.nOpt)((y=t.ppuSetNOpt(S),function(e){return y(N.toInt(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.poolPledgeInfluence)(a.composeKleisli(U.bindEffect)(q)(t.ppuSetPoolPledgeInfluence(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.expansionRate)(a.composeKleisli(U.bindEffect)(q)(t.ppuSetExpansionRate(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.treasuryGrowthRate)(a.composeKleisli(U.bindEffect)(q)(t.ppuSetTreasuryGrowthRate(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.protocolVersion)((function(e){return a.bindFlipped(U.bindEffect)(t.ppuSetProtocolVersion(S))(t.newProtocolVersion(N.toInt(e.major))(N.toInt(e.minor)))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.minPoolCost)(t.ppuSetMinPoolCost(S))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.adaPerUtxoByte)(t.ppuSetAdaPerUtxoByte(S))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.costModels)(a.composeKleisli(U.bindEffect)(Q)(t.ppuSetCostModels(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.executionCosts)(a.composeKleisli(U.bindEffect)(j)(t.ppuSetExecutionCosts(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxTxExUnits)(a.composeKleisli(U.bindEffect)(w.convertExUnits)(t.ppuSetMaxTxExUnits(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxBlockExUnits)(a.composeKleisli(U.bindEffect)(w.convertExUnits)(t.ppuSetMaxBlockExUnits(S)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxValueSize)((b=t.ppuSetMaxValueSize(S),function(e){return b(N.toInt(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.collateralPercentage)((h=t.ppuSetCollateralPercentage(S),function(e){return h(N.toInt(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.maxCollateralInputs)((A=t.ppuSetMaxCollateralInputs(S),function(e){return A(N.toInt(e))}))(),S}}(e.value1))}))))();return t.newUpdate(r)(N.toInt(R.unwrap()(e.epoch)))()}},X=function(e){if(e instanceof i.StakeRegistration)return t.newStakeRegistrationCertificate(e.value0);if(e instanceof i.StakeDeregistration)return t.newStakeDeregistrationCertificate(e.value0);if(e instanceof i.StakeDelegation)return t.newStakeDelegationCertificate(e.value0)(R.unwrap()(e.value1));if(e instanceof i.PoolRegistration)return function(){var n,r,o,a=t.newUnitInterval(e.value0.margin.numerator)(e.value0.margin.denominator)(),u=t.convertPoolOwners(s.containerHelper)(E.map(E.functorArray)((n=R.unwrap(),r=R.unwrap(),function(e){return n(r(e))}))(e.value0.poolOwners))(),c=(o=e.value0.relays,E.map(U.functorEffect)(t.packRelays(s.containerHelper))(k.for(U.applicativeEffect)(k.traversableArray)(o)((function(e){if(e instanceof i.SingleHostAddr)return function(){var n=E.map(U.functorEffect)(H.maybeToUor)(k.for(U.applicativeEffect)(k.traversableMaybe)(E.map(M.functorMaybe)(R.unwrap())(e.value0.ipv4))(t.newIpv4))(),r=E.map(U.functorEffect)(H.maybeToUor)(k.for(U.applicativeEffect)(k.traversableMaybe)(E.map(M.functorMaybe)(R.unwrap())(e.value0.ipv6))(t.newIpv6))();return t.newSingleHostAddr(H.maybeToUor(e.value0.port))(n)(r)()};if(e instanceof i.SingleHostName)return t.newSingleHostName(H.maybeToUor(e.value0.port))(e.value0.dnsName);if(e instanceof i.MultiHostName)return t.newMultiHostName(e.value0.dnsName);throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 746, column 55 - line 754, column 31): "+[e.constructor.name])}))))(),l=k.for(U.applicativeEffect)(k.traversableMaybe)(e.value0.poolMetadata)(z)();return t.newPoolRegistrationCertificate(R.unwrap()(e.value0.operator))(T.unVRFKeyHash(e.value0.vrfKeyhash))(e.value0.pledge)(e.value0.cost)(a)(A.unRewardAddress(e.value0.rewardAccount))(u)(c)(H.maybeToUor(l))()};if(e instanceof i.PoolRetirement)return t.newPoolRetirementCertificate(R.unwrap()(e.value0.poolKeyHash))(N.toInt(R.unwrap()(e.value0.epoch)));if(e instanceof i.GenesisKeyDelegation)return a.join(U.bindEffect)(o.apply(U.applyEffect)(o.apply(U.applyEffect)(E.map(U.functorEffect)(t.newGenesisKeyDelegationCertificate)(f.fromJustEff("Failed to convert genesis hash")(l.fromBytes(l.fromBytesGenesisHash)(R.wrap()(e.value0.genesisHash)))))(f.fromJustEff("Failed to convert genesis delegate hash")(l.fromBytes(l.fromBytesGenesisDelegateH)(R.wrap()(e.value0.genesisDelegateHash)))))(r.pure(U.applicativeEffect)(e.value0.vrfKeyhash)));if(e instanceof i.MoveInstantaneousRewardsCert)return a.bindFlipped(U.bindEffect)(t.newMoveInstantaneousRewardsCertificate)(function(e){if(e instanceof i.ToOtherPot)return t.newMoveInstantaneousRewardToOtherPot(e.value0.pot)(e.value0.amount);if(e instanceof i.ToStakeCreds)return a.bind(U.bindEffect)(function(e){return t.newMIRToStakeCredentials(s.containerHelper)(x.toUnfoldable(L.unfoldableArray)(e))}(e.value0.amounts))(t.newMoveInstantaneousRewardToStakeCreds(e.value0.pot));throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 729, column 1 - line 730, column 65): "+[e.constructor.name])}(e.value0));throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 668, column 15 - line 722, column 41): "+[e.constructor.name])},Y=function(e){return function(){var n=t.newCertificates();return D.for_(U.applicativeEffect)(D.foldableArray)(e)(a.composeKleisli(U.bindEffect)(X)(t.addCert(n)))(),n}},$=function(e){return function(){var n,r,o,u,i,c,d,v,m,p,g,y,b,w,h,A,S,I,T,F=W(P.foldableSet)(e.inputs)(),x=(n=e.outputs,function(){var e=t.newTransactionOutputs();return D.traverse_(U.applicativeEffect)(D.foldableArray)(a.composeKleisli(U.bindEffect)(K)(t.addTransactionOutput(e)))(n)(),e})(),M=f.fromJustEff("Failed to convert fee")(C.fromBigInt(R.unwrap()(e.fee)))(),k=t.newTransactionBody(F)(x)(M)();return D.for_(U.applicativeEffect)(D.foldableMaybe)(e.ttl)((r=t.setTxBodyTtl(k),o=R.unwrap(),function(e){return r(o(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.certs)(a.composeKleisli(U.bindEffect)(Y)(t.setTxBodyCerts(k)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.withdrawals)(a.composeKleisli(U.bindEffect)(O)(t.setTxBodyWithdrawals(k)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.update)(a.composeKleisli(U.bindEffect)(Z)(t.setTxBodyUpdate(k)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.auxiliaryDataHash)(a.composeKleisli(U.bindEffect)((u=f.fromJustEff("Failed to convert auxiliary data hash"),i=l.fromBytes(l.fromBytesAuxiliaryDataHas),c=R.wrap(),d=R.unwrap(),function(e){return u(i(c(d(e))))}))(t.transactionBodySetAuxiliaryDataHash(k)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.validityStartInterval)((v=t.transactionBodySetValidityStartInterval(k),m=R.unwrap(),function(e){return v(C.fromStringUnsafe(C.toString(m(e))))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.requiredSigners)((p=t.transactionBodySetRequiredSigners(s.containerHelper)(k),g=E.map(E.functorArray)(R.unwrap()),function(e){return p(g(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.networkId)(a.composeKleisli(U.bindEffect)(J)(t.setTxBodyNetworkId(k)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.mint)(a.composeKleisli(U.bindEffect)(G)(t.setTxBodyMint(k)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.scriptDataHash)(a.composeKleisli(U.bindEffect)((y=f.fromJustEff("Failed to convert script data hash"),b=l.fromBytes(l.fromBytesScriptDataHash),w=R.wrap(),h=R.unwrap(),function(e){return y(b(w(h(e))))}))(t.setTxBodyScriptDataHash(k)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.collateral)(a.composeKleisli(U.bindEffect)(W(D.foldableArray))(t.setTxBodyCollateral(k)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.requiredSigners)((A=t.transactionBodySetRequiredSigners(s.containerHelper)(k),S=E.map(E.functorArray)(R.unwrap()),function(e){return A(S(e))}))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.networkId)(a.composeKleisli(U.bindEffect)(J)(t.setTxBodyNetworkId(k)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.collateralReturn)(a.composeKleisli(U.bindEffect)(K)(t.setTxBodyCollateralReturn(k)))(),D.for_(U.applicativeEffect)(D.foldableMaybe)(e.totalCollateral)(a.composeKleisli(U.bindEffect)((I=f.fromJustEff("Failed to convert fee"),T=R.unwrap(),function(e){return I(C.fromBigInt(T(e)))}))(t.setTxBodyTotalCollateral(k)))(),D.null(P.foldableSet)(e.referenceInputs)?_.unit:a.bind(U.bindEffect)(W(P.foldableSet)(e.referenceInputs))(t.setTxBodyReferenceInputs(k))(),k}};n.convertExUnitPrices=j,n.convertTransaction=function(e){return function(){var n=$(e.body)(),r=w.convertWitnessSet(e.witnessSet)(),o=k.for(U.applicativeEffect)(k.traversableMaybe)(e.auxiliaryData)(v.convertAuxiliaryData)(),a=function(){if(o instanceof M.Nothing)return t.newTransaction_(n)(r)();if(o instanceof M.Just)return t.newTransaction(n)(r)(o.value0)();throw new Error("Failed pattern match at Ctl.Internal.Serialization (line 540, column 11 - line 542, column 45): "+[o.constructor.name])}();return t.setTxIsValid(a)(e.isValid)(),a}},n.convertTxBody=$,n.convertTxOutput=K,n.hashScriptData=function(e){return function(n){return function(r){return function(){var o=t.newRedeemers(),u=Q(e)();return D.traverse_(U.applicativeEffect)(D.foldableArray)(a.composeKleisliFlipped(U.bindEffect)(t.addRedeemer(o))(w.convertRedeemer))(n)(),0===r.length?t._hashScriptDataNoDatums(o)(u)():t._hashScriptData(o)(u)(E.map(E.functorArray)(y.convertPlutusData)(r))()}}}},n.hashTransaction=t.hashTransaction,n.publicKeyHash=t.publicKeyHash,n.makeVkeywitness=t.makeVkeywitness}(c),function(e){"use strict";e["Data.MediaType"]=e["Data.MediaType"]||{};var n=e["Data.MediaType"],t=e["Data.Show"],r={show:function(e){return"(MediaType "+t.show(t.showString)(e)+")"}};n.showMediaType=r}(c),function(e){"use strict";e["Data.Time.Duration"]=e["Data.Time.Duration"]||{};var n=e["Data.Time.Duration"],t=e["Control.Category"],r=e["Data.Newtype"],o=function(e){return e},a=function(e){return e.fromDuration},u={fromDuration:r.over()()(o)((function(e){return 1e3*e})),toDuration:r.over()()((function(e){return e}))((function(e){return e/1e3}))},i={fromDuration:t.identity(t.categoryFn),toDuration:t.identity(t.categoryFn)};n.fromDuration=a,n.Seconds=o,n.convertDuration=function(e){return function(n){var t=n.toDuration,r=a(e);return function(e){return t(r(e))}}},n.durationMilliseconds=i,n.durationSeconds=u}(c),function(e){"use strict";e["Ctl.Internal.Service.Blockfrost"]=e["Ctl.Internal.Service.Blockfrost"]||{};var n,t,r,o,a,u,i,c,l,s,f,d,v,m,p,g,y,b,w,C,h,A,S,I,T,D=e["Ctl.Internal.Service.Blockfrost"],F=e.Aeson,E=e.Affjax,x=e["Affjax.RequestBody"],M=e["Affjax.RequestHeader"],R=e["Affjax.ResponseFormat"],P=e["Affjax.ResponseHeader"],k=e["Affjax.StatusCode"],B=e["Control.Alt"],N=e["Control.Applicative"],L=e["Control.Apply"],_=e["Control.Bind"],U=e["Control.Monad.Error.Class"],H=e["Control.Monad.Except.Trans"],q=e["Control.Monad.Logger.Class"],O=e["Control.Monad.Logger.Trans"],V=e["Control.Monad.Maybe.Trans"],W=e["Control.Monad.Reader.Class"],K=e["Control.Monad.Reader.Trans"],z=e["Control.Parallel"],J=e["Control.Parallel.Class"],G=e["Ctl.Internal.Cardano.Types.NativeScript"],j=e["Ctl.Internal.Cardano.Types.ScriptRef"],Q=e["Ctl.Internal.Cardano.Types.Transaction"],Z=e["Ctl.Internal.Cardano.Types.Value"],X=e["Ctl.Internal.Contract.QueryHandle.Error"],Y=e["Ctl.Internal.Deserialization.FromBytes"],$=e["Ctl.Internal.Deserialization.PlutusData"],ee=e["Ctl.Internal.Deserialization.Transaction"],ne=e["Ctl.Internal.QueryM.Ogmios"],te=e["Ctl.Internal.Serialization"],re=e["Ctl.Internal.Serialization.Address"],oe=e["Ctl.Internal.Serialization.Hash"],ae=e["Ctl.Internal.Serialization.ToBytes"],ue=e["Ctl.Internal.ServerConfig"],ie=e["Ctl.Internal.Service.Error"],ce=e["Ctl.Internal.Service.Helpers"],le=e["Ctl.Internal.Types.BigNum"],se=e["Ctl.Internal.Types.ByteArray"],fe=e["Ctl.Internal.Types.CborBytes"],de=e["Ctl.Internal.Types.Chain"],ve=e["Ctl.Internal.Types.Datum"],me=e["Ctl.Internal.Types.EraSummaries"],pe=e["Ctl.Internal.Types.Int"],ge=e["Ctl.Internal.Types.OutputDatum"],ye=e["Ctl.Internal.Types.ProtocolParameters"],be=e["Ctl.Internal.Types.PubKeyHash"],we=e["Ctl.Internal.Types.Rational"],Ce=e["Ctl.Internal.Types.RawBytes"],he=e["Ctl.Internal.Types.RewardAddress"],Ae=e["Ctl.Internal.Types.Scripts"],Se=e["Ctl.Internal.Types.Transaction"],Ie=e["Ctl.Internal.Types.TransactionMetadata"],Te=e["Data.Argonaut.Decode.Error"],De=e["Data.Array"],Fe=e["Data.Bifunctor"],Ee=e["Data.BigInt"],xe=e["Data.BigNumber"],Me=e["Data.Boolean"],Re=e["Data.DateTime.Instant"],Pe=e["Data.Either"],ke=e["Data.Eq"],Be=e["Data.Foldable"],Ne=e["Data.Function"],Le=e["Data.Functor"],_e=e["Data.Generic.Rep"],Ue=e["Data.HTTP.Method"],He=e["Data.JSDate"],qe=e["Data.Log.Level"],Oe=e["Data.Map.Internal"],Ve=e["Data.Maybe"],We=e["Data.MediaType"],Ke=e["Data.Monoid"],ze=e["Data.Newtype"],Je=e["Data.Number"],Ge=e["Data.Semigroup"],je=e["Data.Semiring"],Qe=e["Data.Show"],Ze=e["Data.Show.Generic"],Xe=e["Data.String.CodePoints"],Ye=e["Data.Time.Duration"],$e=e["Data.Traversable"],en=e["Data.Tuple"],nn=e["Effect.Aff"],tn=e["Effect.Aff.Class"],rn=e["Effect.Class"],on=e["Effect.Exception"],an=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),un=function(){function e(){}return e.value=new e,e}(),cn=function(){function e(){}return e.value=new e,e}(),ln=function(){function e(){}return e.value=new e,e}(),sn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),fn=function(){function e(){}return e.value=new e,e}(),dn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),vn=function(){function e(){}return e.value=new e,e}(),mn=function(){function e(){}return e.value=new e,e}(),pn=function(){function e(){}return e.value=new e,e}(),gn=function(){function e(){}return e.value=new e,e}(),yn=function(){function e(){}return e.value=new e,e}(),bn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),wn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Cn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),hn=function(){function e(){}return e.value=new e,e}(),An=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Sn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),In=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),Tn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Dn=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),Fn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),En=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),xn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Mn=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),Rn=Ge.semigroupArray,Pn=Ke.monoidArray,kn=Ke.monoidArray,Bn={to:function(e){return new an(e.value0,e.value1)},from:function(e){return new _e.Product(e.value0,e.value1)}},Nn={show:Ze.genericShow(Bn)(Ze.genericShowConstructor(Ze.genericShowArgsProduct(Ze.genericShowArgsArgument(re.showNetworkId))(Ze.genericShowArgsArgument(Pe.showEither(be.showStakePubKeyHash)(Ae.showStakeValidatorHash))))({reflectSymbol:function(){return"BlockfrostStakeCredential"}}))},Ln={to:function(e){if(e instanceof _e.Inl)return fn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inl)return new dn(e.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inl)return vn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inl)return mn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inl)return pn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inl)return gn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return yn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new bn(e.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new wn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new Cn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return hn.value;if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new An(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new Sn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new In(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1.value1);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new Tn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new Dn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inl)return new Fn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof _e.Inr&&e.value0 instanceof _e.Inr&&e.value0.value0 instanceof _e.Inr&&e.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof _e.Inr)return new En(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 347, column 1 - line 347, column 45): "+[e.constructor.name])},from:function(e){if(e instanceof fn)return new _e.Inl(_e.NoArguments.value);if(e instanceof dn)return new _e.Inr(new _e.Inl(e.value0));if(e instanceof vn)return new _e.Inr(new _e.Inr(new _e.Inl(_e.NoArguments.value)));if(e instanceof mn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(_e.NoArguments.value))));if(e instanceof pn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(_e.NoArguments.value)))));if(e instanceof gn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(_e.NoArguments.value))))));if(e instanceof yn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(_e.NoArguments.value)))))));if(e instanceof bn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0))))))));if(e instanceof wn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0)))))))));if(e instanceof Cn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0))))))))));if(e instanceof hn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(_e.NoArguments.value)))))))))));if(e instanceof An)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0))))))))))));if(e instanceof Sn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0)))))))))))));if(e instanceof In)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(new _e.Product(e.value0,new _e.Product(e.value1,e.value2))))))))))))))));if(e instanceof Tn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0)))))))))))))));if(e instanceof Dn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(new _e.Product(e.value0,e.value1)))))))))))))))));if(e instanceof Fn)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inl(e.value0)))))))))))))))));if(e instanceof En)return new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(new _e.Inr(e.value0)))))))))))))))));throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 347, column 1 - line 347, column 45): "+[e.constructor.name])}},_n={show:Ze.genericShow(Ln)(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"BlockchainGenesis"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(Se.showDataHash))({reflectSymbol:function(){return"DatumCbor"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"EraSummaries"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"EvaluateTransaction"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"LatestBlock"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"LatestEpoch"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"LatestProtocolParameters"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(oe.showScriptHash))({reflectSymbol:function(){return"NativeScriptByHash"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(oe.showScriptHash))({reflectSymbol:function(){return"PlutusScriptCborByHash"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(oe.showScriptHash))({reflectSymbol:function(){return"ScriptInfo"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsNoArguments)({reflectSymbol:function(){return"SubmitTransaction"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(Se.showTransactionHash))({reflectSymbol:function(){return"Transaction"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(Se.showTransactionHash))({reflectSymbol:function(){return"TransactionMetadata"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsProduct(Ze.genericShowArgsArgument(re.showAddress))(Ze.genericShowArgsProduct(Ze.genericShowArgsArgument(Qe.showInt))(Ze.genericShowArgsArgument(Qe.showInt))))({reflectSymbol:function(){return"UtxosAtAddress"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(Se.showTransactionHash))({reflectSymbol:function(){return"UtxosOfTransaction"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsProduct(Ze.genericShowArgsArgument(Qe.showInt))(Ze.genericShowArgsArgument(Qe.showInt)))({reflectSymbol:function(){return"PoolIds"}}))(Ze.genericShowSum(Ze.genericShowConstructor(Ze.genericShowArgsArgument(Q.showPoolPubKeyHash))({reflectSymbol:function(){return"PoolParameters"}}))(Ze.genericShowConstructor(Ze.genericShowArgsArgument(Nn))({reflectSymbol:function(){return"DelegationsAndRewards"}})))))))))))))))))))},Un=function(e){return{decodeAeson:_.composeKleisli(Pe.bindEither)(F.decodeAeson(F.decodeAesonString))(_.composeKleisli(Pe.bindEither)(F.decodeJsonString(e))((n=N.pure(Pe.applicativeEither),function(e){return n(e)})))};var n},Hn={decodeAeson:(r=ce.aesonObject((function(e){return _.bind(Pe.bindEither)(_.bind(Pe.bindEither)(F.getField(F.decodeAesonString)(e)("quantity"))((n=Pe.note(new Te.TypeMismatch("Expected string repr of BigInt")),function(e){return n(Ee.fromString(e))})))((function(n){return _.bind(Pe.bindEither)(F.getField(F.decodeAesonString)(e)("unit"))((function(e){if("lovelace"===e)return N.pure(Pe.applicativeEither)(Z.lovelaceValueOf(n));var t=Xe.splitAt(56)(e);return Le.mapFlipped(Pe.functorEither)(ce.decodeAssetClass(e)(t.before)(t.after))((function(e){return Z.mkValue(Ke.mempty(Z.monoidCoin))(Z.mkSingletonNonAdaAsset(e.value0)(e.value1)(n))}))}))}));var n})),o=_.composeKleisli(Pe.bindEither)(Ne.flip(F.getField(F.decodeAesonAeson))("amount"))(ce.aesonArray((n=Le.map(Pe.functorEither)(Be.fold(Be.foldableArray)(Z.monoidValue)),t=$e.traverse($e.traversableArray)(Pe.applicativeEither)(r),function(e){return n(t(e))}))),ce.aesonObject((function(e){return _.bind(Pe.bindEither)(function(e){return _.bind(Pe.bindEither)(F.getField(F.decodeAesonString)(e)("address"))((function(e){return Pe.note(new Te.TypeMismatch("Expected bech32 encoded address"))(re.addressFromBech32(e))}))}(e))((function(n){return _.bind(Pe.bindEither)(o(e))((function(t){return _.bind(Pe.bindEither)(function(e){return _.bind(Pe.bindEither)(F["getFieldOptional'"](fe.decodeAesonCborBytes)(e)("inline_datum"))((function(n){if(n instanceof Ve.Just)return Pe.note(new Te.TypeMismatch("Expected CBOR encoded inline datum"))(Le.map(Ve.functorMaybe)(ge.OutputDatum.create)($.deserializeData(ve.fromDataDatum)(n.value0)));if(n instanceof Ve.Nothing)return Le.map(Pe.functorEither)(Ve.maybe(ge.NoOutputDatum.value)(ge.OutputDatumHash.create))(F["getFieldOptional'"](Se.decodeAesonDataHash)(e)("data_hash"));throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 996, column 48 - line 1002, column 50): "+[n.constructor.name])}))}(e))((function(r){return _.bind(Pe.bindEither)(F["getFieldOptional'"](oe.decodeAesonScriptHash)(e)("reference_script_hash"))((function(e){return N.pure(Pe.applicativeEither)(ze.wrap()({address:n,amount:t,datum:r,scriptHash:e}))}))}))}))}))})))},qn={decodeAeson:(i=ce.aesonObject((function(e){return _.bind(Pe.bindEither)(F.getField(Se.decodeAesonTransactionHas)(e)("tx_hash"))((function(n){return _.bind(Pe.bindEither)(F.getField(F.decodeAesonUInt)(e)("output_index"))((function(e){return N.pure(Pe.applicativeEither)({transactionId:n,index:e})}))}))})),c=function(e){return L.apply(Pe.applyEither)(Le.map(Pe.functorEither)(en.Tuple.create)(i(e)))(F.decodeAeson(Hn)(e))},ce.aesonArray((a=Le.map(Pe.functorEither)(ze.wrap()),u=$e.traverse($e.traversableArray)(Pe.applicativeEither)(c),function(e){return a(u(e))})))},On={decodeAeson:ce.aesonObject((function(e){return _.bind(Pe.bindEither)(F.getField(Se.decodeAesonTransactionHas)(e)("hash"))((function(n){return _.bind(Pe.bindEither)(F.getField(F.decodeAesonAeson)(e)("outputs"))(ce.aesonArray((t=Le.map(Pe.functorEither)(ze.wrap()),r=$e.traverse($e.traversableArray)(Pe.applicativeEither)(function(e){return function(n){return L.apply(Pe.applyEither)(Le.map(Pe.functorEither)(en.Tuple.create)(function(e){return ce.aesonObject((n=Le.map(Pe.functorEither)((function(n){return{transactionId:e,index:n}})),t=Ne.flip(F.getField(F.decodeAesonUInt))("output_index"),function(e){return n(t(e))}));var n,t}(e)(n)))(F.decodeAeson(Hn)(n))}}(n)),function(e){return t(r(e))})));var t,r}))}))},Vn={decodeAeson:ce.aesonObject((function(e){return _.bind(Pe.bindEither)(Le.map(Pe.functorEither)((function(e){return Ye.Seconds(Ee.toNumber(e))}))(F.getField(F.decodeAesonBigInt)(e)("system_start")))((function(e){return Pe.note(new Te.TypeMismatch("Unix timestamp"))(Le.map(Ve.functorMaybe)((n=ze.wrap(),t=ze.wrap(),function(e){return n(t(Re.toDateTime(e)))}))(Re.instant(Ye.convertDuration(Ye.durationSeconds)(Ye.durationMilliseconds)(e))));var n,t}))}))},Wn={decodeAeson:ce.aesonString((function(e){return"timelock"===e?N.pure(Pe.applicativeEither)(un.value):"plutusV1"===e?N.pure(Pe.applicativeEither)(cn.value):"plutusV2"===e?N.pure(Pe.applicativeEither)(ln.value):new Pe.Left(new Te.TypeMismatch("language: expected 'native' or 'plutusV{1|2}', got: "+e))}))},Kn={decodeAeson:ce.aesonObject((s=Le.map(Pe.functorEither)((l=ze.wrap(),function(e){return l({language:e})})),f=Ne.flip(F.getField(Wn))("type"),function(e){return s(f(e))}))},zn={decodeAeson:function(e){return _.bind(Pe.bindEither)(F.decodeAeson(F.decodeAesonObject(F.decodeAesonAeson))(e))((function(e){return _.bind(Pe.bindEither)(F.getField(F.decodeAesonMaybe(Q.decodeAesonPoolPubKeyHash))(e)("pool_id"))((function(n){return _.bind(Pe.bindEither)(F.getFieldOptional(F.decodeAesonString)(e)("withdrawable_amount"))((function(e){return _.bind(Pe.bindEither)($e.for(Pe.applicativeEither)($e.traversableMaybe)(e)((function(e){return Pe.note(new Te.TypeMismatch("BigInt"))(Le.map(Ve.functorMaybe)(Z.Coin)(Ee.fromString(e)))})))((function(e){return N.pure(Pe.applicativeEither)({pool_id:n,withdrawable_amount:e})}))}))}))}))}},Jn={decodeAeson:(v=function(e){var n=_.bind(Pe.bindEither)(F.getField(F.decodeAesonArray(F.decodeAesonAeson))(e)("scripts"))($e.traverse($e.traversableArray)(Pe.applicativeEither)(ce.aesonObject(v)));return _.bind(Pe.bindEither)(F.getField(F.decodeAesonString)(e)("type"))((function(t){return"sig"===t?Le.map(Pe.functorEither)(G.ScriptPubkey.create)(_.bind(Pe.bindEither)(F.getField(se.decodeAesonByteArray)(e)("keyHash"))((r=Pe.note(new Te.TypeMismatch("Ed25519KeyHash")),function(e){return r(oe.ed25519KeyHashFromBytes(e))}))):"before"===t?Le.map(Pe.functorEither)(G.TimelockExpiry.create)(F.getField(re.decodeAesonSlot)(e)("slot")):"after"===t?Le.map(Pe.functorEither)(G.TimelockStart.create)(F.getField(re.decodeAesonSlot)(e)("slot")):"all"===t?Le.map(Pe.functorEither)(G.ScriptAll.create)(n):"any"===t?Le.map(Pe.functorEither)(G.ScriptAny.create)(n):"atLeast"===t?L.apply(Pe.applyEither)(Le.map(Pe.functorEither)(G.ScriptNOfK.create)(F.getField(F.decodeAesonInt)(e)("required")))(n):new Pe.Left(new Te.TypeMismatch("Native script constructor"));var r}))},_.composeKleisli(Pe.bindEither)(ce.aesonObject(Ne.flip(F.getField(F.decodeAesonObject(F.decodeAesonAeson)))("json")))((d=Le.map(Pe.functorEither)(ze.wrap()),function(e){return d(v(e))})))},Gn={decodeAeson:_.composeKleisli(Pe.bindEither)(F.decodeAeson(F.decodeAesonArray(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(fe.decodeAesonCborBytes))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"metadata"}})()())())))((function(e){return _.bind(Pe.bindEither)($e.for(Pe.applicativeEither)($e.traversableArray)(e)((function(e){return Le.map(Le.functorFn)(Le.map(Pe.functorEither)((n=ze.unwrap(),function(e){return n(ee.convertGeneralTransactionMetadata(e))})))(Ne.flip(Pe.note)(Y.fromBytes(Y.fromBytesGeneralTransacti)(e.metadata)))(new Te.TypeMismatch("Hexadecimal encoded Metadata"));var n})))((function(e){return N.pure(Pe.applicativeEither)(Oe.unions(Ie.ordTransactionMetadatumLa)(Be.foldableArray)(e))}))}))},jn={decodeAeson:function(e){var n=_.bind(Pe.bindEither)(F.decodeAeson(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(ne.decodeAesonTxEvaluationR))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"result"}})()())())(e))((function(e){return N.pure(Pe.applicativeEither)(new Pe.Right(e.result))})),t=N.pure(Pe.applicativeEither)(new Pe.Left(e));return Le.mapFlipped(Pe.functorEither)(B.alt(Pe.altEither)(n)(t))(sn.create)}},Qn={decodeAeson:(b=function(e){return _.bind(Pe.bindEither)(F.getField(me.decodeAesonEpochLength)(e)("epoch_length"))((function(n){return _.bind(Pe.bindEither)(Le.map(Pe.functorEither)(Le.map(Le.functorFn)(ze.wrap())(je.mul(je.semiringNumber)(1e3)))(F.getField(F.decodeAesonNumber)(e)("slot_length")))((function(t){return _.bind(Pe.bindEither)(F.getField(me.decodeAesonSafeZone)(e)("safe_zone"))((function(e){return N.pure(Pe.applicativeEither)(ze.wrap()({epochLength:n,slotLength:t,safeZone:e}))}))}))}))},w=ce.aesonObject((function(e){return _.bind(Pe.bindEither)(F.getField(me.decodeAesonEraSummaryTime)(e)("start"))((function(n){return _.bind(Pe.bindEither)(F.getField(F.decodeAesonMaybe(me.decodeAesonEraSummaryTime))(e)("end"))((function(t){return _.bind(Pe.bindEither)(_.bindFlipped(Pe.bindEither)(b)(F.getField(F.decodeAesonObject(F.decodeAesonAeson))(e)("parameters")))((function(e){return N.pure(Pe.applicativeEither)(ze.wrap()({start:n,end:t,parameters:e}))}))}))}))})),ce.aesonArray((g=Le.map(Pe.functorEither)((m=ze.wrap(),p=ze.wrap(),function(e){return m(p(e))})),y=$e.traverse($e.traversableArray)(Pe.applicativeEither)(w),function(e){return g(y(e))})))},Zn={decodeAeson:function(e){if(F.isNull(e))return N.pure(Pe.applicativeEither)(Ve.Nothing.value);if(Me.otherwise)return _.bind(Pe.bindEither)(ce.aesonObject(Ne.flip(F.getFieldOptional(fe.decodeAesonCborBytes))("cbor"))(e))((function(e){return N.pure(Pe.applicativeEither)(_.bindFlipped(Ve.bindMaybe)($.deserializeData(ve.fromDataDatum))(e))}));throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 1145, column 1 - line 1150, column 58): "+[e.constructor.name])}},Xn={decodeAeson:function(e){return Le.mapFlipped(Pe.functorEither)(F.decodeAeson(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonBigInt))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"epoch"}})()())())(e))((function(e){return ze.wrap()(e.epoch)}))}},Yn={decodeAeson:ce.aesonObject((function(e){return _.bind(Pe.bindEither)(Le.map(Pe.functorEither)(ze.wrap())(F.getField(F.decodeAesonString)(e)("hash")))((function(n){return Le.mapFlipped(Pe.functorEither)(F["getFieldOptional'"](re.decodeAesonSlot)(e)("slot"))((r=ze.wrap(),o=Ve.maybe(de.TipAtGenesis.value)((t=ze.wrap(),function(e){return de.Tip.create(t({blockHeaderHash:n,slot:e}))})),function(e){return r(o(e))}));var t,r,o}))}))},$n={decodeAeson:function(e){if(F.isNull(e))return N.pure(Pe.applicativeEither)(Ve.Nothing.value);if(Me.otherwise)return _.bind(Pe.bindEither)(ce.aesonObject(Ne.flip(F.getFieldOptional(se.decodeAesonByteArray))("cbor"))(e))((function(e){return N.pure(Pe.applicativeEither)(e)}));throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 1123, column 1 - line 1128, column 35): "+[e.constructor.name])}},et=ze.unwrap(),nt=ze.unwrap(),tt=function(e){return e},rt=function(e){return e.value0},ot=ze.unwrap(),at=ze.unwrap(),ut=ze.unwrap(),it=function(e){var n=xe.toFraction(F.unpackFinite(e))(xe.fromNumber(Je.infinity));return new en.Tuple(xe.toString(n.value0),xe.toString(n.value1))},ct=(C=ze.unwrap(),function(e){return C(e).language}),lt=function(e){return function(n){if(n instanceof Pe.Left)return new Pe.Left(new ie.ClientHttpError(n.value0));if(n instanceof Pe.Right){if(n.value0.status<200||n.value0.status>299)return _.bind(Pe.bindEither)(Fe.lmap(Fe.bifunctorEither)(ie.ClientDecodeJsonError.create(n.value0.body))(_.composeKleisliFlipped(Pe.bindEither)(F.decodeAeson(ie.decodeAesonBlockfrostErro))(F.parseJsonStringToAeson)(n.value0.body)))((function(e){return new Pe.Left(new ie.ClientHttpResponseError(ze.wrap()(n.value0.status),new ie.ServiceBlockfrostError(e)))}));if(Me.otherwise)return Fe.lmap(Fe.bifunctorEither)(ie.ClientDecodeJsonError.create(n.value0.body))(_.composeKleisliFlipped(Pe.bindEither)(F.decodeAeson(e))(F.parseJsonStringToAeson)(n.value0.body))}throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 494, column 1 - line 498, column 31): "+[n.constructor.name])}},st=function(e){return e instanceof Pe.Left&&e.value0 instanceof ie.ClientHttpResponseError&&404===e.value0.value0?new Pe.Right(Ve.Nothing.value):e},ft=function(e){var n=Le.map(Pe.functorEither)(Ve.fromMaybe(Ke.mempty(e)));return function(e){return n(st(e))}},dt=function(e){if(e instanceof fn)return"/genesis";if(e instanceof dn)return"/scripts/datum/"+se.byteArrayToHex(e.value0)+"/cbor";if(e instanceof vn)return"/network/eras";if(e instanceof mn)return"/utils/txs/evaluate";if(e instanceof pn)return"/blocks/latest";if(e instanceof gn)return"/epochs/latest";if(e instanceof yn)return"/epochs/latest/parameters";if(e instanceof bn)return"/scripts/"+Ce.rawBytesToHex(oe.scriptHashToBytes(e.value0))+"/json";if(e instanceof wn)return"/scripts/"+Ce.rawBytesToHex(oe.scriptHashToBytes(e.value0))+"/cbor";if(e instanceof Cn)return"/scripts/"+Ce.rawBytesToHex(oe.scriptHashToBytes(e.value0));if(e instanceof hn)return"/tx/submit";if(e instanceof An)return"/txs/"+se.byteArrayToHex(ze.unwrap()(e.value0));if(e instanceof Sn)return"/txs/"+se.byteArrayToHex(ze.unwrap()(e.value0))+"/metadata/cbor";if(e instanceof In)return"/addresses/"+re.addressBech32(e.value0)+"/utxos?page="+Qe.show(Qe.showInt)(e.value1)+"&count="+Qe.show(Qe.showInt)(e.value2);if(e instanceof Tn)return"/txs/"+se.byteArrayToHex(ze.unwrap()(e.value0))+"/utxos";if(e instanceof Dn)return"/pools?page="+Qe.show(Qe.showInt)(e.value0)+"&count="+Qe.show(Qe.showInt)(e.value1)+"&order=asc";if(e instanceof Fn)return"/pool/"+Q.poolPubKeyHashToBech32(e.value0);if(e instanceof En)return"/accounts/"+function(e){if(e.value1 instanceof Pe.Left)return he.rewardAddressToBech32(he.stakePubKeyHashRewardAddress(e.value0)(e.value1.value0));if(e.value1 instanceof Pe.Right)return he.rewardAddressToBech32(he.stakeValidatorHashRewardAddress(e.value0)(e.value1.value0));throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 1210, column 37 - line 1216, column 25): "+[e.constructor.name])}(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 356, column 3 - line 393, column 67): "+[e.constructor.name])},vt=function(e){return function(n){var t=function(e){return function(n){return q.log(O.monadLoggerLoggerT(K.monadEffectReader(nn.monadEffectAff)))({level:qe.Trace.value,message:n,tags:Oe.empty,timestamp:e})}},r=function(){if(e instanceof xn)return Qe.show(Qe.showRecord()(Qe.showRecordFieldsCons({reflectSymbol:function(){return"endpoint"}})(Qe.showRecordFieldsCons({reflectSymbol:function(){return"url"}})(Qe.showRecordFieldsNil)(Qe.showString))(_n)))({endpoint:e.value0,url:dt(e.value0)});if(e instanceof Mn)return Qe.show(Qe.showRecord()(Qe.showRecordFieldsCons({reflectSymbol:function(){return"endpoint"}})(Qe.showRecordFieldsCons({reflectSymbol:function(){return"mediaType"}})(Qe.showRecordFieldsCons({reflectSymbol:function(){return"url"}})(Qe.showRecordFieldsNil)(Qe.showString))(We.showMediaType))(_n)))({endpoint:e.value0,mediaType:e.value1,url:dt(e.value0)});throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 483, column 20 - line 488, column 80): "+[e.constructor.name])}();return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(rn.liftEffect(O.monadEffectLoggerT(K.monadEffectReader(nn.monadEffectAff)))(He.now))((function(e){return _.discard(_.discardUnit)(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(t(e)(r))((function(){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(n)((function(n){return _.discard(_.discardUnit)(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(t(e)(Pe.either(E.printError)(Qe.show(Qe.showRecord()(Qe.showRecordFieldsCons({reflectSymbol:function(){return"body"}})(Qe.showRecordFieldsCons({reflectSymbol:function(){return"headers"}})(Qe.showRecordFieldsCons({reflectSymbol:function(){return"status"}})(Qe.showRecordFieldsCons({reflectSymbol:function(){return"statusText"}})(Qe.showRecordFieldsNil)(Qe.showString))(k.showStatusCode))(Qe.showArray(P.showResponseHeader)))(Qe.showString))))(n)))((function(){return N.pure(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(n)}))}))}))}))}},mt=function(e){return function(n){return function(t){return vt(new Mn(e,n,t))(_.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(W.ask(O.monadAskLoggerT(K.monadAskReaderT(nn.monadAff))))((function(r){return _.bindFlipped(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(function(e){return function(n){return function(t){return function(r){return _.discard(_.discardUnit)(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(Be.for_(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(Be.foldableEither)(r)((function(r){var o={endpoint:e,mediaType:n,requestBody:t,rawResponse:r.body};return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(W.asks(O.monadAskLoggerT(K.monadAskReaderT(nn.monadAff)))((function(e){return e.onBlockfrostRawPostResponse})))((function(e){return tn.liftAff(O.monadAffLoggerT(tn.monadAffReader(tn.monadAffAff)))(Be.for_(nn.applicativeAff)(Be.foldableMaybe)(e)((function(e){return e(o)})))}))})))((function(){return N.pure(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(r)}))}}}}(e)(n)(t))(tn.liftAff(O.monadAffLoggerT(tn.monadAffReader(tn.monadAffAff)))(E.request({method:new Pe.Left(Ue.POST.value),url:ue.mkHttpUrl(r.blockfrostConfig)+dt(e),headers:Ge.append(Ge.semigroupArray)([new M.ContentType(n)])(Ve.maybe(Ke.mempty(Ke.monoidArray))((function(e){return[new M.RequestHeader("project_id",e)]}))(r.blockfrostApiKey)),content:t,username:E.defaultRequest.username,password:E.defaultRequest.password,withCredentials:E.defaultRequest.withCredentials,responseFormat:R.string,timeout:E.defaultRequest.timeout})))})))}}},pt=function(e){return vt(new xn(e))(_.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(W.ask(O.monadAskLoggerT(K.monadAskReaderT(nn.monadAff))))((function(n){return _.bindFlipped(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(function(e){return function(n){return _.discard(_.discardUnit)(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(Be.for_(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(Be.foldableEither)(n)((function(n){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(W.asks(O.monadAskLoggerT(K.monadAskReaderT(nn.monadAff)))((function(e){return e.onBlockfrostRawGetResponse})))((function(t){return tn.liftAff(O.monadAffLoggerT(tn.monadAffReader(tn.monadAffAff)))(Be.for_(nn.applicativeAff)(Be.foldableMaybe)(t)((function(t){return t(e)(n.body)})))}))})))((function(){return N.pure(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(n)}))}}(e))(tn.liftAff(O.monadAffLoggerT(tn.monadAffReader(tn.monadAffAff)))(E.request({method:new Pe.Left(Ue.GET.value),url:ue.mkHttpUrl(n.blockfrostConfig)+dt(e),headers:Ve.maybe(Ke.mempty(Ke.monoidArray))((function(e){return[new M.RequestHeader("project_id",e)]}))(n.blockfrostApiKey),content:E.defaultRequest.content,username:E.defaultRequest.username,password:E.defaultRequest.password,withCredentials:E.defaultRequest.withCredentials,responseFormat:R.string,timeout:E.defaultRequest.timeout})))})))},gt=H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.map(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(lt(Yn))(pt(pn.value)))((function(e){return N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(ze.unwrap()(e))}))),yt=Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(gn.value))((h=Le.map(Pe.functorEither)(at),A=lt(Xn),function(e){return h(A(e))})),bt=H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.map(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(lt(Qn))(pt(vn.value)))((function(e){return N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(ze.unwrap()(e))}))),wt=(S=function(e){return H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new Dn(e,100)))((n=ft(Ke.monoidArray),t=lt(F.decodeAesonMaybe(F.decodeAesonArray(Q.decodeAesonPoolPubKeyHash))),function(e){return n(t(e))})))((function(n){return De.length(n)<100?N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(n):Le.map(H.functorExceptT(O.functorLoggerT(K.functorReaderT(nn.functorAff))))(Ge.append(Ge.semigroupArray)(n))(S(e+1|0))})));var n,t},H.runExceptT(S(1))),Ct=function(e){var n=Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new wn(e)))((function(e){return st(Le.map(Pe.functorEither)(ut)(lt($n)(e)))})),t=Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new bn(e)))((function(e){return Le.map(Pe.functorEither)(Le.map(Ve.functorMaybe)(nt))(st(lt(F.decodeAesonMaybe(Jn))(e)))}));return H.runExceptT(V.runMaybeT(_.bind(V.bindMaybeT(H.monadExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff)))))(function(e){return Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new Cn(e)))((function(e){return st(lt(F.decodeAesonMaybe(Kn))(e))}))}(e))((function(e){var r=ct(e);if(r instanceof un)return Le.map(V.functorMaybeT(H.functorExceptT(O.functorLoggerT(K.functorReaderT(nn.functorAff)))))(j.NativeScriptRef.create)(t);if(r instanceof cn)return Le.map(V.functorMaybeT(H.functorExceptT(O.functorLoggerT(K.functorReaderT(nn.functorAff)))))((function(e){return j.PlutusScriptRef.create(Ae.plutusV1Script(e))}))(n);if(r instanceof ln)return Le.map(V.functorMaybeT(H.functorExceptT(O.functorLoggerT(K.functorReaderT(nn.functorAff)))))((function(e){return j.PlutusScriptRef.create(Ae.plutusV2Script(e))}))(n);throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 578, column 3 - line 587, column 51): "+[r.constructor.name])}))))},ht=function(e){var n=H.runExceptT($e.for(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))($e.traversableMaybe)(e.scriptHash)((function(e){return _.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Ct(e))((function(e){return Ne.flip(U.liftMaybe(H.monadThrowExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff)))))(e)(new ie.ClientOtherError("Blockfrost: Failed to resolve reference script"))}))})));return Le.map(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(Le.map(Pe.functorEither)((function(n){return{address:e.address,amount:e.amount,datum:e.datum,scriptRef:n}})))(n)},At=H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.map(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(lt(Vn))(pt(fn.value)))((function(e){return N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(ze.unwrap()(e))}))),St=function(e){var n=it(e);return Pe.note(new Te.TypeMismatch("Rational"))(_.bind(Ve.bindMaybe)(Ee.fromString(n.value0))((function(e){return _.bind(Ve.bindMaybe)(Ee.fromString(n.value1))((function(n){return we.reduce(we.rationalComponentBigInt)(e)(n)}))})))},It=function(e){var n=it(e);return Pe.note(new Te.TypeMismatch("Rational"))(_.bind(Ve.bindMaybe)(le.fromString(n.value0))((function(e){return _.bind(Ve.bindMaybe)(le.fromString(n.value1))((function(n){return N.pure(Ve.applicativeMaybe)({numerator:e,denominator:n})}))})))},Tt={decodeAeson:_.composeKleisli(Pe.bindEither)(F.decodeAeson(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonFiniteBigNumbe))(F.gDecodeAesonCons(F.decodeAesonFieldMaybe(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonFieldMaybe(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"verifyEd25519Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"unMapData-memory-arguments"}})()())({reflectSymbol:function(){return"unMapData-cpu-arguments"}})()())({reflectSymbol:function(){return"unListData-memory-arguments"}})()())({reflectSymbol:function(){return"unListData-cpu-arguments"}})()())({reflectSymbol:function(){return"unIData-memory-arguments"}})()())({reflectSymbol:function(){return"unIData-cpu-arguments"}})()())({reflectSymbol:function(){return"unConstrData-memory-arguments"}})()())({reflectSymbol:function(){return"unConstrData-cpu-arguments"}})()())({reflectSymbol:function(){return"unBData-memory-arguments"}})()())({reflectSymbol:function(){return"unBData-cpu-arguments"}})()())({reflectSymbol:function(){return"trace-memory-arguments"}})()())({reflectSymbol:function(){return"trace-cpu-arguments"}})()())({reflectSymbol:function(){return"tailList-memory-arguments"}})()())({reflectSymbol:function(){return"tailList-cpu-arguments"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sndPair-memory-arguments"}})()())({reflectSymbol:function(){return"sndPair-cpu-arguments"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha3_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha2_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"nullList-memory-arguments"}})()())({reflectSymbol:function(){return"nullList-cpu-arguments"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"mkPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkCons-memory-arguments"}})()())({reflectSymbol:function(){return"mkCons-cpu-arguments"}})()())({reflectSymbol:function(){return"mapData-memory-arguments"}})()())({reflectSymbol:function(){return"mapData-cpu-arguments"}})()())({reflectSymbol:function(){return"listData-memory-arguments"}})()())({reflectSymbol:function(){return"listData-cpu-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lengthOfByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lengthOfByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"indexByteString-memory-arguments"}})()())({reflectSymbol:function(){return"indexByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-memory-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-cpu-arguments"}})()())({reflectSymbol:function(){return"iData-memory-arguments"}})()())({reflectSymbol:function(){return"iData-cpu-arguments"}})()())({reflectSymbol:function(){return"headList-memory-arguments"}})()())({reflectSymbol:function(){return"headList-cpu-arguments"}})()())({reflectSymbol:function(){return"fstPair-memory-arguments"}})()())({reflectSymbol:function(){return"fstPair-cpu-arguments"}})()())({reflectSymbol:function(){return"equalsString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"equalsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsData-memory-arguments"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"constrData-memory-arguments"}})()())({reflectSymbol:function(){return"constrData-cpu-arguments"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"chooseUnit-memory-arguments"}})()())({reflectSymbol:function(){return"chooseUnit-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseList-memory-arguments"}})()())({reflectSymbol:function(){return"chooseList-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseData-memory-arguments"}})()())({reflectSymbol:function(){return"chooseData-cpu-arguments"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"blake2b_256-memory-arguments"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"bData-memory-arguments"}})()())({reflectSymbol:function(){return"bData-cpu-arguments"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-intercept"}})()())()))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonRecord(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonCons(F.decodeAesonField1(pe.decodeAesonInt))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"verifySchnorrSecp256k1Signature-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"verifyEd25519Signature-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"verifyEcdsaSecp256k1Signature-memory-arguments"}})()())({reflectSymbol:function(){return"verifyEcdsaSecp256k1Signature-cpu-arguments"}})()())({reflectSymbol:function(){return"unMapData-memory-arguments"}})()())({reflectSymbol:function(){return"unMapData-cpu-arguments"}})()())({reflectSymbol:function(){return"unListData-memory-arguments"}})()())({reflectSymbol:function(){return"unListData-cpu-arguments"}})()())({reflectSymbol:function(){return"unIData-memory-arguments"}})()())({reflectSymbol:function(){return"unIData-cpu-arguments"}})()())({reflectSymbol:function(){return"unConstrData-memory-arguments"}})()())({reflectSymbol:function(){return"unConstrData-cpu-arguments"}})()())({reflectSymbol:function(){return"unBData-memory-arguments"}})()())({reflectSymbol:function(){return"unBData-cpu-arguments"}})()())({reflectSymbol:function(){return"trace-memory-arguments"}})()())({reflectSymbol:function(){return"trace-cpu-arguments"}})()())({reflectSymbol:function(){return"tailList-memory-arguments"}})()())({reflectSymbol:function(){return"tailList-cpu-arguments"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"subtractInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sndPair-memory-arguments"}})()())({reflectSymbol:function(){return"sndPair-cpu-arguments"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sliceByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha3_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha3_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"sha2_256-memory-arguments"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"sha2_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"serialiseData-memory-arguments-slope"}})()())({reflectSymbol:function(){return"serialiseData-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"serialiseData-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"serialiseData-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"remainderInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"remainderInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"quotientInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"quotientInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"nullList-memory-arguments"}})()())({reflectSymbol:function(){return"nullList-cpu-arguments"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"multiplyInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"modInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"modInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"mkPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilPairData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkNilData-memory-arguments"}})()())({reflectSymbol:function(){return"mkNilData-cpu-arguments"}})()())({reflectSymbol:function(){return"mkCons-memory-arguments"}})()())({reflectSymbol:function(){return"mkCons-cpu-arguments"}})()())({reflectSymbol:function(){return"mapData-memory-arguments"}})()())({reflectSymbol:function(){return"mapData-cpu-arguments"}})()())({reflectSymbol:function(){return"listData-memory-arguments"}})()())({reflectSymbol:function(){return"listData-cpu-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanEqualsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lessThanByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"lessThanByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"lengthOfByteString-memory-arguments"}})()())({reflectSymbol:function(){return"lengthOfByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"indexByteString-memory-arguments"}})()())({reflectSymbol:function(){return"indexByteString-cpu-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-memory-arguments"}})()())({reflectSymbol:function(){return"ifThenElse-cpu-arguments"}})()())({reflectSymbol:function(){return"iData-memory-arguments"}})()())({reflectSymbol:function(){return"iData-cpu-arguments"}})()())({reflectSymbol:function(){return"headList-memory-arguments"}})()())({reflectSymbol:function(){return"headList-cpu-arguments"}})()())({reflectSymbol:function(){return"fstPair-memory-arguments"}})()())({reflectSymbol:function(){return"fstPair-cpu-arguments"}})()())({reflectSymbol:function(){return"equalsString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"equalsInteger-memory-arguments"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsInteger-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsData-memory-arguments"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsData-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-memory-arguments"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"equalsByteString-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"encodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-minimum"}})()())({reflectSymbol:function(){return"divideInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-slope"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-model-arguments-intercept"}})()())({reflectSymbol:function(){return"divideInteger-cpu-arguments-constant"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"decodeUtf8-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"constrData-memory-arguments"}})()())({reflectSymbol:function(){return"constrData-cpu-arguments"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"consByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"chooseUnit-memory-arguments"}})()())({reflectSymbol:function(){return"chooseUnit-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseList-memory-arguments"}})()())({reflectSymbol:function(){return"chooseList-cpu-arguments"}})()())({reflectSymbol:function(){return"chooseData-memory-arguments"}})()())({reflectSymbol:function(){return"chooseData-cpu-arguments"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekVarCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekStartupCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekLamCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekForceCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekDelayCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekConstCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekBuiltinCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetMemory"}})()())({reflectSymbol:function(){return"cekApplyCost-exBudgetCPU"}})()())({reflectSymbol:function(){return"blake2b_256-memory-arguments"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"blake2b_256-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"bData-memory-arguments"}})()())({reflectSymbol:function(){return"bData-cpu-arguments"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"appendByteString-cpu-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-memory-arguments-intercept"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-slope"}})()())({reflectSymbol:function(){return"addInteger-cpu-arguments-intercept"}})()())()))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"PlutusV2"}})()())({reflectSymbol:function(){return"PlutusV1"}})()())()))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonBigInt))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonUInt)))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(Un(F.decodeAesonBigInt)))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonFiniteBigNumbe))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonFiniteBigNumbe))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonUInt))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonFiniteBigNumbe))(F.gDecodeAesonCons(F.decodeAesonField1(F.decodeAesonFiniteBigNumbe))(F.gDecodeAesonRowNil)({reflectSymbol:function(){return"tau"}})()())({reflectSymbol:function(){return"rho"}})()())({reflectSymbol:function(){return"protocol_minor_ver"}})()())({reflectSymbol:function(){return"protocol_major_ver"}})()())({reflectSymbol:function(){return"price_step"}})()())({reflectSymbol:function(){return"price_mem"}})()())({reflectSymbol:function(){return"pool_deposit"}})()())({reflectSymbol:function(){return"n_opt"}})()())({reflectSymbol:function(){return"min_pool_cost"}})()())({reflectSymbol:function(){return"min_fee_b"}})()())({reflectSymbol:function(){return"min_fee_a"}})()())({reflectSymbol:function(){return"max_val_size"}})()())({reflectSymbol:function(){return"max_tx_size"}})()())({reflectSymbol:function(){return"max_tx_ex_steps"}})()())({reflectSymbol:function(){return"max_tx_ex_mem"}})()())({reflectSymbol:function(){return"max_collateral_inputs"}})()())({reflectSymbol:function(){return"max_block_size"}})()())({reflectSymbol:function(){return"max_block_header_size"}})()())({reflectSymbol:function(){return"max_block_ex_steps"}})()())({reflectSymbol:function(){return"max_block_ex_mem"}})()())({reflectSymbol:function(){return"key_deposit"}})()())({reflectSymbol:function(){return"e_max"}})()())({reflectSymbol:function(){return"cost_models"}})()())({reflectSymbol:function(){return"collateral_percent"}})()())({reflectSymbol:function(){return"coins_per_utxo_word"}})()())({reflectSymbol:function(){return"coins_per_utxo_size"}})()())({reflectSymbol:function(){return"a0"}})()())()))((function(e){return _.bind(Pe.bindEither)(St(e.a0))((function(n){return _.bind(Pe.bindEither)(St(e.rho))((function(t){return _.bind(Pe.bindEither)(St(e.tau))((function(r){return _.bind(Pe.bindEither)(It(e.price_mem))((function(o){return _.bind(Pe.bindEither)(It(e.price_step))((function(a){var u,i,c={memPrice:o,stepPrice:a};return _.bind(Pe.bindEither)(Ve.maybe(new Pe.Left(new Te.AtKey("coinsPerUtxoByte or coinsPerUtxoWord",Te.MissingValue.value)))(N.pure(Pe.applicativeEither))(B.alt(Ve.altMaybe)(Le.map(Ve.functorMaybe)((i=ze.unwrap(),function(e){return ye.CoinsPerUtxoByte.create(Z.Coin(i(e)))}))(e.coins_per_utxo_size))(Le.map(Ve.functorMaybe)((u=ze.unwrap(),function(e){return ye.CoinsPerUtxoWord.create(Z.Coin(u(e)))}))(e.coins_per_utxo_word))))((function(o){return N.pure(Pe.applicativeEither)({protocolVersion:new en.Tuple(e.protocol_major_ver,e.protocol_minor_ver),decentralization:je.zero(we.semiringRational),extraPraosEntropy:Ve.Nothing.value,maxBlockHeaderSize:e.max_block_header_size,maxBlockBodySize:e.max_block_size,maxTxSize:e.max_tx_size,txFeeFixed:e.min_fee_b,txFeePerByte:e.min_fee_a,stakeAddressDeposit:ze.unwrap()(e.key_deposit),stakePoolDeposit:ze.unwrap()(e.pool_deposit),minPoolCost:ze.unwrap()(e.min_pool_cost),poolRetireMaxEpoch:e.e_max,stakePoolTargetNum:e.n_opt,poolPledgeInfluence:n,monetaryExpansion:t,treasuryCut:r,coinsPerUtxoUnit:o,costModels:Oe.fromFoldable(Ae.ordLanguage)(Be.foldableArray)([new en.Tuple(Ae.PlutusV1.value,ye.convertPlutusV1CostModel(e.cost_models.PlutusV1)),new en.Tuple(Ae.PlutusV2.value,ye.convertPlutusV2CostModel(e.cost_models.PlutusV2))]),prices:c,maxTxExUnits:{mem:ze.unwrap()(e.max_tx_ex_mem),steps:ze.unwrap()(e.max_tx_ex_steps)},maxBlockExUnits:{mem:ze.unwrap()(e.max_block_ex_mem),steps:ze.unwrap()(e.max_block_ex_steps)},maxValueSize:ze.unwrap()(e.max_val_size),collateralPercent:e.collateral_percent,maxCollateralInputs:e.max_collateral_inputs})}))}))}))}))}))}))}))},Dt=Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(yn.value))((I=Le.map(Pe.functorEither)(et),T=lt(Tt),function(e){return I(T(e))}));D.evaluateTx=function(e){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(rn.liftEffect(O.monadEffectLoggerT(K.monadEffectReader(nn.monadEffectAff)))(te.convertTransaction(e)))((function(e){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(Le.map(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(lt(jn))((n=ae.toBytes()(e),mt(mn.value)("application/cbor")(new Ve.Just(x.string(fe.cborBytesToHex(n)))))))((function(e){var n=Le.map(Pe.functorEither)(rt)(e);if(n instanceof Pe.Left)return U.throwError(O.monadThrowLoggerT(K.monadThrowReaderT(nn.monadThrowAff)))(on.error(Qe.show(ie.showClientError)(n.value0)));if(n instanceof Pe.Right&&n.value0 instanceof Pe.Left)return U.throwError(O.monadThrowLoggerT(K.monadThrowReaderT(nn.monadThrowAff)))(on.error("Server responded with `fault`: "+F.stringifyAeson(n.value0.value0)));if(n instanceof Pe.Right&&n.value0 instanceof Pe.Right)return N.pure(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(n.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 632, column 3 - line 638, column 36): "+[n.constructor.name])}));var n}))},D.getChainTip=gt,D.getCurrentEpoch=yt,D.getDatumByHash=function(e){return Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new dn(e)))((function(e){return st(Le.map(Pe.functorEither)(ot)(lt(Zn)(e)))}))},D.getEraSummaries=bt,D.getProtocolParameters=Dt,D.getScriptByHash=Ct,D.getSystemStart=At,D.getTxMetadata=function(e){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(pt(new Sn(e)))((function(e){return N.pure(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(function(){var n=Le.map(Pe.functorEither)(tt)(lt(Gn)(e));if(n instanceof Pe.Left&&n.value0 instanceof ie.ClientHttpResponseError&&404===n.value0.value0)return new Pe.Left(X.GetTxMetadataTxNotFoundError.value);if(n instanceof Pe.Left)return new Pe.Left(new X.GetTxMetadataClientError(n.value0));if(n instanceof Pe.Right){if(Oe.isEmpty(ze.unwrap()(n.value0)))return new Pe.Left(X.GetTxMetadataMetadataEmptyOrMissingError.value);if(Me.otherwise)return new Pe.Right(n.value0)}throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 671, column 8 - line 679, column 36): "+[n.constructor.name])}())}))},D.getUtxoByOref=function(e){return H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new Tn(e.transactionId)))((n=ft(Pn),t=lt(F.decodeAesonMaybe(On)),function(e){return n(t(e))})))((function(n){return $e.traverse($e.traversableMaybe)(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))((function(e){return H.ExceptT(ht(e))}))(Le.map(Ve.functorMaybe)(en.snd)(De.find((t=ke.eq(Se.eqTransactionInput)(e),function(e){return t(en.fst(e))}))(ze.unwrap()(n))));var t})));var n,t},D.doesTxExist=function(e){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(pt(new An(e)))((function(e){return N.pure(O.applicativeLoggerT(K.monadReaderT(nn.monadAff)))(function(){var n=lt(F.decodeAesonAeson)(e);if(n instanceof Pe.Right)return new Pe.Right(!0);if(n instanceof Pe.Left&&n.value0 instanceof ie.ClientHttpResponseError&&404===n.value0.value0)return new Pe.Right(!1);if(n instanceof Pe.Left)return new Pe.Left(n.value0);throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 657, column 8 - line 660, column 21): "+[n.constructor.name])}())}))},D.runBlockfrostServiceM=function(e){return function(n){var t,r,o=Ne.flip(K.runReaderT)((t=Ve.Nothing.value,function(e){return function(n){return{blockfrostConfig:n.blockfrostConfig,blockfrostApiKey:n.blockfrostApiKey,onBlockfrostRawGetResponse:t,onBlockfrostRawPostResponse:e}}})(Ve.Nothing.value)(n)),a=Ne.flip(O.runLoggerT)((r=tn.liftAff(tn.monadAffReader(tn.monadAffAff)),function(n){return r(e(n))}));return function(e){return o(a(e))}}},D.submitTx=function(e){return _.bind(O.bindLoggerT(K.monadReaderT(nn.monadAff)))(rn.liftEffect(O.monadEffectLoggerT(K.monadEffectReader(nn.monadEffectAff)))(te.convertTransaction(e)))((function(e){return Le.map(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(lt(Se.decodeAesonTransactionHas))((n=ae.toBytes()(e),mt(hn.value)("application/cbor")(new Ve.Just(x.arrayView(ze.unwrap()(ze.unwrap()(n)))))));var n}))},D.utxosAt=function(e){var n=function(t){return H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new In(e,t,100)))((r=ft(kn),o=lt(F.decodeAesonMaybe(qn)),function(e){return r(o(e))})))((function(e){var r=De.length(ze.unwrap()(e))<100;if(r)return N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(e);if(!r)return Le.map(H.functorExceptT(O.functorLoggerT(K.functorReaderT(nn.functorAff))))(Ge.append(Rn)(e))(n(t+1|0));throw new Error("Failed pattern match at Ctl.Internal.Service.Blockfrost (line 544, column 5 - line 546, column 74): "+[r.constructor.name])})));var r,o};return H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(n(1))((function(e){return H.ExceptT((n=e,function(e){var t,r=(t=Ne.flip(O.runLoggerT)(e),function(e){return H.ExceptT(t(ht(e)))});return H.runExceptT(Le.map(H.functorExceptT(K.functorReaderT(nn.functorAff)))(Oe.fromFoldable(Se.ordTransactionInput)(Be.foldableArray))(z.parTraverse(J.monadParExceptT(J.monadParReaderT(nn.parallelAff)))($e.traversableArray)($e.traverse($e.traversableTuple)(H.applicativeExceptT(K.monadReaderT(nn.monadAff)))(r))(n)))}));var n})))},D.getPoolIds=wt,D.getPubKeyHashDelegationsAndRewards=function(e){return function(n){return H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new En(new an(e,new Pe.Left(n)))))((t=lt(F.decodeAesonMaybe(zn)),function(e){return st(t(e))})))((function(e){return N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(Ve.functorMaybe)(e)((function(e){return{rewards:e.withdrawable_amount,delegate:e.pool_id}})))})));var t}},D.getValidatorHashDelegationsAndRewards=function(e){return function(n){return H.runExceptT(_.bind(H.bindExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(O.functorLoggerT(K.functorReaderT(nn.functorAff)))(pt(new En(new an(e,new Pe.Right(n)))))((t=lt(F.decodeAesonMaybe(zn)),function(e){return st(t(e))})))((function(e){return N.pure(H.applicativeExceptT(O.monadLoggerT(K.monadReaderT(nn.monadAff))))(Le.mapFlipped(Ve.functorMaybe)(e)((function(e){return{rewards:e.withdrawable_amount,delegate:e.pool_id}})))})));var t}}}(c),function(e){"use strict";e["Ctl.Internal.Types.UsedTxOuts"]=e["Ctl.Internal.Types.UsedTxOuts"]||{};var n=e["Ctl.Internal.Types.UsedTxOuts"],t=e["Control.Alternative"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Control.Monad.Reader.Class"],u=e["Ctl.Internal.Types.Transaction"],i=e["Data.Functor"],c=e["Data.Map.Internal"],l=e["Data.Maybe"],s=e["Data.Newtype"],f=e["Data.Set"],d=e["Data.UInt"],v=e["Effect.Class"],m=e["Effect.Ref"],p=function(e){return e};n.isTxOutRefUsed=function(e){return function(n){return function(i){return o.bind(e.Monad0().Bind1())(o.bindFlipped(e.Monad0().Bind1())((p=v.liftEffect(n),g=s.unwrap(),function(e){return p(m.read(g(e)))}))(a.ask(e)))((function(n){return r.pure(e.Monad0().Applicative0())(function(e){return function(n){return l.isJust(o.bind(l.bindMaybe)(c.lookup(u.ordTransactionHash)(n.transactionId)(e))((function(e){return t.guard(l.alternativeMaybe)(f.member(d.uintOrd)(n.index)(e))})))}}(n)(i))}));var p,g}}},n.newUsedTxOuts=function(e){return i.map(e.Monad0().Bind1().Apply0().Functor0())(p)(v.liftEffect(e)(m.new(c.empty)))}}(c),function(e){const n=new Error("`window` is not an object. Are you trying to run a Contract with connected light wallet in NodeJS environment?");e._enableWallet=e=>()=>{if(t(e)())return window.cardano[e].enable().catch((e=>{throw new Error("enableWallet failed: "+("string"==typeof e.info?e.info:e.toString()))}));throw new Error("Wallet is not available. Use `isWalletAvailable "+(e=>({nami:"NamiWallet",gerowallet:"GeroWallet",flint:"FlintWallet",LodeWallet:"LodeWallet",eternl:"EternlWallet"}[e]||"is?WalletAvailable"))(e)+"` before connecting.")};const t=e=>()=>((()=>{if("object"!=typeof window)throw n})(),void 0!==window.cardano&&void 0!==window.cardano[e]&&"function"==typeof window.cardano[e].enable);e._isWalletAvailable=t,e._name=e=>()=>{if(t(e)())return window.cardano[e].name;throw new Error("Wallet `"+e+"` is not available")}}(c["Ctl.Internal.Wallet"]=c["Ctl.Internal.Wallet"]||{}),function(e){e._getNetworkId=e=>()=>e.getNetworkId(),e._getUtxos=e=>n=>()=>n.getUtxos().then((n=>null===n?e.nothing:e.just(n))),e._getCollateral=e=>n=>()=>n.experimental.getCollateral().then((n=>null!==n&&n.length?e.just(n):e.nothing)),e._getBalance=e=>()=>e.getBalance(),e._getAddresses=e=>e.getUsedAddresses,e._getUnusedAddresses=e=>()=>e.getUnusedAddresses(),e._getChangeAddress=e=>()=>e.getChangeAddress(),e._getRewardAddresses=e=>()=>e.getRewardAddresses(),e._signTx=e=>n=>()=>n.signTx(e,!0).catch((e=>{throw JSON.stringify(e)})),e._signData=e=>n=>t=>()=>t.signData(e,n).catch((e=>{throw JSON.stringify(e)}))}(c["Ctl.Internal.Wallet.Cip30"]=c["Ctl.Internal.Wallet.Cip30"]||{}),function(e){e.thenImpl=function(e){return function(n){return function(t){return function(){e.then(t,n)}}}}}(c["Control.Promise"]=c["Control.Promise"]||{}),function(e){"use strict";e["Control.Promise"]=e["Control.Promise"]||{};var n,t=e["Control.Promise"],r=e["Control.Promise"],o=e["Control.Alt"],a=e["Control.Bind"],u=e["Control.Category"],i=e["Control.Monad.Except"],c=e["Control.Monad.Except.Trans"],l=e["Data.Either"],s=e["Data.Functor"],f=e["Data.Identity"],d=e["Data.List.Types"],v=e["Data.Monoid"],m=e.Effect,p=e["Effect.Aff"],g=e["Effect.Class"],y=e["Effect.Exception"],b=e.Foreign,w=(n=function(e){return l.either((function(e){return y.error("Promise failed, couldn't extract JS Error or String")}))(u.identity(u.categoryFn))(i.runExcept(o.alt(c.altExceptT(d.semigroupNonEmptyList)(f.monadIdentity))(b.unsafeReadTagged(f.monadIdentity)("Error")(e))(s.map(c.functorExceptT(f.functorIdentity))(y.error)(b.readString(f.monadIdentity)(e)))))},function(e){return p.makeAff((function(t){return s.voidRight(m.functorEffect)(v.mempty(p.monoidCanceler))(r.thenImpl(e)((function(e){return t(l.Left.create(n(e)))()}))((function(e){return t(l.Right.create(e))()})))}))});t.toAffE=function(e){return a.bind(p.bindAff)(g.liftEffect(p.monadEffectAff)(e))(w)}}(c),function(e){let n;n=t(1164),n=t(6359)(n);const r=e=>n=>n[e](),o=e=>n=>t=>{const r=t[e]();return null!=r?n.just(r):n.nothing},a=e=>n=>{const t=(e=>{const n=[];for(let t=0;tn=>t=>{if(t.is_native_script())return e(t.native_script());if(t.is_plutus_script())return n(t.plutus_script());throw"Impossible happened: withScriptRef: not a script"},e.getAmount=r("amount"),e.getCoin=r("coin"),e.getMultiAsset=o("multiasset"),e.extractMultiAsset=a,e.extractAssets=a,e.getDataHash=o("data_hash")}(c["Ctl.Internal.Deserialization.UnspentOutput"]=c["Ctl.Internal.Deserialization.UnspentOutput"]||{}),function(e){const n=e=>n=>n[e](),t=e=>n=>t=>{const r=t[e]();return null!=r?n.just(r):n.nothing},r=e=>{const n=[];for(let t=0;tt=>{if(t.kind()==n.LanguageKind.PlutusV1)return e.plutusV1;if(t.kind()==n.LanguageKind.PlutusV2)return e.plutusV2;throw"_convertLanguage: Unsupported language kind: "+t.kind()}}(c["Ctl.Internal.Deserialization.Language"]=c["Ctl.Internal.Deserialization.Language"]||{}),function(e){"use strict";e["Ctl.Internal.Deserialization.Language"]=e["Ctl.Internal.Deserialization.Language"]||{};var n=e["Ctl.Internal.Deserialization.Language"],t=e["Ctl.Internal.Deserialization.Language"],r=e["Ctl.Internal.Types.Scripts"],o=t._convertLanguage({plutusV1:r.PlutusV1.value,plutusV2:r.PlutusV2.value});n.convertLanguage=o}(c),function(e){"use strict";e["Ctl.Internal.Deserialization.WitnessSet"]=e["Ctl.Internal.Deserialization.WitnessSet"]||{};var n,t,r,o,a=e["Ctl.Internal.Deserialization.WitnessSet"],u=e["Ctl.Internal.Deserialization.WitnessSet"],i=e["Control.Applicative"],c=e["Control.Bind"],l=e["Ctl.Internal.Cardano.Types.Transaction"],s=e["Ctl.Internal.Deserialization.Language"],f=e["Ctl.Internal.Deserialization.NativeScript"],d=e["Ctl.Internal.Deserialization.PlutusData"],v=e["Ctl.Internal.FfiHelpers"],m=e["Ctl.Internal.Types.BigNum"],p=e["Ctl.Internal.Types.RedeemerTag"],g=e["Ctl.Internal.Types.Scripts"],y=e["Data.Functor"],b=e["Data.Maybe"],w=e["Data.Traversable"],C=e["Data.Tuple"],h=function(e){return l.Vkey(l.mkFromCslPubKey(u.vkeyPublicKey(e)))},A=function(e){var n=u.getVkey(e),t=l.mkFromCslEd25519Signature(u.getSignature(e)),r=h(n);return new C.Tuple(r,t)},S=(n=y.map(y.functorArray)(A),function(e){return n(u.extractWitnesses(e))}),I=function(e){var n=s.convertLanguage(u.plutusScriptVersion(e));return C.curry(g.PlutusScript)(u.plutusScriptBytes(e))(n)},T=function(e){return y.mapFlipped(y.functorArray)(u.extractPlutusScripts(e))(I)},D=(t=y.map(y.functorArray)(d.convertPlutusData),function(e){return t(u.extractPlutusData(e))}),F=function(e){return y.mapFlipped(y.functorArray)(u.extractNativeScripts(e))(f.convertNativeScript)},E=(r=w.traverse(w.traversableArray)(b.applicativeMaybe)((function(e){return c.bind(b.bindMaybe)((n=u.getRedeemerTag(e),0===(t=u.getRedeemerTagKind(n))?new b.Just(p.Spend.value):1===t?new b.Just(p.Mint.value):2===t?new b.Just(p.Cert.value):3===t?new b.Just(p.Reward.value):b.Nothing.value))((function(n){var t,r,o=m.toBigInt(u.getRedeemerIndex(e)),a=(t=u.getExUnits(e),r=m.toBigInt(u.getExUnitsSteps(t)),{mem:m.toBigInt(u.getExUnitsMem(t)),steps:r}),c=d.convertPlutusData(u.getRedeemerPlutusData(e));return i.pure(b.applicativeMaybe)({tag:n,index:o,data:c,exUnits:a})}));var n,t})),function(e){return r(u.extractRedeemers(e))}),x=(o=y.map(y.functorArray)((function(e){return{vkey:h(u.getBootstrapVkey(e)),signature:l.mkFromCslEd25519Signature(u.getBootstrapSignature(e)),chainCode:u.getBootstrapChainCode(e),attributes:u.getBootstrapAttributes(e)}})),function(e){return o(u.extractBootstraps(e))});a.convertPlutusScript=I,a.convertVkeyWitness=A,a.convertWitnessSet=function(e){var n=y.mapFlipped(b.functorMaybe)(u.getPlutusScripts(v.maybeFfiHelper)(e))(T),t=y.mapFlipped(b.functorMaybe)(u.getWitnessSetPlutusData(v.maybeFfiHelper)(e))(D),r=y.mapFlipped(b.functorMaybe)(u.getNativeScripts(v.maybeFfiHelper)(e))(F);return c.bind(b.bindMaybe)(w.for(b.applicativeMaybe)(w.traversableMaybe)(u.getRedeemers(v.maybeFfiHelper)(e))(E))((function(o){return i.pure(b.applicativeMaybe)({vkeys:y.mapFlipped(b.functorMaybe)(u.getVkeywitnesses(v.maybeFfiHelper)(e))(S),nativeScripts:r,bootstraps:y.mapFlipped(b.functorMaybe)(u.getBootstraps(v.maybeFfiHelper)(e))(x),plutusScripts:n,plutusData:t,redeemers:o})}))}}(c),function(e){"use strict";e["Ctl.Internal.Deserialization.UnspentOutput"]=e["Ctl.Internal.Deserialization.UnspentOutput"]||{};var n=e["Ctl.Internal.Deserialization.UnspentOutput"],t=e["Ctl.Internal.Deserialization.UnspentOutput"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Cardano.Types.ScriptRef"],u=e["Ctl.Internal.Cardano.Types.Value"],i=e["Ctl.Internal.Deserialization.NativeScript"],c=e["Ctl.Internal.Deserialization.PlutusData"],l=e["Ctl.Internal.Deserialization.WitnessSet"],s=e["Ctl.Internal.FfiHelpers"],f=e["Ctl.Internal.Serialization.Hash"],d=e["Ctl.Internal.Serialization.ToBytes"],v=e["Ctl.Internal.Types.BigNum"],m=e["Ctl.Internal.Types.OutputDatum"],p=e["Ctl.Internal.Types.TokenName"],g=e["Ctl.Internal.Types.Transaction"],y=e["Data.Bitraversable"],b=e["Data.Foldable"],w=e["Data.Functor"],C=e["Data.Map.Internal"],h=e["Data.Maybe"],A=e["Data.Newtype"],S=e["Data.Traversable"],I=e["Data.Tuple"],T=function(e){var n=v.toBigInt(t.getCoin(e));return o.bind(h.bindMaybe)(S.for(h.applicativeMaybe)(S.traversableMaybe)(t.getMultiAsset(s.maybeFfiHelper)(e))((function(e){var n,a,i,c,l,s=w.map(w.functorArray)(w.map(I.functorTuple)(t.extractAssets(I.Tuple.create)))(t.extractMultiAsset(I.Tuple.create)(e));return o.bind(h.bindMaybe)((c=w.map(h.functorMaybe)(C.fromFoldable(u.ordCurrencySymbol)(b.foldableArray)),l=(a=w.map(h.functorMaybe),i=w.map(w.functorArray),function(e){return a(i(e))})(w.map(I.functorTuple)(C.fromFoldable(p.ordTokenName)(b.foldableArray))),function(e){return c(l(e))})(S.traverse(S.traversableArray)(h.applicativeMaybe)(y.bitraverse(y.bitraversableTuple)(h.applicativeMaybe)((n=A.unwrap(),function(e){return u.mkCurrencySymbol(n(f.scriptHashToBytes(e)))}))(S.traverse(S.traversableArray)(h.applicativeMaybe)(y.ltraverse(y.bitraversableTuple)(h.applicativeMaybe)((function(e){return p.mkTokenName(p.assetNameName(e))})))))(s)))((function(e){return r.pure(h.applicativeMaybe)(w.map(C.functorMap)(w.map(C.functorMap)(v.toBigInt))(e))}))})))((function(e){return r.pure(h.applicativeMaybe)(u.mkValue(n)(u.mkNonAdaAsset(h.fromMaybe(C.empty)(e))))}))},D=t.withScriptRef((function(e){return a.NativeScriptRef.create(i.convertNativeScript(e))}))((function(e){return a.PlutusScriptRef.create(l.convertPlutusScript(e))}));n.convertUnspentOutput=function(e){var n,a=function(e){var n=t.getTransactionIndex(e);return{transactionId:A.unwrap()(d.toBytes()(t.getTransactionHash(e))),index:n}}(t.getInput(e));return o.bind(h.bindMaybe)((n=t.getOutput(e),o.bind(h.bindMaybe)(T(t.getAmount(n)))((function(e){var a,u,i=t.getPlutusData(s.maybeFfiHelper)(n),l=w.mapFlipped(h.functorMaybe)(t.getDataHash(s.maybeFfiHelper)(n))((a=A.unwrap(),u=d.toBytes(),function(e){return g.DataHash(a(u(e)))})),f=t.getAddress(n);return o.bind(h.bindMaybe)(function(){if(i instanceof h.Just&&l instanceof h.Just)return h.Nothing.value;if(i instanceof h.Just&&l instanceof h.Nothing)return r.pure(h.applicativeMaybe)(new m.OutputDatum(A.wrap()(c.convertPlutusData(i.value0))));if(i instanceof h.Nothing&&l instanceof h.Just)return r.pure(h.applicativeMaybe)(new m.OutputDatumHash(l.value0));if(i instanceof h.Nothing&&l instanceof h.Nothing)return r.pure(h.applicativeMaybe)(m.NoOutputDatum.value);throw new Error("Failed pattern match at Ctl.Internal.Deserialization.UnspentOutput (line 98, column 12 - line 103, column 43): "+[i.constructor.name,l.constructor.name])}())((function(o){var a=w.mapFlipped(h.functorMaybe)(t.getScriptRef(s.maybeFfiHelper)(n))(D);return r.pure(h.applicativeMaybe)({address:f,amount:e,datum:o,scriptRef:a})}))}))))((function(e){return r.pure(h.applicativeMaybe)({input:a,output:e})}))},n.convertValue=T}(c),function(e){"use strict";e["Ctl.Internal.Wallet.Cip30"]=e["Ctl.Internal.Wallet.Cip30"]||{};var n,t,r,o,a,u=e["Ctl.Internal.Wallet.Cip30"],i=e["Ctl.Internal.Wallet.Cip30"],c=e["Control.Alt"],l=e["Control.Applicative"],s=e["Control.Bind"],f=e["Control.Monad"],d=e["Control.Monad.Error.Class"],v=e["Control.Promise"],m=e["Ctl.Internal.Cardano.Types.Transaction"],p=e["Ctl.Internal.Deserialization.FromBytes"],g=e["Ctl.Internal.Deserialization.UnspentOutput"],y=e["Ctl.Internal.Deserialization.WitnessSet"],b=e["Ctl.Internal.FfiHelpers"],w=e["Ctl.Internal.Serialization"],C=e["Ctl.Internal.Serialization.Address"],h=e["Ctl.Internal.Serialization.ToBytes"],A=e["Ctl.Internal.Types.ByteArray"],S=e["Ctl.Internal.Types.CborBytes"],I=e["Ctl.Internal.Types.RawBytes"],T=e["Data.Functor"],D=e["Data.Maybe"],F=e["Data.Newtype"],E=e["Data.Semigroup"],x=e["Data.Traversable"],M=e.Effect,R=e["Effect.Aff"],P=e["Effect.Class"],k=e["Effect.Exception"],B=(r=P.liftEffect(R.monadEffectAff),o=T.map(M.functorEffect)((n=F.unwrap(),t=h.toBytes(),function(e){return A.byteArrayToHex(n(t(e)))})),function(e){return r(o(w.convertTransaction(e)))}),N=function(e){return function(n){return function(t){var r=T.map(D.functorMaybe)(C.rewardAddressBytes)(C.rewardAddressFromAddress(n)),o=T.map(D.functorMaybe)(C.pointerAddressBytes)(C.pointerAddressFromAddress(n)),a=T.map(D.functorMaybe)(C.enterpriseAddressBytes)(C.enterpriseAddressFromAddress(n)),u=T.map(D.functorMaybe)(C.baseAddressBytes)(C.baseAddressFromAddress(n));return s.bind(R.bindAff)(d.liftMaybe(R.monadThrowAff)(k.error("Can't convert Address to base, enterprise, pointer or reward"))(c.alt(D.altMaybe)(c.alt(D.altMaybe)(c.alt(D.altMaybe)(u)(a))(o))(r)))((function(n){return s.bind(R.bindAff)(v.toAffE(i._signData(S.cborBytesToHex(n))(I.rawBytesToHex(t))(e)))((function(e){return l.pure(R.applicativeAff)(s.bind(D.bindMaybe)(S.hexToCborBytes(e.key))((function(n){return s.bind(D.bindMaybe)(S.hexToCborBytes(e.signature))((function(e){return l.pure(D.applicativeMaybe)({key:n,signature:e})}))})))}))}))}}},L=s.composeKleisliFlipped(D.bindMaybe)((a=p.fromBytes(p.fromBytesAddress),function(e){return a(S.rawBytesAsCborBytes(e))}))(I.hexToRawBytes),_=function(e){return T.mapFlipped(R.functorAff)(v.toAffE(i._getAddresses(e)))(x.traverse(x.traversableArray)(D.applicativeMaybe)(L))},U=function(e){return s.bind(R.bindAff)(v.toAffE(i._getUtxos(b.maybeFfiHelper)(e)))((function(e){return P.liftEffect(R.monadEffectAff)(x.for(M.applicativeEffect)(x.traversableMaybe)(e)(x.traverse(x.traversableArray)(M.applicativeEffect)((function(e){return d.liftMaybe(d.monadThrowEffect)(k.error("Unable to convert UTxO"))(s.bind(D.bindMaybe)(s.bind(D.bindMaybe)(S.hexToCborBytes(e))(p.fromBytes(p.fromBytesTransactionUnspe)))(g.convertUnspentOutput))}))))}))},H=function(e){return T.mapFlipped(R.functorAff)(v.toAffE(i._getUnusedAddresses(e)))(x.traverse(x.traversableArray)(D.applicativeMaybe)(L))},q=function(e){return T.mapFlipped(R.functorAff)(v.toAffE(i._getRewardAddresses(e)))(x.traverse(x.traversableArray)(D.applicativeMaybe)(L))},O=function(e){return v.toAffE(i._getNetworkId(e))},V=function(e){return s.bind(R.bindAff)(v.toAffE(function(e){return d.catchError(d.monadErrorEffect)(i._getCollateral(b.maybeFfiHelper)(e))((function(e){return d.throwError(d.monadThrowEffect)(k.error("Wallet doesn't implement `getCollateral`."))}))}(e)))((function(e){var n=s.join(D.bindMaybe)(T.map(D.functorMaybe)(x.traverse(x.traversableArray)(D.applicativeMaybe)(I.hexToRawBytes))(e));return P.liftEffect(R.monadEffectAff)(x.for(M.applicativeEffect)(x.traversableMaybe)(n)((function(e){return x.for(M.applicativeEffect)(x.traversableArray)(e)((function(e){return s.bindFlipped(M.bindEffect)(D.maybe(k.throw("Unable to convert UTxO"))(l.pure(M.applicativeEffect)))(T.map(M.functorEffect)(g.convertUnspentOutput)(p.fromBytesEffect(p.fromBytesTransactionUnspe)(S.rawBytesAsCborBytes(e))))}))})))}))},W=function(e){return T.mapFlipped(R.functorAff)(v.toAffE(i._getChangeAddress(e)))(L)},K=function(e){var n=T.map(R.functorAff)(I.hexToRawBytes);return function(t){return n(v.toAffE(e(t)))}},z=function(e){return T.mapFlipped(R.functorAff)(K(i._getBalance)(e))((function(e){return s.bind(D.bindMaybe)(e)((function(e){return s.bind(D.bindMaybe)(p.fromBytes(p.fromBytesValue)(S.rawBytesAsCborBytes(e)))(g.convertValue)}))}))},J=function(e){return function(n){return s.bind(R.bindAff)(B(n))((function(t){return s.bind(R.bindAff)(K(i._signTx(t))(e))((function(e){if(e instanceof D.Nothing)return l.pure(R.applicativeAff)(D.Nothing.value);if(e instanceof D.Just)return T.map(R.functorAff)(T.map(D.functorMaybe)(function(e){return function(n){return{body:e.body,witnessSet:E.append(m.semigroupTransactionWitne)(e.witnessSet)(n),isValid:e.isValid,auxiliaryData:e.auxiliaryData}}}(n)))(P.liftEffect(R.monadEffectAff)(T.map(M.functorEffect)(y.convertWitnessSet)(p.fromBytesEffect(p.fromBytesTransactionWitne)(S.rawBytesAsCborBytes(e.value0)))));throw new Error("Failed pattern match at Ctl.Internal.Wallet.Cip30 (line 175, column 42 - line 180, column 8): "+[e.constructor.name])}))}))}};u.mkCip30WalletAff=function(e){return function(n){return s.bind(R.bindAff)(v.toAffE(n))((function(n){return s.discard(s.discardUnit)(R.bindAff)(f.whenM(R.monadAff)(T.map(R.functorAff)(D.isNothing)(V(n)))(P.liftEffect(R.monadEffectAff)(k.throw(e+" wallet missing collateral"))))((function(){return l.pure(R.applicativeAff)({connection:n,getNetworkId:O,getUtxos:U,getCollateral:V,getBalance:z,getWalletAddresses:_,getUnusedAddresses:H,getChangeAddress:W,getRewardAddresses:q,signTx:J,signData:N})}))}))}}}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.FakeOutput"]=e["Ctl.Internal.BalanceTx.FakeOutput"]||{};var n,t=e["Ctl.Internal.BalanceTx.FakeOutput"],r=e["Ctl.Internal.Cardano.Types.Value"],o=e["Ctl.Internal.Serialization.Address"],a=e["Ctl.Internal.Types.OutputDatum"],u=e["Data.Maybe"],i=e["Data.Monoid"],c=(n=r.mkValue(i.mempty(r.monoidCoin)),function(e){return t=n(e),{address:u.fromJust()(o.addressFromBech32("addr_test1qpu5vlrf4xkxv2qpwngf6cjhtw542ayty80v8dyr49rf5ewvxwdrt70qlcpeeagscasafhffqsxy36t90ldv06wqrk2qum8x5w")),amount:t,datum:a.NoOutputDatum.value,scriptRef:u.Nothing.value};var t});t.fakeOutputWithNonAdaAssets=c}(c),function(e){let n;n=t(1164),n=t(6359)(n),e.minAdaForOutput=e=>t=>r=>{try{return e.just(n.min_ada_for_output(t,r))}catch(n){return e.nothing}},e.newCoinsPerWord=e=>n.DataCost.new_coins_per_word(e),e.newCoinsPerByte=e=>n.DataCost.new_coins_per_byte(e)}(c["Ctl.Internal.BalanceTx.UtxoMinAda"]=c["Ctl.Internal.BalanceTx.UtxoMinAda"]||{}),function(e){"use strict";e["Ctl.Internal.BalanceTx.UtxoMinAda"]=e["Ctl.Internal.BalanceTx.UtxoMinAda"]||{};var n=e["Ctl.Internal.BalanceTx.UtxoMinAda"],t=e["Ctl.Internal.BalanceTx.UtxoMinAda"],r=e["Control.Monad.Error.Class"],o=e["Ctl.Internal.FfiHelpers"],a=e["Ctl.Internal.Serialization"],u=e["Ctl.Internal.Types.BigNum"],i=e["Ctl.Internal.Types.ProtocolParameters"],c=e["Data.Functor"],l=e["Data.Maybe"],s=e.Effect,f=e["Effect.Exception"];n.utxoMinAdaValue=function(e){return function(n){return function(){var d=a.convertTxOutput(n)(),v=function(){if(e instanceof i.CoinsPerUtxoByte)return c.map(s.functorEffect)(t.newCoinsPerByte)(r.liftMaybe(r.monadThrowEffect)(f.error("Failed to convert CoinsPerUtxoByte"))(u.fromBigInt(e.value0)))();if(e instanceof i.CoinsPerUtxoWord)return c.map(s.functorEffect)(t.newCoinsPerWord)(r.liftMaybe(r.monadThrowEffect)(f.error("Failed to convert CoinsPerUtxoWord"))(u.fromBigInt(e.value0)))();throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.UtxoMinAda (line 42, column 15 - line 48, column 30): "+[e.constructor.name])}();return c.mapFlipped(l.functorMaybe)(t.minAdaForOutput(o.maybeFfiHelper)(d)(v))(u.toBigInt)}}}}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.Collateral.Select"]=e["Ctl.Internal.BalanceTx.Collateral.Select"]||{};var n,t,r,o,a,u,i,c=e["Ctl.Internal.BalanceTx.Collateral.Select"],l=e["Ctl.Internal.BalanceTx.FakeOutput"],s=e["Ctl.Internal.BalanceTx.UtxoMinAda"],f=e["Ctl.Internal.Cardano.Types.Value"],d=e["Data.BigInt"],v=e["Data.Eq"],m=e["Data.Foldable"],p=e["Data.Function"],g=e["Data.Functor"],y=e["Data.List"],b=e["Data.List.Types"],w=e["Data.Map.Internal"],C=e["Data.Maybe"],h=e["Data.Newtype"],A=e["Data.Ord"],S=e["Data.Ordering"],I=e["Data.Semigroup"],T=e["Data.Semiring"],D=e["Data.Traversable"],F=e["Data.Tuple"],E=e.Effect,x={eq:p.on(v.eq(d.eqBigInt))((n=h.unwrap(),function(e){return F.snd(n(e))}))},M=function(e){if(e instanceof b.Nil)return new b.Cons(b.Nil.value,b.Nil.value);if(e instanceof b.Cons){var n=M(e.value1);return I.append(b.semigroupList)(g.map(b.functorList)(b.Cons.create(e.value0))(n))(n)}throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Collateral.Select (line 172, column 1 - line 172, column 60): "+[e.constructor.name])},R=(t=h.unwrap(),r=h.unwrap(),function(e){return f.getNonAdaAsset(t(r(e).output).amount)}),P=function(e){return g.map(C.functorMaybe)((n=F.Tuple.create(e.value0),function(e){return n(e)}))(e.value1);var n},k=d.fromInt(5e6),B=(o=h.unwrap(),a=h.unwrap(),function(e){return f["valueToCoin'"](o(a(e).output).amount)}),N=function(e){var n=T.add(d.semiringBigInt)(e);return function(e){return n(B(e))}},L={compare:function(e){return function(n){var t,r,o,a,u=function(e){return function(n){return e instanceof S.EQ?n:e}},i=(t=h.unwrap(),function(e){return F.snd(t(e))}),c=(r=h.unwrap(),function(e){return y.length(F.fst(r(e)))}),l=(o=m.foldl(b.foldableList)(N)(T.zero(d.semiringBigInt)),a=h.unwrap(),function(e){return o(F.fst(a(e)))});return u(p.on(A.compare(d.ordBigInt))(i)(e)(n))(u(p.on(A.compare(A.ordInt))(c)(e)(n))(p.on(A.compare(d.ordBigInt))(l)(e)(n)))}},Eq0:function(){return x}},_={eq:p.on(v.eq(d.eqBigInt))((u=h.unwrap(),function(e){return B(u(e))}))},U={compare:p.on(A.compare(d.ordBigInt))((i=h.unwrap(),function(e){return B(i(e))})),Eq0:function(){return _}};c.minRequiredCollateral=k,c.selectCollateral=function(e){return function(n){var t,r,o,a,u,i=g.map(E.functorEffect)((r=g.map(C.functorMaybe)((t=h.unwrap(),function(e){return F.fst(t(e))})),o=y.sort(L),function(e){return r(y.head(o(e)))})),c=g.map(E.functorEffect)(y.mapMaybe(P)),v=D.traverse(b.traversableList)(E.applicativeEffect)((function(n){return g.map(E.functorEffect)(F.Tuple.create(n))(function(e){var n=s.utxoMinAdaValue(e),t=m.foldMap(b.foldableList)(f.monoidNonAdaAsset)(R);return function(e){return n(l.fakeOutputWithNonAdaAssets(t(e)))}}(e)(n))})),p=y.filter((function(e){return A.greaterThanOrEq(d.ordBigInt)(m.foldl(b.foldableList)(N)(T.zero(d.semiringBigInt))(e))(k)})),I=(a=n,u=y.filter((function(e){return y.length(e)<=a&&!y.null(e)})),function(e){return u(M(e))}),x=y.take(10),B=g.map(b.functorList)(h.unwrap()),_=y.sortBy((function(e){var n=A.compare(U)(e);return function(e){return S.invert(n(e))}})),H=g.map(b.functorList)((function(e){return n=e,h.wrap()({input:n.value0,output:n.value1});var n})),q=w.toUnfoldable(b.unfoldableList);return function(e){return i(c(v(p(I(x(B(_(H(q(e))))))))))}}}}(c),function(e){let n;n=t(8200),e.newCoseSign1Builder=e=>t=>()=>n.COSESign1Builder.new(t,e,!1),e.makeDataToSign=e=>e.make_data_to_sign().to_bytes(),e.sign=e=>n=>e.sign(n).to_bytes(),e.buildSignature=e=>n=>e.build(n).to_bytes(),e.newHeaders=e=>t=>n.Headers.new(t,e),e.newProtectedHeaderMap=e=>n.ProtectedHeaderMap.new(e),e.newHeaderMap=()=>n.HeaderMap.new(),e.setAlgHeaderToEdDsa=e=>()=>{const t=n.Label.from_algorithm_id(n.AlgorithmId.EdDSA);e.set_algorithm_id(t)},e.setAddressHeader=e=>t=>()=>{const r=n.Label.new_text("address"),o=n.CBORValue.new_bytes(e);t.set_header(r,o)},e.newCoseKeyWithOkpType=()=>n.COSEKey.new(n.Label.from_key_type(n.KeyType.OKP)),e.setCoseKeyAlgHeaderToEdDsa=e=>()=>{e.set_algorithm_id(n.Label.from_algorithm_id(n.AlgorithmId.EdDSA))},e.setCoseKeyCrvHeaderToEd25519=e=>()=>{e.set_header(n.Label.new_int(n.Int.new_negative(n.BigNum.from_str("1"))),n.CBORValue.new_int(n.Int.new_i32(6)))},e.setCoseKeyXHeader=e=>t=>()=>{t.set_header(n.Label.new_int(n.Int.new_negative(n.BigNum.from_str("2"))),n.CBORValue.new_bytes(e))},e.bytesFromCoseKey=e=>e.to_bytes()}(c["Ctl.Internal.Wallet.Cip30.SignData"]=c["Ctl.Internal.Wallet.Cip30.SignData"]||{}),function(e){"use strict";e["Ctl.Internal.Wallet.Cip30.SignData"]=e["Ctl.Internal.Wallet.Cip30.SignData"]||{};var n=e["Ctl.Internal.Wallet.Cip30.SignData"],t=e["Ctl.Internal.Wallet.Cip30.SignData"],r=e["Control.Apply"],o=e["Control.Bind"],a=e["Ctl.Internal.Serialization.Keys"],u=e["Ctl.Internal.Serialization.ToBytes"],i=e["Ctl.Internal.Types.CborBytes"],c=e["Data.Functor"],l=e.Effect;n.signData=function(e){return function(n){return function(s){var f,d,v,m,p,g=(f=r.apply(l.applyEffect)(c.map(l.functorEffect)(t.newHeaders)(t.newHeaderMap))((function(){var e=t.newHeaderMap();return t.setAlgHeaderToEdDsa(e)(),t.setAddressHeader(u.toBytes()(n))(e)(),t.newProtectedHeaderMap(e)})),v=o.bind(l.bindEffect)(f)(t.newCoseSign1Builder(s)),m=c.map(l.functorEffect)((d=t.sign(e),function(e){return d(t.makeDataToSign(e))}))(v),c.map(l.functorEffect)(i.CborBytes)(r.apply(l.applyEffect)(c.map(l.functorEffect)(t.buildSignature)(v))(m))),y=(p=a.bytesFromPublicKey(a.publicKeyFromPrivateKey(e)),function(){var e=t.newCoseKeyWithOkpType();return t.setCoseKeyAlgHeaderToEdDsa(e)(),t.setCoseKeyCrvHeaderToEd25519(e)(),t.setCoseKeyXHeader(p)(e)(),t.bytesFromCoseKey(e)});return r.apply(l.applyEffect)(c.map(l.functorEffect)((function(e){return function(n){return{key:e,signature:n}}}))(y))(g)}}}}(c),function(e){"use strict";e["Data.Lens.Setter"]=e["Data.Lens.Setter"]||{};var n=e["Data.Lens.Setter"],t=e["Control.Monad.State.Class"],r=e["Data.Function"],o=e["Data.Functor"],a=e["Data.Maybe"],u=e["Data.Semigroup"],i=function(e){return function(n){return e(r.const(n))}},c=function(e){return function(n){return function(r){return o.void(e.Monad0().Bind1().Apply0().Functor0())(t.modify(e)(n(r)))}}};n.over=function(e){return e},n.set=i,n.appendOver=function(e){return function(n){var t=n,o=r.flip(u.append(e));return function(e){return t(o(e))}}},n.setJust=function(e){var n=i(e);return function(e){return n(a.Just.create(e))}},n.assign=function(e){return function(n){return function(r){return o.void(e.Monad0().Bind1().Apply0().Functor0())(t.modify(e)(i(n)(r)))}}},n.modifying=c,n.appendModifying=function(e){return function(n){return function(t){var o=c(e)(t),a=r.flip(u.append(n));return function(e){return o(a(e))}}}}}(c),function(e){"use strict";e["Ctl.Internal.Wallet.Key"]=e["Ctl.Internal.Wallet.Key"]||{};var n=e["Ctl.Internal.Wallet.Key"],t=e["Control.Applicative"],r=e["Ctl.Internal.BalanceTx.Collateral.Select"],o=e["Ctl.Internal.Cardano.Types.Transaction"],a=e["Ctl.Internal.Deserialization.WitnessSet"],u=e["Ctl.Internal.Serialization"],i=e["Ctl.Internal.Serialization.Address"],c=e["Ctl.Internal.Serialization.Keys"],l=e["Ctl.Internal.Wallet.Cip30.SignData"],s=e["Data.Array"],f=e["Data.Foldable"],d=e["Data.Functor"],v=e["Data.Lens.Setter"],m=e["Data.List.Types"],p=e["Data.Maybe"],g=e["Data.Monoid"],y=e["Data.Newtype"],b=e["Data.Profunctor.Strong"],w=e["Data.Semigroup"],C=e["Data.Traversable"],h=e.Effect,A=e["Effect.Aff"],S=e["Effect.Class"];n.PrivatePaymentKey=function(e){return e},n.PrivateStakeKey=function(e){return e},n.privateKeysToKeyWallet=function(e){return function(n){var I=function(e){return function(n){return function(t){var r,o=c.publicKeyFromPrivateKey(y.unwrap()(e));if(n instanceof p.Just){var a=c.publicKeyFromPrivateKey(y.unwrap()(n.value0));return i.baseAddressToAddress(i.baseAddress({network:t,paymentCred:i.keyHashCredential(u.publicKeyHash(o)),delegationCred:i.keyHashCredential(u.publicKeyHash(a))}))}if(n instanceof p.Nothing)return r=u.publicKeyHash(o),i.enterpriseAddressToAddress(i.enterpriseAddress({network:t,paymentCred:i.keyHashCredential(r)}));throw new Error("Failed pattern match at Ctl.Internal.Wallet.Key (line 128, column 3 - line 144, column 37): "+[n.constructor.name])}}}(e)(n);return{address:I,selectCollateral:function(e){return function(n){return function(t){return d.map(h.functorEffect)(d.map(p.functorMaybe)(s.fromFoldable(m.foldableList)))(r.selectCollateral(e)(n)(t))}}},signTx:function(r){return S.liftEffect(A.monadEffectAff)((function(){var i=u.convertTxBody(r.body)(),c=u.hashTransaction(i)(),l=d.map(h.functorEffect)(a.convertVkeyWitness)(u.makeVkeywitness(c)(y.unwrap()(e)))(),s=C.for(h.applicativeEffect)(C.traversableMaybe)(n)((function(e){return d.map(h.functorEffect)(a.convertVkeyWitness)(u.makeVkeywitness(c)(y.unwrap()(e)))}))();return v.set(o._vkeys(b.strongFn))(t.pure(p.applicativeMaybe)(w.append(w.semigroupArray)([l])(f.fold(f.foldableMaybe)(g.monoidArray)(d.map(p.functorMaybe)(t.pure(t.applicativeArray))(s)))))(g.mempty(o.monoidTransactionWitnessS))}))},signData:function(n){return function(t){return S.liftEffect(A.monadEffectAff)(l.signData(y.unwrap()(e))(I(n))(t))}},paymentKey:e,stakeKey:n}}}}(c),function(e){"use strict";e["Ctl.Internal.Wallet"]=e["Ctl.Internal.Wallet"]||{};var n,t,r=e["Ctl.Internal.Wallet"],o=e["Ctl.Internal.Wallet"],a=e["Control.Applicative"],u=e["Control.Apply"],i=e["Control.Bind"],c=e["Control.Monad.Error.Class"],l=e["Ctl.Internal.Types.Natural"],s=e["Ctl.Internal.Wallet.Cip30"],f=e["Ctl.Internal.Wallet.Key"],d=e["Data.Eq"],v=e["Data.Functor"],m=e["Data.Int"],p=e["Data.Maybe"],g=e["Data.Newtype"],y=e["Data.Semiring"],b=e["Data.Show"],w=e["Data.Unit"],C=e["Effect.Aff"],h=e["Effect.Aff.Class"],A=e["Effect.Class"],S=e["Effect.Exception"],I=function(){function e(){}return e.value=new e,e}(),T=function(){function e(){}return e.value=new e,e}(),D=function(){function e(){}return e.value=new e,e}(),F=function(){function e(){}return e.value=new e,e}(),E=function(){function e(){}return e.value=new e,e}(),x=function(){function e(){}return e.value=new e,e}(),M=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),R=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),P=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),k=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),B=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),N=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),L=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),_=function(e){if(e instanceof I)return"nami";if(e instanceof T)return"gerowallet";if(e instanceof D)return"flint";if(e instanceof F)return"eternl";if(e instanceof E)return"LodeWallet";if(e instanceof x)return"nufi";throw new Error("Failed pattern match at Ctl.Internal.Wallet (line 230, column 25 - line 236, column 23): "+[e.constructor.name])},U=(A.liftEffect(C.monadEffectAff),function(e){return function(n){return n(e)(e.connection)}}),H=(t=function(e){return function(n){return function(r){return d.eq(l.eqNatural)(e)(y.zero(l.semiringNatural))?a.pure(C.applicativeAff)(w.unit):i.bind(C.bindAff)(r)((function(o){return o?a.pure(C.applicativeAff)(w.unit):u.applySecond(C.applyAff)(C.delay(g.wrap()(n)))(t(l.minus(e)(y.one(l.semiringNatural)))(n)(r))}))}}},i.discard(i.discardUnit)(C.bindAff)(t(l["fromInt'"](10))(m.toNumber(100))(A.liftEffect(C.monadEffectAff)((n=E.value,o._isWalletAvailable(_(n))))))((function(){return c.catchError(C.monadErrorAff)(v.map(C.functorAff)(B.create)(s.mkCip30WalletAff("Lode")(o._enableWallet("LodeWallet"))))((function(e){return c.throwError(C.monadThrowAff)(S.error(b.show(S.showError)(e)+" Note: LodeWallet is injected asynchronously and may be unreliable."))}))})));r.Gero=R,r.Nami=M,r.Flint=P,r.Lode=B,r.Eternl=k,r.NuFi=N,r.KeyWallet=L,r.NamiWallet=I,r.LodeWallet=E,r.GeroWallet=T,r.FlintWallet=D,r.EternlWallet=F,r.NuFiWallet=x,r.mkKeyWallet=function(e){return function(n){return new L(f.privateKeysToKeyWallet(e)(n))}},r.mkWalletAff=function(e){var n=_(e);if(e instanceof I)return v.map(C.functorAff)(M.create)(s.mkCip30WalletAff("Nami")(o._enableWallet(n)));if(e instanceof T)return v.map(C.functorAff)(R.create)(s.mkCip30WalletAff("Gero")(o._enableWallet(n)));if(e instanceof F)return v.map(C.functorAff)(k.create)(s.mkCip30WalletAff("Eternl")(o._enableWallet(n)));if(e instanceof D)return v.map(C.functorAff)(P.create)(s.mkCip30WalletAff("Flint")(o._enableWallet(n)));if(e instanceof E)return H;if(e instanceof x)return v.map(C.functorAff)(N.create)(s.mkCip30WalletAff("NuFi")(o._enableWallet(n)));throw new Error("Failed pattern match at Ctl.Internal.Wallet (line 106, column 3 - line 114, column 78): "+[e.constructor.name])},r.cip30Wallet=function(e){if(e instanceof M)return new p.Just(e.value0);if(e instanceof R)return new p.Just(e.value0);if(e instanceof P)return new p.Just(e.value0);if(e instanceof k)return new p.Just(e.value0);if(e instanceof B)return new p.Just(e.value0);if(e instanceof N)return new p.Just(e.value0);if(e instanceof L)return p.Nothing.value;throw new Error("Failed pattern match at Ctl.Internal.Wallet (line 220, column 15 - line 227, column 25): "+[e.constructor.name])},r.actionBasedOnWallet=function(e){return function(n){return function(t){return function(r){if(r instanceof k)return h.liftAff(e)(U(r.value0)(n));if(r instanceof M)return h.liftAff(e)(U(r.value0)(n));if(r instanceof R)return h.liftAff(e)(U(r.value0)(n));if(r instanceof P)return h.liftAff(e)(U(r.value0)(n));if(r instanceof B)return h.liftAff(e)(U(r.value0)(n));if(r instanceof N)return h.liftAff(e)(U(r.value0)(n));if(r instanceof L)return t(r.value0);throw new Error("Failed pattern match at Ctl.Internal.Wallet (line 296, column 3 - line 303, column 39): "+[r.constructor.name])}}}},r.callCip30Wallet=U}(c),function(e){"use strict";e["Ctl.Internal.Types.Cbor"]=e["Ctl.Internal.Types.Cbor"]||{};var n,t=e["Ctl.Internal.Types.Cbor"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Control.Monad.Error.Class"],u=e["Control.Monad.Except"],i=e["Control.Monad.Except.Trans"],c=e["Control.Monad.State.Class"],l=e["Control.Monad.State.Trans"],s=e["Ctl.Internal.Types.ByteArray"],f=e["Data.Foldable"],d=e["Data.Function"],v=e["Data.Functor"],m=e["Data.Identity"],p=e["Data.Semiring"],g=e["Data.UInt"],y=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),b=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),w=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),C=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),h=function(e){return n=g.toInt(e),o.bind(l.bindStateT(i.monadExceptT(m.monadIdentity)))(c.get(l.monadStateStateT(i.monadExceptT(m.monadIdentity))))((function(e){return o.discard(o.discardUnit)(l.bindStateT(i.monadExceptT(m.monadIdentity)))(r.when(l.applicativeStateT(i.monadExceptT(m.monadIdentity)))(n>s.byteLength(e))(a.throwError(l.monadThrowStateT(i.monadThrowExceptT(m.monadIdentity)))(new C(e,n))))((function(){return o.discard(o.discardUnit)(l.bindStateT(i.monadExceptT(m.monadIdentity)))(c.put(l.monadStateStateT(i.monadExceptT(m.monadIdentity)))(s.subarray(n)(s.byteLength(e))(e)))((function(){return r.pure(l.applicativeStateT(i.monadExceptT(m.monadIdentity)))(s.subarray(0)(n)(e))}))}))}));var n},A=function(e){return v.map(l.functorStateT(i.functorExceptT(m.functorIdentity)))((n=v.map(v.functorArray)(g.fromInt),function(e){return n(s.byteArrayToIntArray(e))}))(h(e));var n},S=f.foldl(f.foldableArray)((function(e){return function(n){return g.or(g.shl(e)(g.fromInt(8)))(n)}}))(p.zero(g.uintSemiring)),I=v.map(l.functorStateT(i.functorExceptT(m.functorIdentity)))(S)(A(p.one(g.uintSemiring))),T=o.bind(l.bindStateT(i.monadExceptT(m.monadIdentity)))(I)((function(e){var n,t,o=(n=e,{majorType:g.zshr(n)(g.fromInt(5)),additionalInformation:g.and(n)(g.fromInt(31))}),u=(t=g.toInt(o.additionalInformation))<24?r.pure(l.applicativeStateT(i.monadExceptT(m.monadIdentity)))(o.additionalInformation):24===t?v.mapFlipped(l.functorStateT(i.functorExceptT(m.functorIdentity)))(A(g.fromInt(1)))(S):25===t?v.mapFlipped(l.functorStateT(i.functorExceptT(m.functorIdentity)))(A(g.fromInt(2)))(S):26===t?v.mapFlipped(l.functorStateT(i.functorExceptT(m.functorIdentity)))(A(g.fromInt(4)))(S):27===t?v.mapFlipped(l.functorStateT(i.functorExceptT(m.functorIdentity)))(A(g.fromInt(8)))(S):a.throwError(l.monadThrowStateT(i.monadThrowExceptT(m.monadIdentity)))(new w(o.additionalInformation));return 2===g.toInt(o.majorType)?v.map(l.functorStateT(i.functorExceptT(m.functorIdentity)))(y.create)(u):a.throwError(l.monadThrowStateT(i.monadThrowExceptT(m.monadIdentity)))(new b(o.majorType))})),D=(n=o.bind(l.bindStateT(i.monadExceptT(m.monadIdentity)))(T)((function(e){return h(e.value0)})),function(e){return u.runExcept(d.flip(l.evalStateT(i.functorExceptT(m.functorIdentity)))(e)(n))});t.toByteArray=D}(c),function(e){"use strict";e["Ctl.Internal.Cardano.TextEnvelope"]=e["Ctl.Internal.Cardano.TextEnvelope"]||{};var n=e["Ctl.Internal.Cardano.TextEnvelope"],t=e.Aeson,r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Types.ByteArray"],u=e["Ctl.Internal.Types.Cbor"],i=e["Ctl.Internal.Types.Scripts"],c=e["Data.Either"],l=e["Data.Eq"],s=e["Data.Maybe"],f=e["Data.Newtype"],d=function(){function e(){}return e.value=new e,e}(),v=function(){function e(){}return e.value=new e,e}(),m=function(){function e(){}return e.value=new e,e}(),p=function(){function e(){}return e.value=new e,e}(),g=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),y={eq:function(e){return function(n){return e instanceof d&&n instanceof d||e instanceof v&&n instanceof v||e instanceof m&&n instanceof m||e instanceof p&&n instanceof p||e instanceof g&&n instanceof g&&e.value0===n.value0}}},b={decodeAeson:function(e){return o.bind(c.bindEither)(t.decodeAeson(t.decodeAesonString)(e))((function(e){return"PlutusScriptV1"===e?r.pure(c.applicativeEither)(d.value):"PlutusScriptV2"===e?r.pure(c.applicativeEither)(v.value):"PaymentSigningKeyShelley_ed25519"===e?r.pure(c.applicativeEither)(m.value):"StakeSigningKeyShelley_ed25519"===e?r.pure(c.applicativeEither)(p.value):r.pure(c.applicativeEither)(new g(e))}))}};n.PaymentSigningKeyShelleyed25519=m,n.StakeSigningKeyShelleyed25519=p,n.decodeTextEnvelope=function(e){return o.bind(s.bindMaybe)(c.hush(t.parseJsonStringToAeson(e)))((function(e){return o.bind(s.bindMaybe)(c.hush(t.decodeAeson(t.decodeAesonRecord(t.gDecodeAesonCons(t.decodeAesonField1(t.decodeAesonString))(t.gDecodeAesonCons(t.decodeAesonField1(t.decodeAesonString))(t.gDecodeAesonCons(t.decodeAesonField1(b))(t.gDecodeAesonRowNil)({reflectSymbol:function(){return"type"}})()())({reflectSymbol:function(){return"description"}})()())({reflectSymbol:function(){return"cborHex"}})()())())(e)))((function(e){return o.bind(s.bindMaybe)((n=e.cborHex,o.bind(s.bindMaybe)(a.hexToByteArray(n))((function(e){return c.hush(u.toByteArray(f.wrap()(f.wrap()(e))))}))))((function(n){return r.pure(s.applicativeMaybe)(f.wrap()({type_:e.type,description:e.description,bytes:n}))}));var n}))}))},n.plutusScriptV2FromEnvelope=function(e){return(n=v.value,function(e){return function(t){return o.discard(o.discardUnit)(s.bindMaybe)(r.unless(s.applicativeMaybe)(l.eq(y)(t.type_)(n))(s.Nothing.value))((function(){return r.pure(s.applicativeMaybe)(e(t.bytes))}))}})(i.plutusV2Script)(e);var n},n.eqTextEnvelopeType=y}(c),function(e){"use strict";e["Node.Encoding"]=e["Node.Encoding"]||{};var n=e["Node.Encoding"],t=function(){function e(){}return e.value=new e,e}(),r=function(){function e(){}return e.value=new e,e}(),o=function(){function e(){}return e.value=new e,e}(),a=function(){function e(){}return e.value=new e,e}(),u=function(){function e(){}return e.value=new e,e}(),i=function(){function e(){}return e.value=new e,e}(),c=function(){function e(){}return e.value=new e,e}(),l=function(){function e(){}return e.value=new e,e}(),s={show:function(e){if(e instanceof t)return"ASCII";if(e instanceof r)return"UTF8";if(e instanceof o)return"UTF16LE";if(e instanceof a)return"UCS2";if(e instanceof u)return"Base64";if(e instanceof i)return"Latin1";if(e instanceof c)return"Binary";if(e instanceof l)return"Hex";throw new Error("Failed pattern match at Node.Encoding (line 19, column 1 - line 27, column 23): "+[e.constructor.name])}};n.UTF8=r,n.showEncoding=s}(c),function(e){"use strict";e.unsafeRequireFS=t(5174)}(c["Node.FS.Internal"]=c["Node.FS.Internal"]||{}),function(e){"use strict";e["Node.FS.Internal"]=e["Node.FS.Internal"]||{};var n=e["Node.FS.Internal"],t=e["Node.FS.Internal"],r=e["Unsafe.Coerce"].unsafeCoerce;n.mkEffect=r,n.unsafeRequireFS=t.unsafeRequireFS}(c),function(e){"use strict";e["Node.FS.Sync"]=e["Node.FS.Sync"]||{};var n=e["Node.FS.Sync"],t=e["Data.Show"],r=e["Node.Encoding"],o=e["Node.FS.Internal"],a=o.unsafeRequireFS;n.readTextFile=function(e){return function(n){return o.mkEffect((function(o){return a.readFileSync(n,{encoding:t.show(r.showEncoding)(e)})}))}}}(c),function(e){"use strict";e["Ctl.Internal.Wallet.KeyFile"]=e["Ctl.Internal.Wallet.KeyFile"]||{};var n=e["Ctl.Internal.Wallet.KeyFile"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Error.Class"],a=e["Ctl.Internal.Cardano.TextEnvelope"],u=e["Ctl.Internal.Deserialization.Keys"],i=e["Ctl.Internal.Helpers"],c=e["Ctl.Internal.Wallet.Key"],l=e["Data.Eq"],s=e["Data.Functor"],f=e["Data.Maybe"],d=e["Data.Newtype"],v=e["Data.Show"],m=e["Effect.Aff"],p=e["Effect.Class"],g=e["Effect.Exception"],y=e["Node.Encoding"],b=e["Node.FS.Sync"],w=function(e){return function(n){var u;return u=r.bind(m.bindAff)(p.liftEffect(m.monadEffectAff)(b.readTextFile(y.UTF8.value)(e)))((function(e){var u=g.error("Error while decoding key");return o.liftMaybe(m.monadThrowAff)(u)(r.bind(f.bindMaybe)(a.decodeTextEnvelope(e))((function(e){return r.discard(r.discardUnit)(f.bindMaybe)(t.unless(f.applicativeMaybe)(l.eq(a.eqTextEnvelopeType)(e.type_)(n))(f.Nothing.value))((function(){return t.pure(f.applicativeMaybe)(e.bytes)}))})))})),o.catchError(m.monadErrorAff)(u)((function(n){return p.liftEffect(m.monadEffectAff)(g.throw("Unable to load key from file: "+v.show(v.showString)(e)+", error: "+v.show(g.showError)(n)))}))}};n.privatePaymentKeyFromFile=function(e){return r.bind(m.bindAff)(w(e)(a.PaymentSigningKeyShelleyed25519.value))((function(e){return i.liftM(m.monadErrorAff)(g.error("Unable to decode private payment key"))(s.map(f.functorMaybe)(c.PrivatePaymentKey)(u.privateKeyFromBytes(d.wrap()(e))))}))},n.privateStakeKeyFromFile=function(e){return r.bind(m.bindAff)(w(e)(a.StakeSigningKeyShelleyed25519.value))((function(e){return i.liftM(m.monadErrorAff)(g.error("Unable to decode private stake key"))(s.map(f.functorMaybe)(c.PrivateStakeKey)(u.privateKeyFromBytes(d.wrap()(e))))}))}}(c),function(e){"use strict";e["Ctl.Internal.Wallet.Spec"]=e["Ctl.Internal.Wallet.Spec"]||{};var n=e["Ctl.Internal.Wallet.Spec"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Ctl.Internal.Wallet"],a=e["Ctl.Internal.Wallet.KeyFile"],u=e["Data.Traversable"],i=e["Effect.Aff"],c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),f=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),d=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),v=function(){function e(){}return e.value=new e,e}(),m=function(){function e(){}return e.value=new e,e}(),p=function(){function e(){}return e.value=new e,e}(),g=function(){function e(){}return e.value=new e,e}(),y=function(){function e(){}return e.value=new e,e}(),b=function(){function e(){}return e.value=new e,e}();n.ConnectToNami=v,n.ConnectToFlint=p,n.ConnectToEternl=g,n.ConnectToLode=y,n.mkWalletBySpec=function(e){if(e instanceof d)return r.bind(i.bindAff)(function(){if(e.value0 instanceof s)return a.privatePaymentKeyFromFile(e.value0.value0);if(e.value0 instanceof f)return t.pure(i.applicativeAff)(e.value0.value0);throw new Error("Failed pattern match at Ctl.Internal.Wallet.Spec (line 62, column 26 - line 65, column 45): "+[e.value0.constructor.name])}())((function(n){return r.bind(i.bindAff)(u.for(i.applicativeAff)(u.traversableMaybe)(e.value1)((function(e){if(e instanceof c)return a.privateStakeKeyFromFile(e.value0);if(e instanceof l)return t.pure(i.applicativeAff)(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Wallet.Spec (line 66, column 45 - line 68, column 43): "+[e.constructor.name])})))((function(e){return t.pure(i.applicativeAff)(o.mkKeyWallet(n)(e))}))}));if(e instanceof v)return o.mkWalletAff(o.NamiWallet.value);if(e instanceof m)return o.mkWalletAff(o.GeroWallet.value);if(e instanceof p)return o.mkWalletAff(o.FlintWallet.value);if(e instanceof g)return o.mkWalletAff(o.EternlWallet.value);if(e instanceof y)return o.mkWalletAff(o.LodeWallet.value);if(e instanceof b)return o.mkWalletAff(o.NuFiWallet.value);throw new Error("Failed pattern match at Ctl.Internal.Wallet.Spec (line 60, column 18 - line 75, column 42): "+[e.constructor.name])}}(c),function(e){"use strict";e.copyRecord=function(e){var n={};for(var t in e)({}).hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n}}(c["Record.Builder"]=c["Record.Builder"]||{}),function(e){"use strict";e["Record.Builder"]=e["Record.Builder"]||{};var n=e["Record.Builder"],t=e["Record.Builder"],r=e["Control.Semigroupoid"],o=e["Record.Unsafe.Union"],a=r.semigroupoidFn;n.build=function(e){return function(n){return e(t.copyRecord(n))}},n.merge=function(){return function(){return function(e){return function(n){return o.unsafeUnionFn(e,n)}}}},n.semigroupoidBuilder=a}(c),function(e){"use strict";e["Ctl.Internal.Contract.Monad"]=e["Ctl.Internal.Contract.Monad"]||{};var n,t=e["Ctl.Internal.Contract.Monad"],r=e["Control.Applicative"],o=e["Control.Apply"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Control.Monad.Logger.Trans"],c=e["Control.Monad.Reader.Class"],l=e["Control.Monad.Reader.Trans"],s=e["Control.Parallel.Class"],f=e["Control.Semigroupoid"],d=e["Ctl.Internal.Contract.QueryBackend"],v=e["Ctl.Internal.Helpers"],m=e["Ctl.Internal.JsWebSocket"],p=e["Ctl.Internal.Logging"],g=e["Ctl.Internal.QueryM"],y=e["Ctl.Internal.QueryM.Kupo"],b=e["Ctl.Internal.Serialization.Address"],w=e["Ctl.Internal.Service.Blockfrost"],C=e["Ctl.Internal.Service.Error"],h=e["Ctl.Internal.Types.Transaction"],A=e["Ctl.Internal.Types.UsedTxOuts"],S=e["Ctl.Internal.Wallet"],I=e["Ctl.Internal.Wallet.Spec"],T=e["Data.Bifunctor"],D=e["Data.Boolean"],F=e["Data.Either"],E=e["Data.Eq"],x=e["Data.Foldable"],M=e["Data.Function"],R=e["Data.Functor"],P=e["Data.HeytingAlgebra"],k=e["Data.Maybe"],B=e["Data.Newtype"],N=e["Data.Show"],L=e["Data.Traversable"],_=e["Data.Unit"],U=e.Effect,H=e["Effect.Aff"],q=e["Effect.Aff.Class"],O=e["Effect.Class"],V=e["Effect.Exception"],W=e["Record.Builder"],K=l.monadThrowReaderT(H.monadThrowAff),z=l.monadErrorReaderT(H.monadErrorAff),J=l.monadEffectReader(H.monadEffectAff),G=l.monadReaderT(H.monadAff),j=l.monadAskReaderT(H.monadAff),Q=q.monadAffReader(q.monadAffAff),Z=l.functorReaderT(H.functorAff),X=l.bindReaderT(H.bindAff),Y={log:function(e){return a.bind(X)(c.ask(j))((function(n){var t=k.fromMaybe(v.logWithLevel(H.monadEffectAff))(n.customLogger);return q.liftAff(Q)(t(n.logLevel)(e))}))},MonadEffect0:function(){return J}},$=l.applicativeReaderT(H.applicativeParAff),ee={parallel:function(e){return s.parallel(s.monadParReaderT(H.parallelAff))(e)},sequential:function(e){return s.sequential(s.monadParReaderT(H.parallelAff))(e)},Monad0:function(){return G},Applicative1:function(){return $}},ne=l.applicativeReaderT(H.applicativeAff),te=l.alternativeReaderT(H.alternativeParAff),re=(n=l.withReaderT((function(e){return e.usedTxOuts})),function(e){return n(e)}),oe=function(e){return function(n){var t=M.flip(l.runReaderT)(function(e){return function(n){return{config:{kupoConfig:n.kupoConfig,logLevel:e.logLevel,customLogger:e.customLogger,suppressLogs:e.suppressLogs},runtime:{ogmiosWs:n.ogmios.ws}}}}(e)(n)),r=B.unwrap();return function(e){return t(r(e))}}},ae=function(e){return function(n){return a.bind(H.bindAff)(O.liftEffect(H.monadEffectAff)(p.setupLogs(e.logLevel)(e.customLogger)))((function(t){var c=function(){if(e.suppressLogs)return new k.Just((n=R.map(R.functorFn)(O.liftEffect(H.monadEffectAff)),function(e){return n(t.addLogEntry(e))}));var n;if(D.otherwise)return e.customLogger;throw new Error("Failed pattern match at Ctl.Internal.Contract.Monad (line 321, column 5 - line 321, column 60): "+[])}();return a.bind(H.bindAff)(function(e){var n,t,u=p.mkLogger(e.logLevel)(e.customLogger),c={networkId:e.networkId,logLevel:e.logLevel,walletSpec:e.walletSpec,customLogger:e.customLogger,suppressLogs:e.suppressLogs,hooks:e.hooks},m=L.traverse(L.traversableMaybe)(H.applicativeAff)(I.mkWalletBySpec)(e.walletSpec);return a.discard(a.discardUnit)(H.bindAff)(x.for_(H.applicativeAff)(x.foldableMaybe)(e.hooks.beforeInit)((n=R.void(H.functorAff),t=O.liftEffect(H.monadEffectAff),function(e){return n(t(V.try(e)))})))((function(){return a.bind(H.bindAff)(A.newUsedTxOuts(H.monadEffectAff))((function(n){return a.bind(H.bindAff)(s.sequential(H.parallelAff)(o.apply(H.applyParAff)(R.map(H.functorParAff)((function(e){return function(t){return f.composeFlipped(W.semigroupoidBuilder)(e)(f.composeFlipped(W.semigroupoidBuilder)(t)(W.merge()()({usedTxOuts:n})))}}))(s.parallel(H.parallelAff)(a.bind(H.bindAff)(function(e){var n=function(n){var t,o,u,i=(t=R.map(H.functorAff)(F.isRight),o=y.isTxConfirmedAff(n.kupoConfig),u=B.wrap(),function(e){return t(o(u(e)))});return a.bind(H.bindAff)(g.mkOgmiosWebSocketAff(i)(e)(n.ogmiosConfig))((function(e){return r.pure(H.applicativeAff)({ogmios:{config:n.ogmiosConfig,ws:e},kupoConfig:n.kupoConfig})}))};return function(e){if(e instanceof d.CtlBackendParams)return R.map(H.functorAff)(M.flip(d.CtlBackend.create)(e.value1))(n(e.value0));if(e instanceof d.BlockfrostBackendParams)return R.map(H.functorAff)(d.BlockfrostBackend.create(e.value0))(L.traverse(L.traversableMaybe)(H.applicativeAff)(n)(e.value1));throw new Error("Failed pattern match at Ctl.Internal.Contract.Monad (line 221, column 23 - line 225, column 78): "+[e.constructor.name])}}(u)(e.backendParams))((function(n){return a.bind(H.bindAff)(function(e){var n,t,r,u=a.bindFlipped(i.bindLoggerT(l.monadReaderT(H.monadAff)))((t=v.liftEither(i.monadErrorLoggerT(l.monadErrorReaderT(H.monadErrorAff))),r=T.lmap(T.bifunctorEither)((n=N.show(C.showClientError),function(e){return V.error(n(e))})),function(e){return t(r(e))})),c=p.mkLogger(e.logLevel)(e.customLogger),s=k.fromMaybe(v.logWithLevel(H.monadEffectAff))(e.customLogger)(e.logLevel);return function(e){if(e instanceof d.CtlBackend)return o.apply(H.applyAff)(R.map(H.functorAff)((function(e){return function(n){return{pparams:e,systemStart:n}}}))(R.map(H.functorAff)(B.unwrap())(g.getProtocolParametersAff(e.value0.ogmios.ws)(c))))(g.getSystemStartAff(e.value0.ogmios.ws)(c));if(e instanceof d.BlockfrostBackend)return w.runBlockfrostServiceM(s)(e.value0)(o.apply(i.applyLoggerT(l.monadReaderT(H.monadAff)))(R.map(i.functorLoggerT(l.functorReaderT(H.functorAff)))((function(e){return function(n){return{pparams:e,systemStart:n}}}))(u(w.getProtocolParameters)))(u(w.getSystemStart)));throw new Error("Failed pattern match at Ctl.Internal.Contract.Monad (line 248, column 29 - line 257, column 54): "+[e.constructor.name])}}(e)(n))((function(e){return r.pure(H.applicativeAff)(W.merge()()({backend:n,ledgerConstants:e}))}))})))))(s.parallel(H.parallelAff)(a.bind(H.bindAff)(m)((function(e){return r.pure(H.applicativeAff)(W.merge()()({wallet:e}))}))))))((function(e){return r.pure(H.applicativeAff)(W.build(e)(c))}))}))}))}({backendParams:e.backendParams,networkId:e.networkId,logLevel:e.logLevel,walletSpec:e.walletSpec,customLogger:c,suppressLogs:e.suppressLogs,hooks:e.hooks}))((function(e){return a.discard(a.discardUnit)(H.bindAff)(x.for_(H.applicativeAff)(x.foldableMaybe)(e.wallet)((i=e.networkId,c=function(e){return 0===e?r.pure(H.applicativeAff)(b.TestnetId.value):1===e?r.pure(H.applicativeAff)(b.MainnetId.value):O.liftEffect(H.monadEffectAff)(V.throw("Unknown network id"))},l=function(e){return r.unless(H.applicativeAff)(E.eq(b.eqNetworkId)(i)(e))(O.liftEffect(H.monadEffectAff)(V.throw("The networkId that is specified is not equal to the one from wallet. The wallet is using "+N.show(b.showNetworkId)(e)+" while "+N.show(b.showNetworkId)(i)+" is specified in the config.")))},S.actionBasedOnWallet(q.monadAffAff)((function(e){return a.composeKleisliFlipped(H.bindAff)(l)(a.composeKleisliFlipped(H.bindAff)(c)(e.getNetworkId))}))(r.pure(r.applicativeFn)(r.pure(H.applicativeAff)(_.unit))))))((function(){return a.bind(H.bindAff)(H.attempt(M.flip(H.finally)(H.supervise(n(e)))(function(e){var n,t=(n=o.apply(o.applyFn)(R.map(R.functorFn)(o.applySecond(U.applyEffect))(m._wsFinalize))(m._wsClose),function(e){return n(g.underlyingWebSocket(e))});return O.liftEffect(H.monadEffectAff)(x.traverse_(U.applicativeEffect)(x.foldableMaybe)((function(e){return t(e.ogmios.ws)}))(d.getCtlBackend(e.backend)))}(e))))((function(n){return O.liftEffect(H.monadEffectAff)(function(){if(n instanceof F.Left)return function(){return x.for_(U.applicativeEffect)(x.foldableMaybe)(e.hooks.onError)((function(e){return R.void(U.functorEffect)(V.try(e(n.value0)))}))(),r.when(U.applicativeEffect)(e.suppressLogs)(t.printLogs)(),u.throwError(u.monadThrowEffect)(n.value0)()};if(n instanceof F.Right)return function(){var t;return x.for_(U.applicativeEffect)(x.foldableMaybe)(e.hooks.onSuccess)((t=R.void(U.functorEffect),function(e){return t(V.try(e))}))(),n.value0};throw new Error("Failed pattern match at Ctl.Internal.Contract.Monad (line 331, column 16 - line 338, column 15): "+[n.constructor.name])}())}))}));var i,c,l}))}))}};t.runContract=function(e){return function(n){return ae(e)((function(e){return(t=e,r=M.flip(l.runReaderT)(t),o=B.unwrap(),function(e){return r(o(e))})(n);var t,r,o}))}},t.runQueryM=oe,t.wrapQueryM=function(e){return a.bind(X)(c.asks(j)((function(e){return e.backend})))((function(n){return a.bind(X)(v.liftM(z)(V.error("Operation only supported on CTL backend"))(d.getCtlBackend(n)))((function(n){return a.bind(X)(c.ask(j))((function(t){return q.liftAff(Q)(oe(t)(n)(e))}))}))}))},t.filterLockedUtxos=function(e){return re(M.flip(v.filterMapWithKeyM(h.ordTransactionInput)(l.monadReaderT(H.monadAff)))(e)((function(e){return function(n){return R.map(l.functorReaderT(H.functorAff))(P.not(P.heytingAlgebraBoolean))(A.isTxOutRefUsed(l.monadAskReaderT(H.monadAff))(l.monadEffectReader(H.monadEffectAff))(B.unwrap()(e)))}})))},t.functorContract=Z,t.applicativeContract=ne,t.bindContract=X,t.monadContract=G,t.monadEffectContract=J,t.monadAffContract=Q,t.monadAskContractEnvContra=j,t.monadThrowErrorContract=K,t.monadErrorErrorContract=z,t.monadLoggerContract=Y,t.parallelParContractContra=ee,t.alternativeParContract=te}(c),function(e){"use strict";e["Contract.Log"]=e["Contract.Log"]||{};var n=e["Contract.Log"],t=e["Control.Monad.Logger.Class"],r=e["Data.Map.Internal"];n["logDebug'"]=function(e){return t.debug(e)(r.empty)},n["logInfo'"]=function(e){return t.info(e)(r.empty)},n["logWarn'"]=function(e){return t.warn(e)(r.empty)},n["logError'"]=function(e){return t.error(e)(r.empty)}}(c),function(e){const n=t(8002);let r;t(4288),t(466),r=t(1164),r=t(6359)(r),e.blake2b256Hash=e=>n.blake2b(e,null,32),e.hashPlutusData=e=>r.hash_plutus_data(e),e.hashPlutusScript=e=>e.hash()}(c["Ctl.Internal.Hashing"]=c["Ctl.Internal.Hashing"]||{}),function(e){"use strict";e["Ctl.Internal.Hashing"]=e["Ctl.Internal.Hashing"]||{};var n,t,r,o,a,u,i,c=e["Ctl.Internal.Hashing"],l=e["Ctl.Internal.Hashing"],s=e["Ctl.Internal.Cardano.Types.ScriptRef"],f=e["Ctl.Internal.Deserialization.Transaction"],d=e["Ctl.Internal.Serialization.Hash"],v=e["Ctl.Internal.Serialization.NativeScript"],m=e["Ctl.Internal.Serialization.PlutusData"],p=e["Ctl.Internal.Serialization.PlutusScript"],g=e["Ctl.Internal.Serialization.ToBytes"],y=e["Data.Newtype"],b=(n=y.wrap(),t=y.unwrap(),r=g.toBytes(),function(e){return n(l.blake2b256Hash(t(r(f._txBody(e)))))}),w=function(e){return l.hashPlutusScript(p.convertPlutusScript(e))},C=(o=y.wrap(),a=y.unwrap(),u=g.toBytes(),i=y.unwrap(),function(e){return o(a(u(l.hashPlutusData(m.convertPlutusData(i(e))))))});c.datumHash=C,c.plutusScriptHash=w,c.transactionHash=b,c.scriptRefHash=function(e){if(e instanceof s.PlutusScriptRef)return w(e.value0);if(e instanceof s.NativeScriptRef)return d.nativeScriptHash(v.convertNativeScript(e.value0));throw new Error("Failed pattern match at Ctl.Internal.Hashing (line 86, column 1 - line 86, column 41): "+[e.constructor.name])}}(c),function(e){"use strict";e["Ctl.Internal.QueryM.CurrentEpoch"]=e["Ctl.Internal.QueryM.CurrentEpoch"]||{};var n=e["Ctl.Internal.QueryM.CurrentEpoch"],t=e["Ctl.Internal.QueryM"],r=e["Ctl.Internal.QueryM.Ogmios"],o=e["Data.Unit"],a=t.mkOgmiosRequest(r.queryCurrentEpochCall)((function(e){return e.currentEpoch}))(o.unit);n.getCurrentEpoch=a}(c),function(e){"use strict";e["Ctl.Internal.QueryM.EraSummaries"]=e["Ctl.Internal.QueryM.EraSummaries"]||{};var n=e["Ctl.Internal.QueryM.EraSummaries"],t=e["Ctl.Internal.QueryM"],r=e["Ctl.Internal.QueryM.Ogmios"],o=e["Data.Functor"],a=e["Data.Newtype"],u=e["Data.Unit"],i=e["Effect.Aff"],c=o.map(t.functorQueryMT(i.functorAff))(a.unwrap())(t.mkOgmiosRequest(r.queryEraSummariesCall)((function(e){return e.eraSummaries}))(u.unit));n.getEraSummaries=c}(c),function(e){"use strict";e["Ctl.Internal.QueryM.Pools"]=e["Ctl.Internal.QueryM.Pools"]||{};var n=e["Ctl.Internal.QueryM.Pools"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Ctl.Internal.QueryM"],a=e["Ctl.Internal.QueryM.Ogmios"],u=e["Ctl.Internal.Serialization.Hash"],i=e["Ctl.Internal.Types.ByteArray"],c=e["Data.Map.Internal"],l=e["Data.Newtype"],s=e["Data.Ord"],f=e["Data.Unit"],d=e["Effect.Aff"],v=o.mkOgmiosRequest(a.queryPoolIdsCall)((function(e){return e.poolIds}))(f.unit);n.getPoolIds=v,n.getPubKeyHashDelegationsAndRewards=function(e){var n=u.ed25519KeyHashToBech32Unsafe("stake_vkh")(l.unwrap()(l.unwrap()(e))),f=i.byteArrayToHex(l.unwrap()(u.ed25519KeyHashToBytes(l.unwrap()(l.unwrap()(e)))));return r.bind(o.bindQueryMT(d.bindAff))(o.mkOgmiosRequest(a.queryDelegationsAndRewards)((function(e){return e.delegationsAndRewards}))([n]))((function(e){return t.pure(o.applicativeQueryMT(d.applicativeAff))(c.lookup(s.ordString)(f)(e))}))},n.getValidatorHashDelegationsAndRewards=function(e){var n=u.scriptHashToBech32Unsafe("script")(l.unwrap()(e)),f=i.byteArrayToHex(l.unwrap()(u.scriptHashToBytes(l.unwrap()(e))));return r.bind(o.bindQueryMT(d.bindAff))(o.mkOgmiosRequest(a.queryDelegationsAndRewards)((function(e){return e.delegationsAndRewards}))([n]))((function(e){return t.pure(o.applicativeQueryMT(d.applicativeAff))(c.lookup(s.ordString)(f)(e))}))}}(c),function(e){"use strict";e["Ctl.Internal.Contract.QueryHandle"]=e["Ctl.Internal.Contract.QueryHandle"]||{};var n=e["Ctl.Internal.Contract.QueryHandle"],t=e.Aeson,r=e["Contract.Log"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Control.Monad.Logger.Trans"],c=e["Control.Monad.Reader.Class"],l=e["Control.Monad.Reader.Trans"],s=e["Ctl.Internal.Contract.Monad"],f=e["Ctl.Internal.Contract.QueryBackend"],d=e["Ctl.Internal.Hashing"],v=e["Ctl.Internal.Helpers"],m=e["Ctl.Internal.QueryM"],p=e["Ctl.Internal.QueryM.CurrentEpoch"],g=e["Ctl.Internal.QueryM.EraSummaries"],y=e["Ctl.Internal.QueryM.Kupo"],b=e["Ctl.Internal.QueryM.Ogmios"],w=e["Ctl.Internal.QueryM.Pools"],C=e["Ctl.Internal.Serialization"],h=e["Ctl.Internal.Serialization.ToBytes"],A=e["Ctl.Internal.Service.Blockfrost"],S=e["Ctl.Internal.Service.Error"],I=e["Ctl.Internal.Types.Transaction"],T=e["Data.Either"],D=e["Data.Functor"],F=e["Data.Map.Internal"],E=e["Data.Maybe"],x=e["Data.Newtype"],M=e["Data.Show"],R=e["Effect.Aff"],P=e["Effect.Class"],k=e["Effect.Exception"],B=D.mapFlipped(s.functorContract)(c.ask(s.monadAskContractEnvContra))((function(e){if(e.backend instanceof f.CtlBackend)return function(e){return function(n){var u,i=s.runQueryM(e)(n);return{getDatumByHash:function(e){return i(y.getDatumByHash(e))},getScriptByHash:function(e){return i(y.getScriptByHash(e))},getUtxoByOref:function(e){return i(y.getUtxoByOref(e))},doesTxExist:(u=D.map(m.functorQueryMT(R.functorAff))(D.map(T.functorEither)(E.isJust)),function(e){return i(u(y.isTxConfirmed(e)))}),getTxMetadata:function(e){return i(y.getTxMetadata(e))},utxosAt:function(e){return i(y.utxosAt(e))},getChainTip:D.map(R.functorAff)(T.Right.create)(i(m.getChainTip)),getCurrentEpoch:i(p.getCurrentEpoch),submitTx:function(e){return i(a.bind(m.bindQueryMT(R.bindAff))(P.liftEffect(m.monadEffectQueryMTAff)(C.convertTransaction(e)))((function(e){var n=d.transactionHash(e);return a.discard(a.discardUnit)(m.bindQueryMT(R.bindAff))(r["logDebug'"](m.monadLoggerQueryMTAff)("Pre-calculated tx hash: "+M.show(I.showTransactionHash)(n)))((function(){var r=h.toBytes()(e);return a.bind(m.bindQueryMT(R.bindAff))(m.submitTxOgmios(x.unwrap()(n))(r))((function(e){if(e instanceof b.SubmitTxSuccess)return o.pure(m.applicativeQueryMT(R.applicativeAff))(o.pure(T.applicativeEither)(x.wrap()(e.value0)));if(e instanceof b.SubmitFail)return o.pure(m.applicativeQueryMT(R.applicativeAff))(new T.Left(new S.ClientOtherError(M.show(M.showArray(t.showAeson))(e.value0))));throw new Error("Failed pattern match at Ctl.Internal.Contract.QueryHandle (line 124, column 7 - line 126, column 68): "+[e.constructor.name])}))}))})))},evaluateTx:function(e){return function(n){return i(a.bind(m.bindQueryMT(R.bindAff))(D.map(m.functorQueryMT(R.functorAff))(h.toBytes())(P.liftEffect(m.monadEffectQueryMTAff)(C.convertTransaction(e))))((function(e){return m.evaluateTxOgmios(e)(n)})))}},getEraSummaries:D.map(R.functorAff)(T.Right.create)(i(g.getEraSummaries)),getPoolIds:D.map(R.functorAff)(T.Right.create)(i(w.getPoolIds)),getPubKeyHashDelegationsAndRewards:function(e){return function(e){return D.map(R.functorAff)(T.Right.create)(i(w.getPubKeyHashDelegationsAndRewards(e)))}},getValidatorHashDelegationsAndRewards:function(e){return function(e){return D.map(R.functorAff)(T.Right.create)(i(w.getValidatorHashDelegationsAndRewards(e)))}}}}}(e)(e.backend.value0);if(e.backend instanceof f.BlockfrostBackend)return function(e){return function(n){var t=A.runBlockfrostServiceM(E.fromMaybe(v.logWithLevel(R.monadEffectAff))(e.customLogger)(e.logLevel))(n);return{getDatumByHash:function(e){return t(A.getDatumByHash(e))},getScriptByHash:function(e){return t(A.getScriptByHash(e))},getUtxoByOref:function(e){return t(A.getUtxoByOref(e))},doesTxExist:function(e){return t(A.doesTxExist(e))},getTxMetadata:function(e){return t(A.getTxMetadata(e))},utxosAt:function(e){return t(A.utxosAt(e))},getChainTip:t(A.getChainTip),getCurrentEpoch:a.bind(R.bindAff)(t(A.getCurrentEpoch))((function(e){if(e instanceof T.Right)return o.pure(R.applicativeAff)(x.wrap()(e.value0));if(e instanceof T.Left)return u.throwError(R.monadThrowAff)(k.error(M.show(S.showClientError)(e.value0)));throw new Error("Failed pattern match at Ctl.Internal.Contract.QueryHandle (line 156, column 61 - line 158, column 50): "+[e.constructor.name])})),submitTx:function(e){return t(A.submitTx(e))},evaluateTx:function(e){return function(n){return t(a.discard(a.discardUnit)(i.bindLoggerT(l.monadReaderT(R.monadAff)))(o.unless(i.applicativeLoggerT(l.monadReaderT(R.monadAff)))(F.isEmpty(x.unwrap()(n)))(r["logWarn'"](i.monadLoggerLoggerT(l.monadEffectReader(R.monadEffectAff)))("Blockfrost does not support explicit additional utxos")))((function(){return A.evaluateTx(e)})))}},getEraSummaries:t(A.getEraSummaries),getPoolIds:t(A.getPoolIds),getPubKeyHashDelegationsAndRewards:function(e){return function(n){return t(A.getPubKeyHashDelegationsAndRewards(e)(n))}},getValidatorHashDelegationsAndRewards:function(e){return function(n){return t(A.getValidatorHashDelegationsAndRewards(e)(n))}}}}}(e)(e.backend.value0);throw new Error("Failed pattern match at Ctl.Internal.Contract.QueryHandle (line 102, column 3 - line 106, column 58): "+[e.backend.constructor.name])}));n.getQueryHandle=B}(c),function(e){"use strict";e["Ctl.Internal.Contract"]=e["Ctl.Internal.Contract"]||{};var n=e["Ctl.Internal.Contract"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Reader.Class"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Contract.QueryHandle"],i=e["Ctl.Internal.Service.Error"],c=e["Data.Either"],l=e["Data.Show"],s=e["Effect.Aff"],f=e["Effect.Aff.Class"],d=e["Effect.Class"],v=e["Effect.Exception"],m=o.asks(a.monadAskContractEnvContra)((function(e){return e.ledgerConstants.pparams})),p=r.bind(a.bindContract)(u.getQueryHandle)((function(e){return f.liftAff(a.monadAffContract)(r.bind(s.bindAff)(e.getChainTip)(c.either((n=d.liftEffect(s.monadEffectAff),o=l.show(i.showClientError),function(e){return n(v.throw(o(e)))}))(t.pure(s.applicativeAff))));var n,o}));n.getChainTip=p,n.getProtocolParameters=m}(c),function(e){"use strict";e["Ctl.Internal.Contract.Wallet"]=e["Ctl.Internal.Contract.Wallet"]||{};var n,t,r,o,a,u=e["Ctl.Internal.Contract.Wallet"],i=e["Control.Applicative"],c=e["Control.Bind"],l=e["Control.Monad.Reader.Class"],s=e["Ctl.Internal.Cardano.Types.Value"],f=e["Ctl.Internal.Contract"],d=e["Ctl.Internal.Contract.Monad"],v=e["Ctl.Internal.Contract.QueryHandle"],m=e["Ctl.Internal.Helpers"],p=e["Ctl.Internal.Serialization.Address"],g=e["Ctl.Internal.Types.Transaction"],y=e["Ctl.Internal.Wallet"],b=e["Data.Array"],w=e["Data.BigInt"],C=e["Data.Either"],h=e["Data.Foldable"],A=e["Data.Functor"],S=e["Data.Map.Internal"],I=e["Data.Maybe"],T=e["Data.Monoid"],D=e["Data.Newtype"],F=e["Data.Ord"],E=e["Data.Traversable"],x=e["Data.Tuple"],M=e["Data.UInt"],R=e["Effect.Aff"],P=e["Effect.Aff.Class"],k=e["Effect.Class"],B=e["Effect.Exception"],N=l.asks(d.monadAskContractEnvContra)((function(e){return e.wallet})),L=c.bind(d.bindContract)(A.map(d.functorContract)(D.unwrap())(f.getProtocolParameters))((function(e){return c.bind(d.bindContract)(c.bind(d.bindContract)(N)(I.maybe(i.pure(d.applicativeContract)(I.Nothing.value))(y.actionBasedOnWallet(d.monadAffContract)((function(e){return e.getCollateral}))((function(n){return c.bind(d.bindContract)(v.getQueryHandle)((function(t){return c.bind(d.bindContract)(l.asks(d.monadAskContractEnvContra)((function(e){return e.networkId})))((function(r){var o,a=D.unwrap()(n).address(r);return c.bind(d.bindContract)(c.bind(d.bindContract)(A.mapFlipped(d.functorContract)(P.liftAff(d.monadAffContract)(t.utxosAt(a)))((o=I.fromMaybe(S.empty),function(e){return o(C.hush(e))})))(d.filterLockedUtxos))((function(t){return k.liftEffect(d.monadEffectContract)(D.unwrap()(n).selectCollateral(e.coinsPerUtxoUnit)(M.toInt(e.maxCollateralInputs))(t))}))}))}))})))))((function(n){var t=function(e){return D.unwrap()(D.unwrap()(e).output).amount},r=s.lovelaceValueOf(w.fromInt(5e6)),o=A.mapFlipped(I.functorMaybe)(n)((function(e){return h.foldl(h.foldableArray)((function(e){return function(n){return s.geq(b.foldMap(s.monoidValue)(t)(e))(r)?e:b.cons(n)(e)}}))([])(e)}));return c.discard(c.discardUnit)(d.bindContract)(h.for_(d.applicativeContract)(h.foldableMaybe)(o)((function(n){var t=F.greaterThan(M.uintOrd)(M.fromInt(b.length(n)))(e.maxCollateralInputs);return i.when(d.applicativeContract)(t)(k.liftEffect(d.monadEffectContract)(B.throw("Wallet returned too many UTxOs as collateral. This is likely a bug in the wallet.")))})))((function(){return i.pure(d.applicativeContract)(o)}))}))})),_=function(e){return c.bind(d.bindContract)(m.liftedM(d.monadErrorErrorContract)(B.error("No wallet set"))(N))((function(n){return e(n)}))},U=A.map(d.functorContract)(h.fold(h.foldableMaybe)(T.monoidArray))(_(y.actionBasedOnWallet(d.monadAffContract)((function(e){return e.getWalletAddresses}))((function(e){return c.bind(d.bindContract)(l.asks(d.monadAskContractEnvContra)((function(e){return e.networkId})))((function(n){return i.pure(d.applicativeContract)(i.pure(I.applicativeMaybe)(b.singleton(D.unwrap()(e).address(n))))}))})))),H=(t=S.fromFoldable(g.ordTransactionInput)(h.foldableArray),r=A.map(A.functorArray)((n=D.unwrap(),function(e){return t=n(e),new x.Tuple(t.input,t.output);var t})),o=function(e){return t(r(e))},c.bind(d.bindContract)(v.getQueryHandle)((function(e){return c.bind(d.bindContract)(N)((n=A.map(d.functorContract)(c.join(I.bindMaybe)),t=E.traverse(E.traversableMaybe)(d.applicativeContract)(y.actionBasedOnWallet(d.monadAffContract)((function(e){return function(n){return A.mapFlipped(R.functorAff)(e.getUtxos(n))(A.map(I.functorMaybe)(o))}}))((function(n){return c.bind(d.bindContract)(A.mapFlipped(d.functorContract)(U)(b.head))((function(n){return A.map(d.functorContract)(c.join(I.bindMaybe))(E.for(d.applicativeContract)(E.traversableMaybe)(n)((t=A.map(d.functorContract)(C.hush),r=P.liftAff(d.monadAffContract),function(n){return t(r(e.utxosAt(n)))})));var t,r}))}))),function(e){return n(t(e))}));var n,t}))),q=A.map(d.functorContract)(b.catMaybes)(c.bind(d.bindContract)(U)(E.traverse(E.traversableArray)(d.applicativeContract)((function(e){return c.bind(d.bindContract)(m.liftM(d.monadErrorErrorContract)(B.error("Unable to get payment credential from Address"))(p.addressPaymentCred(e)))((function(e){return i.pure(d.applicativeContract)(A.mapFlipped(I.functorMaybe)(p.stakeCredentialToKeyHash(e))(D.wrap()))}))})))),O=A.map(d.functorContract)(A.map(A.functorArray)(D.wrap()))(q),V=(a=function(e){return c.bind(I.bindMaybe)(p.baseAddressFromAddress(e))((function(e){return A.map(I.functorMaybe)((n=D.wrap(),t=D.wrap(),function(e){return n(t(e))}))(p.stakeCredentialToKeyHash(p.baseAddressDelegationCred(e)));var n,t}))},c.bind(d.bindContract)(U)((function(e){return i.pure(d.applicativeContract)(A.map(A.functorArray)(a)(e))}))),W=_(y.actionBasedOnWallet(d.monadAffContract)((function(e){return e.getChangeAddress}))((function(e){return c.bind(d.bindContract)(l.asks(d.monadAskContractEnvContra)((function(e){return e.networkId})))((function(n){return i.pure(d.applicativeContract)(i.pure(I.applicativeMaybe)(D.unwrap()(e).address(n)))}))})));u.getChangeAddress=W,u.getWalletAddresses=U,u.ownPaymentPubKeyHashes=O,u.ownStakePubKeysHashes=V,u.withWallet=_,u.getWalletCollateral=L,u.getWalletUtxos=H}(c),function(e){"use strict";e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"]=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"]||{};var n=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"];n.getIndexWithLabelConsI1=function(){return function(){return function(e){return function(n){return{IsSymbol0:function(){return e}}}}}},n.getIndexWithLabelConsI=function(e){return function(){return function(){return function(n){return function(n){return{IsSymbol0:e.IsSymbol0}}}}}}}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.Credential"]=e["Ctl.Internal.Plutus.Types.Credential"]||{};var n=e["Ctl.Internal.Plutus.Types.Credential"],t=e["Ctl.Internal.FromData"],r=e["Ctl.Internal.Serialization.Address"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.TypeLevel.Nat"],u=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],i=e["Ctl.Internal.Types.PubKeyHash"],c=e["Ctl.Internal.Types.Scripts"],l=e["Data.Generic.Rep"],s=e["Data.Show"],f=e["Data.Show.Generic"],d=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),v=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),m=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),p=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),g={to:function(e){if(e instanceof l.Inl)return new m(e.value0);if(e instanceof l.Inr)return new p(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.Credential (line 111, column 1 - line 111, column 44): "+[e.constructor.name])},from:function(e){if(e instanceof m)return new l.Inl(e.value0);if(e instanceof p)return new l.Inr(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.Credential (line 111, column 1 - line 111, column 44): "+[e.constructor.name])}},y={to:function(e){if(e instanceof l.Inl)return new d(e.value0);if(e instanceof l.Inr)return new v(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.Credential (line 59, column 1 - line 59, column 37): "+[e.constructor.name])},from:function(e){if(e instanceof d)return new l.Inl(e.value0);if(e instanceof v)return new l.Inr(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.Credential (line 59, column 1 - line 59, column 37): "+[e.constructor.name])}},b={show:f.genericShow(y)(f.genericShowSum(f.genericShowConstructor(f.genericShowArgsArgument(i.showPubKeyHash))({reflectSymbol:function(){return"PubKeyCredential"}}))(f.genericShowConstructor(f.genericShowArgsArgument(c.showValidatorHash))({reflectSymbol:function(){return"ScriptCredential"}})))},w={show:f.genericShow(g)(f.genericShowSum(f.genericShowConstructor(f.genericShowArgsArgument(b))({reflectSymbol:function(){return"StakingHash"}}))(f.genericShowConstructor(f.genericShowArgsArgument(s.showRecord()(s.showRecordFieldsCons({reflectSymbol:function(){return"certIx"}})(s.showRecordFieldsCons({reflectSymbol:function(){return"slot"}})(s.showRecordFieldsCons({reflectSymbol:function(){return"txIx"}})(s.showRecordFieldsNil)(r.showTransactionIndex))(r.showSlot))(r.showCertificateIndex))))({reflectSymbol:function(){return"StakingPtr"}})))},C={toData:o.genericToData(y)(o.toDataWithSchemaSum(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PubKeyCredential"}})(o.toDataArgsArgument(i.toDataPubKeyHash)({reflectSymbol:function(){return"PubKeyCredential"}}))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PubKeyCredential"}})(a.knownNatZ))(a.knownNatZ))(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"ScriptCredential"}})(o.toDataArgsArgument(c.toDataValidatorHash)({reflectSymbol:function(){return"ScriptCredential"}}))()()(u.getIndexWithLabelConsI(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"ScriptCredential"}})(a.knownNatS(a.knownNatZ)))()()({reflectSymbol:function(){return"ScriptCredential"}})(a.knownNatS(a.knownNatZ)))(a.knownNatS(a.knownNatZ))))},h={toData:o.genericToData(g)(o.toDataWithSchemaSum(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"StakingHash"}})(o.toDataArgsArgument(C)({reflectSymbol:function(){return"StakingHash"}}))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"StakingHash"}})(a.knownNatZ))(a.knownNatZ))(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"StakingPtr"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"StakingPtr"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(r.toDataCertificateIndex)(o.toDataArgsRLHelperCons(r.toDataSlot)(o.toDataArgsRLHelperCons(r.toDataTransactionIndex)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"txIx"}})({reflectSymbol:function(){return"StakingPtr"}})()()()()(a.knownNatS(a.knownNatZ)))()()()({reflectSymbol:function(){return"slot"}})({reflectSymbol:function(){return"StakingPtr"}})()()()()(a.knownNatZ))()()()({reflectSymbol:function(){return"certIx"}})({reflectSymbol:function(){return"StakingPtr"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatZ)))))()))()()(u.getIndexWithLabelConsI(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"StakingPtr"}})(a.knownNatS(a.knownNatZ)))()()({reflectSymbol:function(){return"StakingPtr"}})(a.knownNatS(a.knownNatZ)))(a.knownNatS(a.knownNatZ))))},A={fromData:t.genericFromData(y)(t.fromDataWithSchemaSum(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"PubKeyCredential"}})()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PubKeyCredential"}})(a.knownNatZ))(t.fromDataArgsArgument(i.fromDataPubKeyHash))(a.knownNatZ))(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"ScriptCredential"}})()()(u.getIndexWithLabelConsI(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"ScriptCredential"}})(a.knownNatS(a.knownNatZ)))()()({reflectSymbol:function(){return"ScriptCredential"}})(a.knownNatS(a.knownNatZ)))(t.fromDataArgsArgument(c.fromDataValidatorHash))(a.knownNatS(a.knownNatZ))))},S={fromData:t.genericFromData(g)(t.fromDataWithSchemaSum(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"StakingHash"}})()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"StakingHash"}})(a.knownNatZ))(t.fromDataArgsArgument(A))(a.knownNatZ))(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"StakingPtr"}})()()(u.getIndexWithLabelConsI(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"StakingPtr"}})(a.knownNatS(a.knownNatZ)))()()({reflectSymbol:function(){return"StakingPtr"}})(a.knownNatS(a.knownNatZ)))(t.fromDataArgsArgumentRecor(t.fromDataArgsRLCons(r.fromDataSlot)(t.fromDataArgsRLCons(r.fromDataTransactionIndex)(t.fromDataArgsRLCons(r.fromDataCertificateIndex)(t.fromDataArgsRLNilRow)()()({reflectSymbol:function(){return"certIx"}}))()()({reflectSymbol:function(){return"txIx"}}))()()({reflectSymbol:function(){return"slot"}}))()()())(a.knownNatS(a.knownNatZ))))};n.PubKeyCredential=d,n.ScriptCredential=v,n.StakingHash=m,n.StakingPtr=p,n.showCredential=b,n.toDataCredential=C,n.fromDataCredential=A,n.showStakingCredential=w,n.toDataStakingCredential=h,n.fromDataStakingCredential=S}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.Address"]=e["Ctl.Internal.Plutus.Types.Address"]||{};var n,t,r=e["Ctl.Internal.Plutus.Types.Address"],o=e["Control.Category"],a=e["Ctl.Internal.FromData"],u=e["Ctl.Internal.Plutus.Types.Credential"],i=e["Ctl.Internal.ToData"],c=e["Ctl.Internal.TypeLevel.Nat"],l=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],s=e["Data.Maybe"],f=e["Data.Newtype"],d=e["Data.Show"],v=e["Data.Show.Generic"],m={getAddress:o.identity(o.categoryFn)},p={getAddress:(n=f.unwrap(),function(e){return n(e).address})},g={to:function(e){return e},from:function(e){return e}},y={show:v.genericShow(g)(v.genericShowConstructor(v.genericShowArgsArgument(d.showRecord()(d.showRecordFieldsCons({reflectSymbol:function(){return"addressCredential"}})(d.showRecordFieldsCons({reflectSymbol:function(){return"addressStakingCredential"}})(d.showRecordFieldsNil)(s.showMaybe(u.showStakingCredential)))(u.showCredential))))({reflectSymbol:function(){return"Address"}}))},b={toData:i.genericToData(g)(i.toDataWithSchemaConstruct({reflectSymbol:function(){return"Address"}})(i.toDataArgsArgumentRecord(i.toDataArgsRecord({reflectSymbol:function(){return"Address"}})(i.toDataArgsRL(i.toDataArgsRLHelperCons(u.toDataCredential)(i.toDataArgsRLHelperCons(i.toDataMaybe(u.toDataStakingCredential))(i.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"addressStakingCredential"}})({reflectSymbol:function(){return"Address"}})()()()()(c.knownNatS(c.knownNatZ)))()()()({reflectSymbol:function(){return"addressCredential"}})({reflectSymbol:function(){return"Address"}})()()()()(c.knownNatZ)))()))()()(l.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"Address"}})(c.knownNatZ))(c.knownNatZ))},w={fromData:a.genericFromData(g)(a.fromDataWithSchemaConstru({reflectSymbol:function(){return"Address"}})()()(l.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"Address"}})(c.knownNatZ))(a.fromDataArgsArgumentRecor(a.fromDataArgsRLCons(u.fromDataCredential)(a.fromDataArgsRLCons(a.fromDataMaybe(u.fromDataStakingCredential))(a.fromDataArgsRLNilRow)()()({reflectSymbol:function(){return"addressStakingCredential"}}))()()({reflectSymbol:function(){return"addressCredential"}}))()()())(c.knownNatZ))},C=(t=f.unwrap(),function(e){return t(e).addressStakingCredential});r.AddressWithNetworkTag=function(e){return e},r.getAddress=function(e){return e.getAddress},r.toPubKeyHash=function(e){var n=f.unwrap()(e).addressCredential;return n instanceof u.PubKeyCredential?new s.Just(n.value0):s.Nothing.value},r.toStakingCredential=C,r.plutusAddressAddress=m,r.plutusAddressAddressWithN=p,r.showAddress=y,r.toDataAddress=b,r.fromDataAddress=w}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Conversion.Address"]=e["Ctl.Internal.Plutus.Conversion.Address"]||{};var n,t,r=e["Ctl.Internal.Plutus.Conversion.Address"],o=e["Control.Alt"],a=e["Control.Bind"],u=e["Ctl.Internal.Plutus.Types.Address"],i=e["Ctl.Internal.Plutus.Types.Credential"],c=e["Ctl.Internal.Serialization.Address"],l=e["Data.Function"],s=e["Data.Functor"],f=e["Data.Maybe"],d=e["Data.Newtype"],v=function(e){var n,t,r,v,m=c.withStakeCredential({onKeyHash:(t=d.wrap(),function(e){return i.PubKeyCredential.create(t(e))}),onScriptHash:(n=d.wrap(),function(e){return i.ScriptCredential.create(n(e))})}),p=c.addressNetworkId(e);return s.map(f.functorMaybe)((function(e){return u.AddressWithNetworkTag({address:e,networkId:p})}))(o.alt(f.altMaybe)(o.alt(f.altMaybe)((r=e,v=function(e){return function(n){return new f.Just(d.wrap()({addressCredential:e,addressStakingCredential:l.flip(c.withStakeCredential)(n)({onKeyHash:function(e){return new f.Just(new i.StakingHash(new i.PubKeyCredential(d.wrap()(e))))},onScriptHash:function(e){return new f.Just(new i.StakingHash(new i.ScriptCredential(d.wrap()(e))))}})}))}},a.bind(f.bindMaybe)(c.baseAddressFromAddress(r))((function(e){var n=c.baseAddressPaymentCred(e),t=c.baseAddressDelegationCred(e);return l.flip(c.withStakeCredential)(n)({onKeyHash:function(e){return v(new i.PubKeyCredential(d.wrap()(e)))(t)},onScriptHash:function(e){return v(new i.ScriptCredential(d.wrap()(e)))(t)}})}))))(function(e){return a.bind(f.bindMaybe)(c.pointerAddressFromAddress(e))((function(e){var n=c.pointerAddressStakePointer(e),t=c.pointerAddressPaymentCred(e);return new f.Just(d.wrap()({addressCredential:m(t),addressStakingCredential:new f.Just(new i.StakingPtr(n))}))}))}(e)))(function(e){return a.bind(f.bindMaybe)(c.enterpriseAddressFromAddress(e))((function(e){var n=c.enterpriseAddressPaymentCred(e);return new f.Just(d.wrap()({addressCredential:m(n),addressStakingCredential:f.Nothing.value}))}))}(e)))},m=(t=s.map(f.functorMaybe)((n=d.unwrap(),function(e){return n(e).address})),function(e){return t(v(e))}),p=function(e){return function(n){if(n.addressCredential instanceof i.PubKeyCredential&&n.addressStakingCredential instanceof f.Just&&n.addressStakingCredential.value0 instanceof i.StakingHash&&n.addressStakingCredential.value0.value0 instanceof i.PubKeyCredential)return c.baseAddressToAddress(c.paymentKeyHashStakeKeyHashAddress(e)(n.addressCredential.value0)(n.addressStakingCredential.value0.value0.value0));if(n.addressCredential instanceof i.ScriptCredential&&n.addressStakingCredential instanceof f.Just&&n.addressStakingCredential.value0 instanceof i.StakingHash&&n.addressStakingCredential.value0.value0 instanceof i.PubKeyCredential)return c.baseAddressToAddress(c.scriptHashStakeKeyHashAddress(e)(n.addressCredential.value0)(n.addressStakingCredential.value0.value0.value0));if(n.addressCredential instanceof i.PubKeyCredential&&n.addressStakingCredential instanceof f.Just&&n.addressStakingCredential.value0 instanceof i.StakingHash&&n.addressStakingCredential.value0.value0 instanceof i.ScriptCredential)return c.baseAddressToAddress(c.paymentKeyHashScriptHashAddress(e)(n.addressCredential.value0)(n.addressStakingCredential.value0.value0.value0));if(n.addressCredential instanceof i.ScriptCredential&&n.addressStakingCredential instanceof f.Just&&n.addressStakingCredential.value0 instanceof i.StakingHash&&n.addressStakingCredential.value0.value0 instanceof i.ScriptCredential)return c.baseAddressToAddress(c.scriptHashScriptHashAddress(e)(n.addressCredential.value0)(n.addressStakingCredential.value0.value0.value0));if(n.addressCredential instanceof i.PubKeyCredential&&n.addressStakingCredential instanceof f.Just&&n.addressStakingCredential.value0 instanceof i.StakingPtr)return c.pointerAddressToAddress(c.paymentKeyHashPointerAddress(e)(n.addressCredential.value0)(n.addressStakingCredential.value0.value0));if(n.addressCredential instanceof i.ScriptCredential&&n.addressStakingCredential instanceof f.Just&&n.addressStakingCredential.value0 instanceof i.StakingPtr)return c.pointerAddressToAddress(c.scriptHashPointerAddress(e)(n.addressCredential.value0)(n.addressStakingCredential.value0.value0));if(n.addressCredential instanceof i.PubKeyCredential&&n.addressStakingCredential instanceof f.Nothing)return c.enterpriseAddressToAddress(c.paymentKeyHashEnterpriseAddress(e)(n.addressCredential.value0));if(n.addressCredential instanceof i.ScriptCredential&&n.addressStakingCredential instanceof f.Nothing)return c.enterpriseAddressToAddress(c.scriptHashEnterpriseAddress(e)(n.addressCredential.value0));throw new Error("Failed pattern match at Ctl.Internal.Plutus.Conversion.Address (line 67, column 3 - line 110, column 53): "+[n.addressCredential.constructor.name,n.addressStakingCredential.constructor.name])}};r.fromPlutusAddress=p,r.fromPlutusAddressWithNetworkTag=function(e){return p(e.networkId)(e.address)},r.toPlutusAddress=m,r.toPlutusAddressWithNetworkTag=v}(c),function(e){"use strict";e["Ctl.Internal.NativeScripts"]=e["Ctl.Internal.NativeScripts"]||{};var n,t=e["Ctl.Internal.NativeScripts"],r=e["Control.Apply"],o=e["Ctl.Internal.Cardano.Types.NativeScript"],a=e["Ctl.Internal.Serialization.Hash"],u=e["Ctl.Internal.Serialization.NativeScript"],i=e["Data.Array"],c=e["Data.Boolean"],l=e["Data.Foldable"],s=e["Data.Function"],f=e["Data.Functor"],d=e["Data.List"],v=e["Data.List.Types"],m=e["Data.Maybe"],p=e["Data.Newtype"],g=e["Data.Ord"],y=e["Data.Semigroup"],b=e["Data.Set"],w=e["Data.Unfoldable"],C=(n=p.wrap(),function(e){return n(a.nativeScriptHash(u.convertNativeScript(e)))}),h=[b.empty];t.nativeScriptHash=C,t.getMaximumSigners=function(e){var n=function(t){if(t instanceof o.ScriptPubkey){if(b.member(a.ordEd25519KeyHash)(t.value0)(e))return h;if(c.otherwise)return[b.singleton(t.value0)]}if(t instanceof o.ScriptAll)return l.foldr(l.foldableArray)((u=a.ordEd25519KeyHash,function(e){return function(n){return r.apply(r.applyArray)(f.map(f.functorArray)(y.append(b.semigroupSet(u)))(e))(n)}}))(h)(f.map(f.functorArray)(n)(t.value0));var u,s,m,p,g,C;if(t instanceof o.ScriptAny)return l.foldr(l.foldableArray)(function(e){return function(n){return function(t){return i.nub(b.ordSet(e))(y.append(y.semigroupArray)(n)(t))}}}(a.ordEd25519KeyHash))(h)(f.map(f.functorArray)(n)(t.value0));if(t instanceof o.ScriptNOfK)return n(new o.ScriptAny(f.map(f.functorArray)(o.ScriptAll.create)((s=t.value0,m=f.map(f.functorArray)(d.toUnfoldable(w.unfoldableArray)),p=d.toUnfoldable(w.unfoldableArray),g=function(e){return function(n){var t=function(e){return function(n){if(n instanceof v.Nil)return new v.Cons(v.Nil.value,v.Nil.value);if(n instanceof v.Cons)return new v.Cons(d.take(e)(n),t(e)(n.value1));throw new Error("Failed pattern match at Ctl.Internal.NativeScripts (line 64, column 3 - line 64, column 46): "+[e.constructor.name,n.constructor.name])}};return d.take(1+(d.length(n)-e|0)|0)(t(e)(n))}}(s),C=d.fromFoldable(l.foldableArray),function(e){return m(p(g(C(e))))})(t.value1))));if(t instanceof o.TimelockStart)return h;if(t instanceof o.TimelockExpiry)return h;throw new Error("Failed pattern match at Ctl.Internal.NativeScripts (line 79, column 11 - line 90, column 39): "+[t.constructor.name])},t=m.fromMaybe(0),u=f.map(m.functorMaybe)(b.size),p=l.maximumBy(l.foldableArray)(s.on(g.compare(g.ordInt))(b.size));return function(e){return t(u(p(n(e))))}}}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.CurrencySymbol"]=e["Ctl.Internal.Plutus.Types.CurrencySymbol"]||{};var n,t=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],r=e["Control.Applicative"],o=e["Ctl.Internal.FromData"],a=e["Ctl.Internal.Serialization.Hash"],u=e["Ctl.Internal.ToData"],i=e["Ctl.Internal.Types.ByteArray"],c=e["Ctl.Internal.Types.Scripts"],l=e["Data.Boolean"],s=e["Data.Eq"],f=e["Data.Functor"],d=e["Data.Maybe"],v=e["Data.Monoid"],m=e["Data.Newtype"],p=e["Data.Show"],g=u.toDataByteArray,y={show:function(e){return"(CurrencySymbol "+p.show(i.showByteArray)(e)+")"}},b=o.fromDataByteArray,w=i.eqByteArray,C=(n=d.fromJust(),function(e){return n(a.scriptHashFromBytes(e))}),h=v.mempty(i.monoidByteArray),A=function(e){if(s.eq(i.eqByteArray)(e)(v.mempty(i.monoidByteArray)))return r.pure(d.applicativeMaybe)(h);if(l.otherwise)return f.voidLeft(d.functorMaybe)(a.scriptHashFromBytes(e))(e);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.CurrencySymbol (line 94, column 1 - line 94, column 54): "+[e.constructor.name])};t.adaSymbol=h,t.currencyMPSHash=function(e){return c.MintingPolicyHash(C(e))},t.getCurrencySymbol=function(e){return e},t.mkCurrencySymbol=A,t.mpsSymbol=function(e){return A(m.unwrap()(a.scriptHashToBytes(e)))},t.eqCurrencySymbol=w,t.fromDataCurrencySymbol=b,t.toDataCurrencySymbol=g,t.showCurrencySymbol=y}(c),function(e){"use strict";e["Ctl.Internal.Scripts"]=e["Ctl.Internal.Scripts"]||{};var n,t,r,o,a,u,i,c=e["Ctl.Internal.Scripts"],l=e["Ctl.Internal.Hashing"],s=e["Ctl.Internal.NativeScripts"],f=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],d=e["Ctl.Internal.Serialization.Address"],v=e["Ctl.Internal.Types.Scripts"],m=e["Data.Newtype"],p=function(e){return function(n){return d.enterpriseAddressToAddress(d.enterpriseAddress({network:e,paymentCred:d.scriptHashCredential(m.unwrap()(n))}))}},g=(n=m.wrap(),t=m.unwrap(),function(e){return n(l.plutusScriptHash(t(e)))}),y=(r=m.wrap(),o=m.unwrap(),function(e){return r(l.plutusScriptHash(o(e)))}),b=(a=m.wrap(),u=m.unwrap(),i=m.unwrap(),function(e){return a(u(s.nativeScriptHash(i(e))))}),w=function(e){if(e instanceof v.PlutusMintingPolicy)return m.wrap()(l.plutusScriptHash(e.value0));if(e instanceof v.NativeMintingPolicy)return m.wrap()(m.unwrap()(s.nativeScriptHash(e.value0)));throw new Error("Failed pattern match at Ctl.Internal.Scripts (line 61, column 21 - line 63, column 74): "+[e.constructor.name])};c.mintingPolicyHash=w,c.nativeScriptStakeValidatorHash=b,c.plutusScriptStakeValidatorHash=y,c.scriptCurrencySymbol=function(e){return f.mpsSymbol(w(e))},c.typedValidatorEnterpriseAddress=function(e){return function(n){return p(e)(n.validatorHash)}},c.validatorHash=g,c.validatorHashBaseAddress=function(e){var n=d.scriptAddress(e),t=m.unwrap();return function(e){return d.baseAddressToAddress(n(t(e)))}},c.validatorHashEnterpriseAddress=p}(c),function(e){"use strict";e["Contract.Address"]=e["Contract.Address"]||{};var n=e["Contract.Address"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Reader.Class"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Contract.Wallet"],i=e["Ctl.Internal.Helpers"],c=e["Ctl.Internal.Plutus.Conversion.Address"],l=e["Ctl.Internal.Scripts"],s=e["Ctl.Internal.Serialization.Address"],f=e["Data.Traversable"],d=e["Effect.Exception"],v=u.ownStakePubKeysHashes,m=u.ownPaymentPubKeyHashes,p=r.bind(a.bindContract)(u.getWalletAddresses)((function(e){return f.traverse(f.traversableArray)(a.applicativeContract)((n=i.liftM(a.monadErrorErrorContract)(d.error("getWalletAddressesWithNetworkTag: failed to deserialize `Address`")),function(e){return n(c.toPlutusAddressWithNetworkTag(e))}))(e);var n})),g=(r.bind(a.bindContract)(u.getWalletAddresses)((function(e){return f.traverse(f.traversableArray)(a.applicativeContract)((n=i.liftM(a.monadErrorErrorContract)(d.error("getWalletAddresses: failed to deserialize `Address`")),function(e){return n(c.toPlutusAddress(e))}))(e);var n})),o.asks(a.monadAskContractEnvContra)((function(e){return e.networkId}))),y=function(e){return s.addressBech32(c.fromPlutusAddressWithNetworkTag(e))};n.getNetworkId=g,n.addressWithNetworkTagToBech32=y,n.addressToBech32=function(e){return r.bind(a.bindContract)(g)((function(n){return t.pure(a.applicativeContract)(y({address:e,networkId:n}))}))},n.getWalletAddressesWithNetworkTag=p,n.ownPaymentPubKeysHashes=m,n.ownStakePubKeysHashes=v,n.validatorHashBaseAddress=function(e){var n=l.validatorHashBaseAddress(e);return function(e){return c.toPlutusAddress(n(e))}}}(c),function(e){"use strict";e["Ctl.Internal.Contract.Hooks"]=e["Ctl.Internal.Contract.Hooks"]||{};var n=e["Ctl.Internal.Contract.Hooks"],t=e["Data.Maybe"],r={beforeSign:t.Nothing.value,beforeInit:t.Nothing.value,onSuccess:t.Nothing.value,onError:t.Nothing.value,onSubmit:t.Nothing.value};n.emptyHooks=r}(c),function(e){"use strict";e["Contract.Config"]=e["Contract.Config"]||{};var n=e["Contract.Config"],t=e["Ctl.Internal.Contract.Hooks"],r=e["Ctl.Internal.Contract.QueryBackend"],o=e["Ctl.Internal.Serialization.Address"],a=e["Ctl.Internal.ServerConfig"],u=e["Data.Log.Level"],i=e["Data.Maybe"],c={backendParams:r.mkCtlBackendParams({ogmiosConfig:a.defaultOgmiosWsConfig,kupoConfig:a.defaultKupoServerConfig}),networkId:o.TestnetId.value,walletSpec:i.Nothing.value,logLevel:u.Trace.value,customLogger:i.Nothing.value,suppressLogs:!1,hooks:t.emptyHooks};n.testnetConfig=c}(c),function(e){"use strict";e["Contract.Monad"]=e["Contract.Monad"]||{};var n=e["Contract.Monad"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Ctl.Internal.Contract.Monad"],a=e["Data.Either"],u=e["Data.Maybe"],i=e["Data.Show"],c=e["Effect.Class"],l=e["Effect.Exception"],s=function(e){return u.maybe(c.liftEffect(o.monadEffectContract)(l.throw(e)))(t.pure(o.applicativeContract))},f=function(e){return a.either(function(e){var n=c.liftEffect(o.monadEffectContract),t=i.show(e);return function(e){return n(l.throw(t(e)))}}(e))(t.pure(o.applicativeContract))};n.liftContractE=f,n.liftContractM=s,n.liftedE=function(e){return r.bindFlipped(o.bindContract)(f(e))},n.liftedM=function(e){return r.bindFlipped(o.bindContract)(s(e))}}(c),function(e){"use strict";e["Ctl.Internal.Address"]=e["Ctl.Internal.Address"]||{};var n,t,r,o=e["Ctl.Internal.Address"],a=e["Control.Alt"],u=e["Control.Applicative"],i=e["Control.Bind"],c=e["Ctl.Internal.Serialization.Address"],l=e["Ctl.Internal.Types.Scripts"],s=e["Data.Functor"],f=e["Data.Maybe"],d=i.composeKleisliFlipped(f.bindMaybe)(c.stakeCredentialToScriptHash)(i.composeKleisliFlipped(f.bindMaybe)((n=u.pure(f.applicativeMaybe),function(e){return n(c.enterpriseAddressPaymentCred(e))}))(c.enterpriseAddressFromAddress)),v=i.composeKleisliFlipped(f.bindMaybe)(c.stakeCredentialToScriptHash)(i.composeKleisliFlipped(f.bindMaybe)((t=u.pure(f.applicativeMaybe),function(e){return t(c.baseAddressPaymentCred(e))}))(c.baseAddressFromAddress)),m=c.addressBech32,p=(r=s.map(f.functorMaybe)(l.ValidatorHash),function(e){return r((n=e,a.alt(f.altMaybe)(v(n))(d(n))));var n});o.addressToOgmiosAddress=m,o.addressPaymentValidatorHash=p}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.AssocMap"]=e["Ctl.Internal.Plutus.Types.AssocMap"]||{};var n=e["Ctl.Internal.Plutus.Types.AssocMap"],t=e["Data.Array"],r=e["Data.Eq"],o=e["Data.Foldable"],a=e["Data.Functor"],u=e["Data.Maybe"],i=e["Data.Semigroup"],c=e["Data.Show"],l=e["Data.Show.Generic"],s=e["Data.These"],f=e["Data.Tuple"],d={to:function(e){return e},from:function(e){return e}},v={map:function(e){return function(n){return a.map(a.functorArray)(a.map(f.functorTuple)(e))(n)}}},m={foldMap:function(e){return function(n){return function(t){return o.foldMap(o.foldableArray)(e)(o.foldMap(o.foldableTuple)(e)(n))(t)}}},foldr:function(e){return o.foldrDefault(m)(e)},foldl:function(e){return o.foldlDefault(m)(e)}},p=function(e){return function(n){return function(t){return o.lookup(o.foldableArray)(e)(n)(t)}}};n.lookup=p,n.singleton=function(e){return function(n){return t.singleton(new f.Tuple(e,n))}},n.union=function(e){return function(n){return function(o){var c=t.filter((function(o){return!t.any((function(n){return r.eq(e)(n.value0)(o.value0)}))(n)}))(o),l=a.map(a.functorArray)(a.map(f.functorTuple)(s.That.create))(c),d=a.map(a.functorArray)((function(n){return new f.Tuple(n.value0,(t=n.value1,function(e){if(e instanceof u.Nothing)return new s.This(t);if(e instanceof u.Just)return new s.Both(t,e.value0);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.AssocMap (line 155, column 11 - line 157, column 25): "+[e.constructor.name])})(p(e)(n.value0)(o)));var t}))(n);return i.append(i.semigroupArray)(d)(l)}}},n.showMap=function(e){return function(n){return{show:l.genericShow(d)(l.genericShowConstructor(l.genericShowArgsArgument(c.showArray(f.showTuple(e)(n))))({reflectSymbol:function(){return"Map"}}))}}},n.functorMap=v,n.foldableMap=m}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.Value"]=e["Ctl.Internal.Plutus.Types.Value"]||{};var n,t,r,o=e["Ctl.Internal.Plutus.Types.Value"],a=e["Control.Applicative"],u=e["Control.Apply"],i=e["Control.Bind"],c=e["Control.Category"],l=e["Ctl.Internal.Plutus.Types.AssocMap"],s=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],f=e["Ctl.Internal.Types.ByteArray"],d=e["Ctl.Internal.Types.TokenName"],v=e["Data.Array"],m=e["Data.BigInt"],p=e["Data.Boolean"],g=e["Data.Eq"],y=e["Data.Foldable"],b=e["Data.Function"],w=e["Data.Functor"],C=e["Data.HeytingAlgebra"],h=e["Data.Maybe"],A=e["Data.Monoid"],S=e["Data.Semiring"],I=e["Data.Show"],T=e["Data.These"],D=e["Data.Tuple"],F={show:function(e){return"(PlutusValue "+I.show(l.showMap(s.showCurrencySymbol)(l.showMap(d.showTokenName)(m.showBigInt)))(e)+")"}},E=function(e){return function(n){return function(t){return h.fromMaybe(S.zero(m.semiringBigInt))(i.bind(h.bindMaybe)(l.lookup(s.eqCurrencySymbol)(n)(e))(l.lookup(d.eqTokenName)(t)))}}},x=function(e){return function(n){return w.map(l.functorMap)(T.these(w.map(l.functorMap)(T.This.create))(w.map(l.functorMap)(T.That.create))(l.union(d.eqTokenName)))(l.union(s.eqCurrencySymbol)(e)(n))}},M={append:(n=S.add(m.semiringBigInt),function(e){var t=w.map(l.functorMap)(w.map(l.functorMap)(T.these(c.identity(c.categoryFn))(c.identity(c.categoryFn))(n))),r=x(e);return function(e){return t(r(e))}})},R={mempty:[],Semigroup0:function(){return M}},P=function(e){return function(n){var t=l.singleton(e),r=l.singleton(n);return function(e){return t(r(e))}}},k=P(s.adaSymbol)(d.adaToken),B=(r=v.filter((t=g.notEq(s.eqCurrencySymbol)(s.adaSymbol),function(e){return t(D.fst(e))})),function(e){return r((n=e,b.flip(v.concatMap)(n)((function(e){return w.mapFlipped(w.functorArray)(e.value1)((function(n){return new D.Tuple(e.value0,new D.Tuple(n.value0,n.value1))}))}))));var n}),N={eq:function(e){return function(n){return function(t){return function(e){return function(n){return function(t){return y.all(l.foldableMap)(C.heytingAlgebraBoolean)(y.all(l.foldableMap)(C.heytingAlgebraBoolean)(e))(x(n)(t))}}}(T.these(b.flip(e)(S.zero(m.semiringBigInt)))(e(S.zero(m.semiringBigInt)))(e))(n)(t)}}}(g.eq(m.eqBigInt))};o.flattenNonAdaAssets=B,o.getValue=function(e){return e},o.lovelaceValueOf=k,o.singleton=P,o["singleton'"]=function(e){return function(n){return function(t){if(g.eq(f.eqByteArray)(e)(A.mempty(f.monoidByteArray))&&g.notEq(f.eqByteArray)(n)(A.mempty(f.monoidByteArray)))return h.Nothing.value;if(p.otherwise)return u.lift3(h.applyMaybe)(P)(s.mkCurrencySymbol(e))(d.mkTokenName(n))(a.pure(h.applicativeMaybe)(t));throw new Error("Failed pattern match at Ctl.Internal.Plutus.Types.Value (line 181, column 1 - line 181, column 62): "+[e.constructor.name,n.constructor.name,t.constructor.name])}}},o.valueOf=E,o["valueToCoin'"]=function(e){return E(e)(s.adaSymbol)(d.adaToken)},o.eqValue=N,o.showValue=F,o.semigroupValue=M,o.monoidValue=R}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Conversion.Value"]=e["Ctl.Internal.Plutus.Conversion.Value"]||{};var n=e["Ctl.Internal.Plutus.Conversion.Value"],t=e["Control.Bind"],r=e["Ctl.Internal.Cardano.Types.Value"],o=e["Ctl.Internal.Plutus.Types.AssocMap"],a=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],u=e["Ctl.Internal.Plutus.Types.Value"],i=e["Ctl.Internal.Types.TokenName"],c=e["Data.Array"],l=e["Data.BigInt"],s=e["Data.Boolean"],f=e["Data.Eq"],d=e["Data.Foldable"],v=e["Data.Function"],m=e["Data.Functor"],p=e["Data.List.Types"],g=e["Data.Map.Internal"],y=e["Data.Maybe"],b=e["Data.Monoid"],w=e["Data.Newtype"],C=e["Data.Semigroup"],h=e["Data.Semiring"],A=e["Data.Traversable"],S=e["Data.Tuple"];n.fromPlutusValue=function(e){var n,s={adaTokenMap:(n=c.partition((function(e){return f.eq(a.eqCurrencySymbol)(e.value0)(a.adaSymbol)}))(w.unwrap()(u.getValue(e)))).yes,nonAdaTokenMap:n.no},p=y.fromJust()(r.mkNonAdaAssetsFromTokenMap(A.traversableArray)(m.mapFlipped(m.functorArray)(s.nonAdaTokenMap)((function(e){return new S.Tuple(a.getCurrencySymbol(e.value0),g.fromFoldable(i.ordTokenName)(d.foldableArray)(w.unwrap()(e.value1)))})))),I=v.flip(r.mkValue)(b.mempty(r.monoidNonAdaAsset))(w.wrap()(y.fromMaybe(h.zero(l.semiringBigInt))(t.bind(y.bindMaybe)(m.map(y.functorMaybe)(S.snd)(c.head(s.adaTokenMap)))((function(e){return o.lookup(i.eqTokenName)(i.adaToken)(e)})))));return C.append(r.semigroupValue)(I)(r.mkValue(b.mempty(r.monoidCoin))(p))},n.toPlutusValue=function(e){var n=m.mapFlipped(p.functorList)(r.flattenNonAdaValue(e.value1))((function(e){return y.fromJust()(u["singleton'"](r.getCurrencySymbol(e.value0))(i.getTokenName(e.value1.value0))(e.value1.value1))})),t=function(){if(f.eq(l.eqBigInt)(e.value0)(h.zero(l.semiringBigInt)))return b.mempty(u.monoidValue);if(s.otherwise)return u.lovelaceValueOf(e.value0);throw new Error("Failed pattern match at Ctl.Internal.Plutus.Conversion.Value (line 72, column 3 - line 72, column 27): "+[])}();return C.append(u.semigroupValue)(t)(d.fold(p.foldableList)(u.monoidValue)(n))}}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Conversion"]=e["Ctl.Internal.Plutus.Conversion"]||{};var n=e["Ctl.Internal.Plutus.Conversion"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Ctl.Internal.Hashing"],a=e["Ctl.Internal.Plutus.Conversion.Address"],u=e["Ctl.Internal.Plutus.Conversion.Value"],i=e["Data.Functor"],c=e["Data.Map.Internal"],l=e["Data.Maybe"],s=e["Data.Newtype"],f=e["Data.Traversable"].traverse(c.traversableMap)(l.applicativeMaybe)((function(e){return i.mapFlipped(l.functorMaybe)((c=e,f=s.unwrap()(c),r.bind(l.bindMaybe)(a.toPlutusAddress(f.address))((function(e){var n=i.map(l.functorMaybe)(o.scriptRefHash)(f.scriptRef),r=u.toPlutusValue(f.amount);return t.pure(l.applicativeMaybe)(s.wrap()({address:e,amount:r,datum:f.datum,referenceScript:n}))}))))((n=s.wrap(),function(t){return n({output:t,scriptRef:s.unwrap()(e).scriptRef})}));var n,c,f})),d=function(e){return function(n){return function(e){return function(n){return function(t){var r=s.unwrap()(t);return s.wrap()({address:a.fromPlutusAddress(e)(r.address),amount:u.fromPlutusValue(r.amount),datum:r.datum,scriptRef:n})}}}(e)(n.scriptRef)(n.output)}};n.fromPlutusTxOutputWithRefScript=d,n.fromPlutusUtxoMap=function(e){return i.map(c.functorMap)(d(e))},n.toPlutusUtxoMap=f}(c),function(e){"use strict";e["Ctl.Internal.Transaction"]=e["Ctl.Internal.Transaction"]||{};var n=e["Ctl.Internal.Transaction"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Except.Trans"],a=e["Ctl.Internal.Cardano.Types.Transaction"],u=e["Ctl.Internal.Deserialization.WitnessSet"],i=e["Ctl.Internal.Helpers"],c=e["Ctl.Internal.Serialization"],l=e["Ctl.Internal.Serialization.PlutusData"],s=e["Ctl.Internal.Serialization.PlutusScript"],f=e["Ctl.Internal.Serialization.ToBytes"],d=e["Ctl.Internal.Serialization.WitnessSet"],v=e["Data.Array"],m=e["Data.Boolean"],p=e["Data.Either"],g=e["Data.Foldable"],y=e["Data.Functor"],b=e["Data.Generic.Rep"],w=e["Data.Maybe"],C=e["Data.Monoid"],h=e["Data.Newtype"],A=e["Data.Semigroup"],S=e["Data.Show.Generic"],I=e["Data.Traversable"],T=e.Effect,D=e["Effect.Class"],F=function(){function e(){}return e.value=new e,e}(),E=function(){function e(){}return e.value=new e,e}(),x={to:function(e){if(e instanceof b.Inl)return F.value;if(e instanceof b.Inr)return E.value;throw new Error("Failed pattern match at Ctl.Internal.Transaction (line 46, column 1 - line 46, column 40): "+[e.constructor.name])},from:function(e){if(e instanceof F)return new b.Inl(b.NoArguments.value);if(e instanceof E)return new b.Inr(b.NoArguments.value);throw new Error("Failed pattern match at Ctl.Internal.Transaction (line 46, column 1 - line 46, column 40): "+[e.constructor.name])}},M={show:S.genericShow(x)(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsNoArguments)({reflectSymbol:function(){return"ConvertWitnessesError"}}))(S.genericShowConstructor(S.genericShowArgsNoArguments)({reflectSymbol:function(){return"ConvertDatumError"}})))},R=function(e){return function(n){return i.liftEither(o.monadErrorExceptT(T.monadEffect))(new p.Right(h.over()()(a.Transaction)((function(t){return{witnessSet:A.append(a.semigroupTransactionWitne)(e.witnessSet)(n),auxiliaryData:t.auxiliaryData,body:t.body,isValid:t.isValid}}))(e)))}},P=function(e){return function(n){return r.bind(o.bindExceptT(T.monadEffect))(D.liftEffect(o.monadEffectExceptT(D.monadEffectEffect))(d.convertWitnessSet(e)))((function(e){return r.discard(r.discardUnit)(o.bindExceptT(T.monadEffect))(D.liftEffect(o.monadEffectExceptT(D.monadEffectEffect))(n(e)))((function(){return i.liftEither(o.monadErrorExceptT(T.monadEffect))(p.note(F.value)(u.convertWitnessSet(e)))}))}))}};n.attachDatum=function(e){var n,t=(n=v.singleton(e),function(e){if(0===n.length)return i.liftEither(o.monadErrorExceptT(T.monadEffect))(new p.Right(e));var t,a=y.map(y.functorArray)((t=h.unwrap(),function(e){return l.convertPlutusData(t(e))}))(n);return r.bindFlipped(o.bindExceptT(T.monadEffect))(R(e))(P(e.witnessSet)(d.setPlutusData(a)))});return function(e){return o.runExceptT(t(e))}},n.attachRedeemer=function(e){var n,t=(n=v.singleton(e),function(e){return r.bind(o.bindExceptT(T.monadEffect))(D.liftEffect(o.monadEffectExceptT(D.monadEffectEffect))(I.traverse(I.traversableArray)(T.applicativeEffect)(d.convertRedeemer)(n)))((function(n){return r.bindFlipped(o.bindExceptT(T.monadEffect))(R(e))(P(e.witnessSet)(d.setRedeemers(n)))}))});return function(e){return o.runExceptT(t(e))}},n.attachPlutusScript=function(e){var n=function(e){return function(n){var t=y.map(y.functorArray)(s.convertPlutusScript)(e);return r.bindFlipped(o.bindExceptT(T.monadEffect))(R(n))(P(n.witnessSet)(d.setPlutusScripts(t)))}}(v.singleton(e));return function(e){return o.runExceptT(n(e))}},n.attachNativeScript=function(e){return function(n){return o.runExceptT(R(n)(h.over()()(a.TransactionWitnessSet)((function(n){return{nativeScripts:new w.Just([e]),bootstraps:n.bootstraps,plutusData:n.plutusData,plutusScripts:n.plutusScripts,redeemers:n.redeemers,vkeys:n.vkeys}}))(C.mempty(a.monoidTransactionWitnessS))))}},n.setScriptDataHash=function(e){return function(n){return function(r){return function(o){return g.null(g.foldableMaybe)(h.unwrap()(o.witnessSet).plutusScripts)&&g.null(g.foldableArray)(n)&&g.null(g.foldableArray)(r)?t.pure(T.applicativeEffect)(o):function(t){if(m.otherwise)return function(){var t,u,i=y.map(T.functorEffect)((t=h.unwrap(),u=f.toBytes(),function(e){return a.ScriptDataHash(t(u(e)))}))(c.hashScriptData(e)(n)(y.map(y.functorArray)(h.unwrap())(r)))();return h.over()()(a.Transaction)((function(e){return{body:h.over()()(a.TxBody)((function(e){return{scriptDataHash:new w.Just(i),auxiliaryDataHash:e.auxiliaryDataHash,certs:e.certs,collateral:e.collateral,collateralReturn:e.collateralReturn,fee:e.fee,inputs:e.inputs,mint:e.mint,networkId:e.networkId,outputs:e.outputs,referenceInputs:e.referenceInputs,requiredSigners:e.requiredSigners,totalCollateral:e.totalCollateral,ttl:e.ttl,update:e.update,validityStartInterval:e.validityStartInterval,withdrawals:e.withdrawals}}))(o.body),auxiliaryData:e.auxiliaryData,isValid:e.isValid,witnessSet:e.witnessSet}}))(o)};throw new Error("Failed pattern match at Ctl.Internal.Transaction (line 54, column 1 - line 59, column 24): "+[e.constructor.name,n.constructor.name,r.constructor.name,o.constructor.name])}()}}}},n.showModifyTxError=M}(c),function(e){"use strict";e["Ctl.Internal.Types.Interval"]=e["Ctl.Internal.Types.Interval"]||{};var n=e["Ctl.Internal.Types.Interval"],t=e["Control.Applicative"],r=e["Control.Apply"],o=e["Control.Bind"],a=e["Control.Monad.Error.Class"],u=e["Control.Monad.Except.Trans"],i=e["Ctl.Internal.FromData"],c=e["Ctl.Internal.Helpers"],l=e["Ctl.Internal.QueryM.Ogmios"],s=e["Ctl.Internal.Serialization.Address"],f=e["Ctl.Internal.ToData"],d=e["Ctl.Internal.Types.BigNum"],v=e["Ctl.Internal.Types.SystemStart"],m=e["Data.Array"],p=e["Data.BigInt"],g=e["Data.Either"],y=e["Data.Eq"],b=e["Data.Functor"],w=e["Data.Generic.Rep"],C=e["Data.Maybe"],h=e["Data.Newtype"],A=e["Data.Ord"],S=e["Data.Ring"],I=e["Data.Semiring"],T=e["Data.Show"],D=e["Data.Show.Generic"],F=e["Data.Tuple"],E=e.Effect,x=e.Math,M=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),R=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),P=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),k=function(){function e(){}return e.value=new e,e}(),B=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),N=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),L=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),_=function(){function e(){}return e.value=new e,e}(),U=function(){function e(){}return e.value=new e,e}(),H=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),q=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),O=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),V=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),W=function(){function e(){}return e.value=new e,e}(),K=function(){function e(){}return e.value=new e,e}(),z=f.toDataBigInt,J={show:function(e){return c.showWithParens(p.showBigInt)("POSIXTime")(e)}},G={show:function(e){return c.showWithParens(p.showBigInt)("ModTime")(e)}},j={show:function(e){return c.showWithParens(p.showBigInt)("AbsTime")(e)}},Q=p.semiringBigInt,Z=p.ordBigInt,X={to:function(e){if(e instanceof w.Inl)return new H(e.value0);if(e instanceof w.Inr&&e.value0 instanceof w.Inl)return new q(e.value0.value0);if(e instanceof w.Inr&&e.value0 instanceof w.Inr&&e.value0.value0 instanceof w.Inl)return new O(e.value0.value0.value0);if(e instanceof w.Inr&&e.value0 instanceof w.Inr&&e.value0.value0 instanceof w.Inr&&e.value0.value0.value0 instanceof w.Inl)return new V(e.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value1);if(e instanceof w.Inr&&e.value0 instanceof w.Inr&&e.value0.value0 instanceof w.Inr&&e.value0.value0.value0 instanceof w.Inr&&e.value0.value0.value0.value0 instanceof w.Inl)return W.value;if(e instanceof w.Inr&&e.value0 instanceof w.Inr&&e.value0.value0 instanceof w.Inr&&e.value0.value0.value0 instanceof w.Inr&&e.value0.value0.value0.value0 instanceof w.Inr)return K.value;throw new Error("Failed pattern match at Ctl.Internal.Types.Interval (line 859, column 1 - line 859, column 47): "+[e.constructor.name])},from:function(e){if(e instanceof H)return new w.Inl(e.value0);if(e instanceof q)return new w.Inr(new w.Inl(e.value0));if(e instanceof O)return new w.Inr(new w.Inr(new w.Inl(e.value0)));if(e instanceof V)return new w.Inr(new w.Inr(new w.Inr(new w.Inl(new w.Product(e.value0,e.value1)))));if(e instanceof W)return new w.Inr(new w.Inr(new w.Inr(new w.Inr(new w.Inl(w.NoArguments.value)))));if(e instanceof K)return new w.Inr(new w.Inr(new w.Inr(new w.Inr(new w.Inr(w.NoArguments.value)))));throw new Error("Failed pattern match at Ctl.Internal.Types.Interval (line 859, column 1 - line 859, column 47): "+[e.constructor.name])}},Y={show:D.genericShow(X)(D.genericShowSum(D.genericShowConstructor(D.genericShowArgsArgument(j))({reflectSymbol:function(){return"CannotFindTimeInEraSummaries"}}))(D.genericShowSum(D.genericShowConstructor(D.genericShowArgsArgument(J))({reflectSymbol:function(){return"PosixTimeBeforeSystemStart"}}))(D.genericShowSum(D.genericShowConstructor(D.genericShowArgsArgument(j))({reflectSymbol:function(){return"StartTimeGreaterThanTime"}}))(D.genericShowSum(D.genericShowConstructor(D.genericShowArgsProduct(D.genericShowArgsArgument(s.showSlot))(D.genericShowArgsArgument(G)))({reflectSymbol:function(){return"EndSlotLessThanSlotOrModNonZero"}}))(D.genericShowSum(D.genericShowConstructor(D.genericShowArgsNoArguments)({reflectSymbol:function(){return"CannotGetBigIntFromNumber'"}}))(D.genericShowConstructor(D.genericShowArgsNoArguments)({reflectSymbol:function(){return"CannotGetBigNumFromBigInt'"}})))))))},$={map:function(e){return function(n){if(n instanceof B)return new B(e(n.value0),e(n.value1));if(n instanceof N)return new N(e(n.value0));if(n instanceof L)return new L(e(n.value0));if(n instanceof _)return _.value;if(n instanceof U)return U.value;throw new Error("Failed pattern match at Ctl.Internal.Types.Interval (line 262, column 1 - line 262, column 33): "+[n.constructor.name])}}},ee=i.fromDataBigInt,ne=function(e){return function(n){if(n instanceof B)return r.apply(e.Apply0())(b.map(e.Apply0().Functor0())(B.create)(n.value0))(n.value1);if(n instanceof N)return b.map(e.Apply0().Functor0())(N.create)(n.value0);if(n instanceof L)return b.map(e.Apply0().Functor0())(L.create)(n.value0);if(n instanceof U)return t.pure(e)(U.value);if(n instanceof _)return t.pure(e)(_.value);throw new Error("Failed pattern match at Ctl.Internal.Types.Interval (line 1043, column 1 - line 1047, column 20): "+[n.constructor.name])}},te=function(e){return function(n){return function(t){return A.lessThanOrEq(e)(n)(t)?new B(n,t):U.value}}},re=h.wrap()(d.maxValue),oe=function(e){if(e instanceof B)return{validityStartInterval:t.pure(C.applicativeMaybe)(e.value0),timeToLive:b.map(C.functorMaybe)(h.wrap())(d.add(d.one)(h.unwrap()(e.value1)))};if(e instanceof N)return{validityStartInterval:C.Nothing.value,timeToLive:b.map(C.functorMaybe)(h.wrap())(d.add(d.one)(h.unwrap()(e.value0)))};if(e instanceof L)return{validityStartInterval:t.pure(C.applicativeMaybe)(e.value0),timeToLive:C.Nothing.value};if(e instanceof _)return{validityStartInterval:C.Nothing.value,timeToLive:C.Nothing.value};if(e instanceof U)return{validityStartInterval:t.pure(C.applicativeMaybe)(re),timeToLive:t.pure(C.applicativeMaybe)(h.wrap()(d.zero))};throw new Error("Failed pattern match at Ctl.Internal.Types.Interval (line 1089, column 1 - line 1091, column 29): "+[e.constructor.name])},ae=function(e){return h.unwrap()(h.unwrap()(e.parameters).slotLength)};n.always=function(e){return _.value},n.from=function(e){return function(e){return new L(e)}},n.intersection=function(e){return function(n){return function(t){for(var r,o,a,u,i=e,c=n,l=!1;!l;)o=i,u=t,r=(a=c)instanceof B&&u instanceof B?(l=!0,te(o)(A.max(o)(a.value0)(u.value0))(A.min(o)(a.value1)(u.value1))):a instanceof B&&u instanceof N?(l=!0,te(o)(a.value0)(A.min(o)(a.value1)(u.value0))):a instanceof B&&u instanceof L?(l=!0,te(o)(A.max(o)(a.value0)(u.value0))(a.value1)):a instanceof N&&u instanceof N?(l=!0,new N(A.min(o)(a.value0)(u.value0))):a instanceof N&&u instanceof L?(l=!0,te(o)(u.value0)(a.value0)):a instanceof L&&u instanceof L?(l=!0,new L(A.max(o)(a.value0)(u.value0))):a instanceof _?(l=!0,u):a instanceof U?(l=!0,U.value):(i=o,c=u,void(t=a));return r}}},n.isEmpty=function(e){return function(n){return n instanceof B?A.lessThan(e)(n.value1)(n.value0):n instanceof U}},n.posixTimeRangeToTransactionValidity=function(e){return function(n){var i,s=b.map(E.functorEffect)(b.map(g.functorEither)(oe)),f=(i=e,function(e){return function(n){return b.map(E.functorEffect)(ne(g.applicativeEither))(ne(E.applicativeEffect)(b.map($)(function(e){return function(n){return function(i){return u.runExceptT(o.bind(u.bindExceptT(E.monadEffect))(c.liftM(u.monadErrorExceptT(E.monadEffect))(W.value)(v.sysStartUnixTime(n)))((function(n){return o.discard(o.discardUnit)(u.bindExceptT(E.monadEffect))(t.unless(u.applicativeExceptT(E.monadEffect))(A.lessThanOrEq(p.ordBigInt)(n)(i))(a.throwError(u.monadThrowExceptT(E.monadEffect))(new q(i))))((function(){var s=h.wrap()(S.sub(p.ringBigInt)(i)(n));return o.bind(u.bindExceptT(E.monadEffect))(c.liftEither(u.monadErrorExceptT(E.monadEffect))(function(e){return function(n){return g.note(new H(n))(m.find((function(e){var t,r,o,a,u=p.toNumber(n);return h.unwrap()(h.unwrap()(e.start).time)*l.slotLengthFactor<=u&&C.maybe(!0)((t=A.lessThan(A.ordNumber)(u),r=I.mul(I.semiringNumber)(l.slotLengthFactor),o=h.unwrap(),a=h.unwrap(),function(e){return t(r(o(a(e).time)))}))(e.end)}))(e))}}(e)(s)))((function(e){return o.bind(u.bindExceptT(E.monadEffect))(c.liftEither(u.monadErrorExceptT(E.monadEffect))(function(e){return function(n){var r=h.unwrap()(h.unwrap()(e.start).time)*l.slotLengthFactor;return o.discard(o.discardUnit)(g.bindEither)(t.unless(g.applicativeEither)(r<=p.toNumber(n))(a.throwError(a.monadThrowEither)(new O(n))))((function(){var e=p.toNumber(n)-r;return b.map(g.functorEither)(h.wrap())(g.note(W.value)(p.fromNumber(x.trunc(e))))}))}}(e)(s)))((function(n){return o.bind(u.bindExceptT(E.monadEffect))(c.liftM(u.monadErrorExceptT(E.monadEffect))(W.value)((i=e,function(e){var n=ae(i),t=b.map(C.functorMaybe)(h.wrap())(p.fromNumber(x.trunc(p.toNumber(e)/n))),o=b.map(C.functorMaybe)(h.wrap())(p.fromNumber(x.remainder(p.toNumber(e))(n)));return r.apply(C.applyMaybe)(b.map(C.functorMaybe)(F.Tuple.create)(t))(o)})(n)))((function(n){return c.liftEither(u.monadErrorExceptT(E.monadEffect))(function(e){return function(n){var r,u,i=d.toBigInt(h.unwrap()(h.unwrap()(e.start).slot)),l=I.add(p.semiringBigInt)(i)(n.value0),s=C.maybe(I.add(p.semiringBigInt)(l)(I.one(p.semiringBigInt)))((r=h.unwrap(),u=h.unwrap(),function(e){return d.toBigInt(r(u(e).slot))}))(e.end);return o.bind(g.bindEither)(c.liftM(a.monadErrorEither)(K.value)(d.fromBigInt(l)))((function(e){return o.discard(o.discardUnit)(g.bindEither)(t.unless(g.applicativeEither)(A.lessThan(p.ordBigInt)(l)(s)||y.eq(p.eqBigInt)(l)(s)&&y.eq(p.eqBigInt)(n.value1)(I.zero(p.semiringBigInt)))(a.throwError(a.monadThrowEither)(new V(h.wrap()(e),n.value1))))((function(){return t.pure(g.applicativeEither)(h.wrap()(e))}))}))}}(e)(n))}));var i}))}))}))})))}}}(i)(e))(n)))}})(n);return function(e){return s(f(e))}}},n.slotToPosixTime=function(e){return function(n){return function(r){var i;return I.mul(p.semiringBigInt)(p.fromInt(1e3)),u.runExceptT(o.bind(u.bindExceptT(E.monadEffect))(c.liftEither(u.monadErrorExceptT(E.monadEffect))((i=e,function(e){var n=d.toBigInt(h.unwrap()(e));return g.note(new M(e))(m.find((function(e){return A.lessThanOrEq(p.ordBigInt)(d.toBigInt(h.unwrap()(h.unwrap()(e.start).slot)))(n)&&C.maybe(!0)((t=A.lessThan(p.ordBigInt)(n),r=h.unwrap(),o=h.unwrap(),function(e){return t(d.toBigInt(r(o(e).slot)))}))(e.end);var t,r,o}))(i))})(r)))((function(e){return o.bind(u.bindExceptT(E.monadEffect))(c.liftEither(u.monadErrorExceptT(E.monadEffect))(function(e){return function(n){var r=d.toBigInt(h.unwrap()(h.unwrap()(e.start).slot)),u=d.toBigInt(n);return o.discard(o.discardUnit)(g.bindEither)(t.unless(g.applicativeEither)(A.lessThanOrEq(p.ordBigInt)(r)(u))(a.throwError(a.monadThrowEither)(new R(n))))((function(){return t.pure(g.applicativeEither)(h.wrap()(S.sub(p.ringBigInt)(u)(r)))}))}}(e)(r)))((function(r){return o.bind(u.bindExceptT(E.monadEffect))(c.liftM(u.monadErrorExceptT(E.monadEffect))(k.value)((i=e,function(e){var n=ae(i);return b.map(C.functorMaybe)(h.wrap())(p.fromNumber(p.toNumber(e)*n))})(r)))((function(r){return o.bind(u.bindExceptT(E.monadEffect))(c.liftEither(u.monadErrorExceptT(E.monadEffect))(function(e){return function(n){var r,u,i,s=h.unwrap()(h.unwrap()(e.start).time)*l.slotLengthFactor+p.toNumber(n),f=C.maybe(s+1)((r=I.mul(I.semiringNumber)(l.slotLengthFactor),u=h.unwrap(),i=h.unwrap(),function(e){return r(u(i(e).time))}))(e.end);return o.discard(o.discardUnit)(g.bindEither)(t.unless(g.applicativeEither)(s<=f)(a.throwError(a.monadThrowEither)(new P(s))))((function(){return b.map(g.functorEither)(h.wrap())(c.liftM(a.monadErrorEither)(k.value)(p.fromNumber(s)))}))}}(e)(r)))((function(e){return o.bind(u.bindExceptT(E.monadEffect))(c.liftM(u.monadErrorExceptT(E.monadEffect))(k.value)(v.sysStartUnixTime(n)))((function(n){return t.pure(u.applicativeExceptT(E.monadEffect))(h.wrap()(I.add(p.semiringBigInt)(n)(h.unwrap()(e))))}))}))}));var i}))})))}}},n.showInterval=function(e){return function(n){return function(n){return{show:function(n){if(n instanceof B)return"(FiniteInterval "+T.show(e)(n.value0)+" "+T.show(e)(n.value1)+")";if(n instanceof N)return"(StartAt "+T.show(e)(n.value0)+")";if(n instanceof L)return"(EndAt "+T.show(e)(n.value0)+")";if(n instanceof _)return"AlwaysInterval";if(n instanceof U)return"EmptyInterval";throw new Error("Failed pattern match at Ctl.Internal.Types.Interval (line 264, column 1 - line 271, column 39): "+[n.constructor.name])}}}}},n.ordPOSIXTime=Z,n.semiringPOSIXTime=Q,n.fromDataPOSIXTime=ee,n.toDataPOSIXTime=z,n.showPOSIXTime=J,n.showPosixTimeToSlotError=Y}(c),function(e){"use strict";e["Ctl.Internal.Types.TxConstraints"]=e["Ctl.Internal.Types.TxConstraints"]||{};var n=e["Ctl.Internal.Types.TxConstraints"],t=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],r=e["Ctl.Internal.Plutus.Types.Value"],o=e["Data.Array"],a=e["Data.Eq"],u=e["Data.Functor"],i=e["Data.Map.Internal"],c=e["Data.Maybe"],l=e["Data.Monoid"],s=e["Data.Newtype"],f=e["Data.Semigroup"],d=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),v=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),m=function(){function e(){}return e.value=new e,e}(),p=function(){function e(){}return e.value=new e,e}(),g=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),y=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),b=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),w=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),C=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),h=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),A=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),S=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),I=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),T=function(){function e(e,n,t,r,o){this.value0=e,this.value1=n,this.value2=t,this.value3=r,this.value4=o}return e.create=function(n){return function(t){return function(r){return function(o){return function(a){return new e(n,t,r,o,a)}}}}},e}(),D=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),F=function(){function e(e,n,t,r,o){this.value0=e,this.value1=n,this.value2=t,this.value3=r,this.value4=o}return e.create=function(n){return function(t){return function(r){return function(o){return function(a){return new e(n,t,r,o,a)}}}}},e}(),E=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),x=function(){function e(e,n,t,r,o,a){this.value0=e,this.value1=n,this.value2=t,this.value3=r,this.value4=o,this.value5=a}return e.create=function(n){return function(t){return function(r){return function(o){return function(a){return function(u){return new e(n,t,r,o,a,u)}}}}}},e}(),M=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),R=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),P=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),k=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),B=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),N=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),L=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),_=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),U=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),H=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),q=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),O=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),V=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),W=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),K=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),z=function(){function e(){}return e.value=new e,e}(),J=function(e){return e},G=f.semigroupRecord()(f.semigroupRecordCons({reflectSymbol:function(){return"constraints"}})()(f.semigroupRecordCons({reflectSymbol:function(){return"ownInputs"}})()(f.semigroupRecordCons({reflectSymbol:function(){return"ownOutputs"}})()(f.semigroupRecordNil)(f.semigroupArray))(f.semigroupArray))(f.semigroupArray)),j=l.monoidRecord()(l.monoidRecordCons({reflectSymbol:function(){return"constraints"}})(l.monoidArray)()(l.monoidRecordCons({reflectSymbol:function(){return"ownInputs"}})(l.monoidArray)()(l.monoidRecordCons({reflectSymbol:function(){return"ownOutputs"}})(l.monoidArray)()(l.monoidRecordNil)))),Q={eq:function(e){return function(n){return e instanceof m&&n instanceof m||e instanceof p&&n instanceof p}}},Z=function(e){return s.over()()(J)((function(n){return{constraints:o.singleton(e),ownInputs:n.ownInputs,ownOutputs:n.ownOutputs}}))(l.mempty(j))};n.DatumInline=m,n.DatumWitness=p,n.RefInput=d,n.SpendInput=v,n.MustBeSignedBy=b,n.MustDelegateStakePlutusScript=H,n.MustDelegateStakeNativeScript=q,n.MustDelegateStakePubKey=U,n.MustDeregisterStakePlutusScript=B,n.MustDeregisterStakeNativeScript=N,n.MustDeregisterStakePubKey=P,n.MustHashDatum=M,n.MustIncludeDatum=g,n.MustMintValue=T,n.MustMintValueUsingNativeScript=D,n.MustNotBeValid=z,n.MustPayToNativeScript=E,n.MustPayToPubKeyAddress=F,n.MustPayToScript=x,n.MustProduceAtLeast=C,n.MustReferenceOutput=I,n.MustRegisterPool=L,n.MustRegisterStakePubKey=R,n.MustRegisterStakeScript=k,n.MustRetirePool=_,n.MustSatisfyAnyOf=K,n.MustSpendAtLeast=w,n.MustSpendNativeScriptOutput=A,n.MustSpendPubKeyOutput=h,n.MustSpendScriptOutput=S,n.MustValidateIn=y,n.MustWithdrawStakePlutusScript=V,n.MustWithdrawStakeNativeScript=W,n.MustWithdrawStakePubKey=O,n.mustBeSignedBy=function(e){return Z(b.create(e))},n.mustMintCurrencyWithRedeemerUsingScriptRef=function(e){return function(n){return function(t){return function(r){var o=T.create(e)(n)(t)(r);return function(e){return Z(o(c.Just.create(e)))}}}}},n.mustMintValueWithRedeemer=function(e){var n=o.fold(j),a=u.map(u.functorArray)((function(n){var r,o=t.currencyMPSHash(n.value0);return(r=o,function(e){return function(n){return function(t){return Z(new T(r,e,n,t,c.Nothing.value))}}})(e)(n.value1.value0)(n.value1.value1)}));return function(e){return n(a(r.flattenNonAdaAssets(e)))}},n.mustPayToPubKeyAddress=function(e){return function(n){var t=F.create(e)(new c.Just(n))(c.Nothing.value)(c.Nothing.value);return function(e){return Z(t(e))}}},n.mustPayToScriptAddress=function(e){return function(n){return function(t){return function(r){return function(o){return f.append(G)(Z(new x(e,new c.Just(n),t,r,c.Nothing.value,o)))(l.guard(j)(a.eq(Q)(r)(p.value))(Z(new g(t))))}}}}},n.mustReferenceOutput=function(e){return Z(I.create(e))},n.mustSpendPubKeyOutput=function(e){return Z(h.create(e))},n.mustSpendScriptOutputUsingScriptRef=function(e){return function(n){var t=S.create(e)(n);return function(e){return Z(t(c.Just.create(e)))}}},n.mustValidateIn=function(e){return Z(y.create(e))},n.utxoWithScriptRef=function(e){var n=function(){if(e instanceof d)return e.value0;if(e instanceof v)return e.value0;throw new Error("Failed pattern match at Ctl.Internal.Types.TxConstraints (line 227, column 5 - line 229, column 42): "+[e.constructor.name])}();return i.singleton(n.input)(n.output)},n.eqDatumPresence=Q,n.semigroupTxConstraints=G}(c),function(e){"use strict";e["Ctl.Internal.Types.TypedTxOut"]=e["Ctl.Internal.Types.TypedTxOut"]||{};var n=e["Ctl.Internal.Types.TypedTxOut"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Error.Class"],a=e["Control.Monad.Except.Trans"],u=e["Ctl.Internal.Contract.Monad"],i=e["Ctl.Internal.Contract.QueryHandle"],c=e["Ctl.Internal.FromData"],l=e["Ctl.Internal.Hashing"],s=e["Ctl.Internal.Helpers"],f=e["Ctl.Internal.Scripts"],d=e["Ctl.Internal.Serialization.Address"],v=e["Ctl.Internal.ToData"],m=e["Ctl.Internal.Types.OutputDatum"],p=e["Ctl.Internal.Types.PlutusData"],g=e["Ctl.Internal.Types.Transaction"],y=e["Data.Either"],b=e["Data.Eq"],w=e["Data.Functor"],C=e["Data.Generic.Rep"],h=e["Data.Maybe"],A=e["Data.Newtype"],S=e["Data.Show.Generic"],I=e["Effect.Aff"],T=e["Effect.Aff.Class"],D=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),F=function(){function e(){}return e.value=new e,e}(),E=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),x=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),M=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),R=function(){function e(){}return e.value=new e,e}(),P=function(){function e(){}return e.value=new e,e}(),k={to:function(e){if(e instanceof C.Inl)return new D(e.value0.value0,e.value0.value1);if(e instanceof C.Inr&&e.value0 instanceof C.Inl)return F.value;if(e instanceof C.Inr&&e.value0 instanceof C.Inr&&e.value0.value0 instanceof C.Inl)return new E(e.value0.value0.value0);if(e instanceof C.Inr&&e.value0 instanceof C.Inr&&e.value0.value0 instanceof C.Inr&&e.value0.value0.value0 instanceof C.Inl)return new x(e.value0.value0.value0.value0);if(e instanceof C.Inr&&e.value0 instanceof C.Inr&&e.value0.value0 instanceof C.Inr&&e.value0.value0.value0 instanceof C.Inr&&e.value0.value0.value0.value0 instanceof C.Inl)return new M(e.value0.value0.value0.value0.value0);if(e instanceof C.Inr&&e.value0 instanceof C.Inr&&e.value0.value0 instanceof C.Inr&&e.value0.value0.value0 instanceof C.Inr&&e.value0.value0.value0.value0 instanceof C.Inr&&e.value0.value0.value0.value0.value0 instanceof C.Inl)return R.value;if(e instanceof C.Inr&&e.value0 instanceof C.Inr&&e.value0.value0 instanceof C.Inr&&e.value0.value0.value0 instanceof C.Inr&&e.value0.value0.value0.value0 instanceof C.Inr&&e.value0.value0.value0.value0.value0 instanceof C.Inr)return P.value;throw new Error("Failed pattern match at Ctl.Internal.Types.TypedTxOut (line 209, column 1 - line 209, column 41): "+[e.constructor.name])},from:function(e){if(e instanceof D)return new C.Inl(new C.Product(e.value0,e.value1));if(e instanceof F)return new C.Inr(new C.Inl(C.NoArguments.value));if(e instanceof E)return new C.Inr(new C.Inr(new C.Inl(e.value0)));if(e instanceof x)return new C.Inr(new C.Inr(new C.Inr(new C.Inl(e.value0))));if(e instanceof M)return new C.Inr(new C.Inr(new C.Inr(new C.Inr(new C.Inl(e.value0)))));if(e instanceof R)return new C.Inr(new C.Inr(new C.Inr(new C.Inr(new C.Inr(new C.Inl(C.NoArguments.value))))));if(e instanceof P)return new C.Inr(new C.Inr(new C.Inr(new C.Inr(new C.Inr(new C.Inr(C.NoArguments.value))))));throw new Error("Failed pattern match at Ctl.Internal.Types.TypedTxOut (line 209, column 1 - line 209, column 41): "+[e.constructor.name])}},B={show:S.genericShow(k)(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsProduct(S.genericShowArgsArgument(d.showAddress))(S.genericShowArgsArgument(d.showAddress)))({reflectSymbol:function(){return"WrongValidatorAddress"}}))(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsNoArguments)({reflectSymbol:function(){return"ExpectedScriptGotPubkey"}}))(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsArgument(p.showPlutusData))({reflectSymbol:function(){return"WrongRedeemerType"}}))(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsArgument(p.showPlutusData))({reflectSymbol:function(){return"WrongDatumType"}}))(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsArgument(g.showDataHash))({reflectSymbol:function(){return"CannotQueryDatum"}}))(S.genericShowSum(S.genericShowConstructor(S.genericShowArgsNoArguments)({reflectSymbol:function(){return"CannotMakeTypedTxOut"}}))(S.genericShowConstructor(S.genericShowArgsNoArguments)({reflectSymbol:function(){return"UnknownRef"}}))))))))},N=function(){return function(e){return function(n){return function(t){return function(r){return function(o){var a,u=l.datumHash(v.toData(e)(r)),i=f.typedValidatorEnterpriseAddress(n)(t);return(a=r,function(e){return{txOut:e,data:a}})(A.wrap()({address:i,amount:o,datum:new m.OutputDatumHash(u),scriptRef:h.Nothing.value}))}}}}}};n.mkTypedTxOut=N,n.typeTxOutRef=function(){return function(e){return function(n){return function(l){return function(v){return function(p){return a.runExceptT(r.bind(a.bindExceptT(u.monadContract))(s.liftM(a.monadErrorExceptT(u.monadContract))(P.value)(l(p)))((function(l){return r.bind(a.bindExceptT(u.monadContract))(function(e){return function(n){return function(l){return function(v){return r.bind(u.bindContract)(i.getQueryHandle)((function(i){return a.runExceptT(r.bind(a.bindExceptT(u.monadContract))(s.liftM(a.monadErrorExceptT(u.monadContract))(F.value)(m.outputDatumDataHash(v.datum)))((function(m){return r.discard(r.discardUnit)(a.bindExceptT(u.monadContract))(w.void(a.functorExceptT(u.functorContract))((p=a.monadExceptT(u.monadContract),function(e){return function(n){return function(r){return a.runExceptT((u=f.typedValidatorEnterpriseAddress(e)(n),t.unless(a.applicativeExceptT(p))(b.eq(d.eqAddress)(u)(r))(o.throwError(a.monadThrowExceptT(p))(new D(u,r)))));var u}}})(n)(l)(v.address)))((function(){return r.bind(a.bindExceptT(u.monadContract))(T.liftAff(u.monadAffContract)(w.mapFlipped(I.functorAff)(i.getDatumByHash(m))((o=y.note(new M(m)),f=r.join(h.bindMaybe),function(e){return o(f(y.hush(e)))}))))((function(o){return r.bind(a.bindExceptT(u.monadContract))(function(e){return function(){return function(n){return function(t){return function(t){return a.runExceptT(s.liftM(a.monadErrorExceptT(e))(new x(t))(c.fromData(n)(t)))}}}}}(u.monadContract)()(e.FromData0())(l)(o))((function(r){return t.pure(a.applicativeExceptT(u.monadContract))(N()(e.ToData1())(n)(l)(r)(v.amount))}))}));var o,f}));var p})))}))}}}}(e)(n)(v)(l))((function(e){return t.pure(a.applicativeExceptT(u.monadContract))({txOutRef:p,typedTxOut:e})}))})))}}}}}},n.typedTxOutDatumHash=function(){return function(e){return m.outputDatumDataHash(A.unwrap()(e.txOut).datum)}},n.typedTxOutRefValue=function(){return function(e){return function(e){return A.unwrap()(e.txOut).amount}(e.typedTxOut)}},n.typedTxOutTxOut=function(){return function(e){return e.txOut}},n.showTypeCheckError=B}(c),function(e){"use strict";e["Ctl.Internal.Types.UnbalancedTransaction"]=e["Ctl.Internal.Types.UnbalancedTransaction"]||{};var n=e["Ctl.Internal.Types.UnbalancedTransaction"],t=e["Ctl.Internal.Cardano.Types.Transaction"],r=e["Ctl.Internal.Types.Transaction"],o=e["Data.Lens.Lens"],a=e["Data.Map.Internal"],u=e["Data.Monoid"],i=e["Data.Show"],c=e["Data.Show.Generic"],l=e["Data.Tuple"],s={show:c.genericShow({to:function(e){return e},from:function(e){return e}})(c.genericShowConstructor(c.genericShowArgsArgument(i.showRecord()(i.showRecordFieldsCons({reflectSymbol:function(){return"transaction"}})(i.showRecordFieldsCons({reflectSymbol:function(){return"utxoIndex"}})(i.showRecordFieldsNil)(a.showMap(r.showTransactionInput)(t.showTransactionOutput)))(t.showTransaction))))({reflectSymbol:function(){return"UnbalancedTx"}}))},f={transaction:u.mempty(t.monoidTransaction),utxoIndex:a.empty};n._transaction=function(e){return o["lens'"]((function(e){return new l.Tuple(e.transaction,(function(n){return{transaction:n,utxoIndex:e.utxoIndex}}))}))(e)},n._utxoIndex=function(e){return o["lens'"]((function(e){return new l.Tuple(e.utxoIndex,(function(n){return{transaction:e.transaction,utxoIndex:n}}))}))(e)},n.emptyUnbalancedTx=f,n.showUnbalancedTx=s}(c),function(e){"use strict";e["Data.Lens.Getter"]=e["Data.Lens.Getter"]||{};var n=e["Data.Lens.Getter"],t=e["Control.Category"],r=e["Control.Monad.State.Class"],o=e["Data.Newtype"],a=function(e){return o.unwrap()(e(t.identity(t.categoryFn)))},u=function(e){return function(n){return a(n)(e)}};n.viewOn=u,n.view=a,n.to=function(e){return function(n){var t=o.unwrap()(n);return function(n){return t(e(n))}}},n.use=function(e){return function(n){return r.gets(e)((function(e){return u(e)(n)}))}}}(c),function(e){"use strict";e["Data.Lens.Internal.Forget"]=e["Data.Lens.Internal.Forget"]||{};var n=e["Data.Lens.Internal.Forget"],t=e["Data.Tuple"],r={dimap:function(e){return function(n){return function(n){return function(t){return n(e(t))}}}}},o={first:function(e){return function(n){return e(t.fst(n))}},second:function(e){return function(n){return e(t.snd(n))}},Profunctor0:function(){return r}};n.profunctorForget=r,n.strongForget=o}(c),function(e){"use strict";e["Ctl.Internal.Types.ScriptLookups"]=e["Ctl.Internal.Types.ScriptLookups"]||{};var n,t,r,o=e["Ctl.Internal.Types.ScriptLookups"],a=e["Control.Applicative"],u=e["Control.Apply"],i=e["Control.Bind"],c=e["Control.Monad.Error.Class"],l=e["Control.Monad.Except.Trans"],s=e["Control.Monad.Reader.Class"],f=e["Control.Monad.State.Class"],d=e["Control.Monad.State.Trans"],v=e["Control.Monad.Trans.Class"],m=e["Ctl.Internal.Address"],p=e["Ctl.Internal.Cardano.Types.ScriptRef"],g=e["Ctl.Internal.Cardano.Types.Transaction"],y=e["Ctl.Internal.Cardano.Types.Value"],b=e["Ctl.Internal.Contract"],w=e["Ctl.Internal.Contract.Monad"],C=e["Ctl.Internal.Contract.QueryHandle"],h=e["Ctl.Internal.Hashing"],A=e["Ctl.Internal.Helpers"],S=e["Ctl.Internal.NativeScripts"],I=e["Ctl.Internal.Plutus.Conversion"],T=e["Ctl.Internal.Plutus.Conversion.Value"],D=e["Ctl.Internal.Plutus.Types.Credential"],F=e["Ctl.Internal.QueryM.Pools"],E=e["Ctl.Internal.Scripts"],x=e["Ctl.Internal.Serialization.Address"],M=e["Ctl.Internal.Serialization.Hash"],R=e["Ctl.Internal.Service.Error"],P=e["Ctl.Internal.Transaction"],k=e["Ctl.Internal.Types.Datum"],B=e["Ctl.Internal.Types.Interval"],N=e["Ctl.Internal.Types.OutputDatum"],L=e["Ctl.Internal.Types.PubKeyHash"],_=e["Ctl.Internal.Types.RedeemerTag"],U=e["Ctl.Internal.Types.RewardAddress"],H=e["Ctl.Internal.Types.Scripts"],q=e["Ctl.Internal.Types.TokenName"],O=e["Ctl.Internal.Types.Transaction"],V=e["Ctl.Internal.Types.TxConstraints"],W=e["Ctl.Internal.Types.TypedTxOut"],K=e["Ctl.Internal.Types.UnbalancedTransaction"],z=e["Data.Array"],J=e["Data.Bifunctor"],G=e["Data.BigInt"],j=e["Data.Either"],Q=e["Data.Eq"],Z=e["Data.Foldable"],X=e["Data.Function"],Y=e["Data.Functor"],$=e["Data.Generic.Rep"],ee=e["Data.Lattice"],ne=e["Data.Lens.Getter"],te=e["Data.Lens.Internal.Forget"],re=e["Data.Lens.Iso"],oe=e["Data.Lens.Iso.Newtype"],ae=e["Data.Lens.Record"],ue=e["Data.Lens.Setter"],ie=e["Data.List.Types"],ce=e["Data.Map.Internal"],le=e["Data.Maybe"],se=e["Data.Monoid"],fe=e["Data.Newtype"],de=e["Data.Ord"],ve=e["Data.Profunctor"],me=e["Data.Profunctor.Strong"],pe=e["Data.Ring"],ge=e["Data.Semigroup"],ye=e["Data.Semiring"],be=e["Data.Set"],we=e["Data.Show"],Ce=e["Data.Show.Generic"],he=e["Data.Symbol"],Ae=e["Data.Traversable"],Se=e["Data.Tuple"],Ie=e["Data.Unfoldable"],Te=e["Data.Unit"],De=e.Effect,Fe=e["Effect.Aff"],Ee=e["Effect.Aff.Class"],xe=e["Effect.Class"],Me=e["Effect.Exception"],Re=e["Type.Proxy"],Pe=function(e){return e},ke=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Be=function(){function e(){}return e.value=new e,e}(),Ne=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Le=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),_e=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),Ue=function(){function e(){}return e.value=new e,e}(),He=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),qe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Oe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ve=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),We=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),Ke=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),ze=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Je=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ge=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),je=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),Qe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ze=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Xe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),Ye=function(){function e(){}return e.value=new e,e}(),$e=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),en=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),nn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),tn=function(){function e(){}return e.value=new e,e}(),rn=function(){function e(){}return e.value=new e,e}(),on=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),an=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),un=function(){function e(){}return e.value=new e,e}(),cn=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),ln=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),sn={append:function(e){return function(n){return{required:ee.join(y.joinSemilatticeValue)(e.required)(n.required),provided:ee.join(y.joinSemilatticeValue)(e.provided)(n.provided)}}}},fn={append:function(e){return function(n){return{mps:z.union(H.eqMintingPolicy)(e.mps)(n.mps),txOutputs:ce.union(O.ordTransactionInput)(e.txOutputs)(n.txOutputs),scripts:z.union(H.eqValidator)(e.scripts)(n.scripts),datums:ce.union(O.ordDataHash)(e.datums)(n.datums),paymentPubKeyHashes:ce.union(L.ordPaymentPubKeyHash)(e.paymentPubKeyHashes)(n.paymentPubKeyHashes),typedValidator:A.appendFirstMaybe(e.typedValidator)(n.typedValidator),ownPaymentPubKeyHash:A.appendFirstMaybe(e.ownPaymentPubKeyHash)(n.ownPaymentPubKeyHash),ownStakePubKeyHash:A.appendFirstMaybe(e.ownStakePubKeyHash)(n.ownStakePubKeyHash)}}}},dn={mempty:{mps:se.mempty(se.monoidArray),txOutputs:ce.empty,scripts:se.mempty(se.monoidArray),datums:ce.empty,paymentPubKeyHashes:ce.empty,typedValidator:le.Nothing.value,ownPaymentPubKeyHash:le.Nothing.value,ownStakePubKeyHash:le.Nothing.value},Semigroup0:function(){return fn}},vn={show:Ce.genericShow({to:function(e){return e},from:function(e){return e}})(Ce.genericShowConstructor(Ce.genericShowArgsArgument(we.showRecord()(we.showRecordFieldsCons({reflectSymbol:function(){return"datums"}})(we.showRecordFieldsCons({reflectSymbol:function(){return"redeemersTxIns"}})(we.showRecordFieldsCons({reflectSymbol:function(){return"unbalancedTx"}})(we.showRecordFieldsNil)(K.showUnbalancedTx))(we.showArray(Se.showTuple(g.showRedeemer)(le.showMaybe(O.showTransactionInput)))))(we.showArray(k.showDatum)))))({reflectSymbol:function(){return"UnattachedUnbalancedTx"}}))},mn={to:function(e){if(e instanceof $.Inl)return new ke(e.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inl)return Be.value;if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inl)return new Ne(e.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inl)return new Le(e.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value1);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inl)return new _e(e.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value1);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inl)return Ue.value;if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new He(e.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new qe(e.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Oe(e.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Ve(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new We(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1.value1);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Ke(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new ze(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Je(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Ge(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new je(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Qe(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Ze(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new Xe(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return Ye.value;if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new $e(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new en(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new nn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return tn.value;if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return rn.value;if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new on(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new an(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return un.value;if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inl)return new cn(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof $.Inr&&e.value0 instanceof $.Inr&&e.value0.value0 instanceof $.Inr&&e.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof $.Inr)return new ln(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1);throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 922, column 1 - line 922, column 46): "+[e.constructor.name])},from:function(e){if(e instanceof ke)return new $.Inl(e.value0);if(e instanceof Be)return new $.Inr(new $.Inl($.NoArguments.value));if(e instanceof Ne)return new $.Inr(new $.Inr(new $.Inl(e.value0)));if(e instanceof Le)return new $.Inr(new $.Inr(new $.Inr(new $.Inl(new $.Product(e.value0,e.value1)))));if(e instanceof _e)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(new $.Product(e.value0,e.value1))))));if(e instanceof Ue)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl($.NoArguments.value))))));if(e instanceof He)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))));if(e instanceof qe)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))));if(e instanceof Oe)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))));if(e instanceof Ve)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))))));if(e instanceof We)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(new $.Product(e.value0,new $.Product(e.value1,e.value2)))))))))))));if(e instanceof Ke)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))))))));if(e instanceof ze)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))));if(e instanceof Je)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))))))))));if(e instanceof Ge)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))));if(e instanceof je)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(new $.Product(e.value0,e.value1)))))))))))))))));if(e instanceof Qe)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))))));if(e instanceof Ze)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))))))))))))));if(e instanceof Xe)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))))))));if(e instanceof Ye)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl($.NoArguments.value))))))))))))))))))));if(e instanceof $e)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))))))))));if(e instanceof en)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))))))))))))))))));if(e instanceof nn)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))))))))))));if(e instanceof tn)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl($.NoArguments.value))))))))))))))))))))))));if(e instanceof rn)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl($.NoArguments.value)))))))))))))))))))))))));if(e instanceof on)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0))))))))))))))))))))))))));if(e instanceof an)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))))))))))))))));if(e instanceof un)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl($.NoArguments.value))))))))))))))))))))))))))));if(e instanceof cn)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inl(e.value0)))))))))))))))))))))))))))));if(e instanceof ln)return new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Inr(new $.Product(e.value0,e.value1))))))))))))))))))))))))))))));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 922, column 1 - line 922, column 46): "+[e.constructor.name])}},pn={show:Ce.genericShow(mn)(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(L.showPaymentPubKeyHash))({reflectSymbol:function(){return"CannotConvertPaymentPubKeyHash"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsNoArguments)({reflectSymbol:function(){return"CannotFindDatum"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(O.showDataHash))({reflectSymbol:function(){return"CannotQueryDatum"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsProduct(Ce.genericShowArgsArgument(B.showInterval(B.showPOSIXTime)(B.ordPOSIXTime)(B.semiringPOSIXTime)))(Ce.genericShowArgsArgument(B.showPosixTimeToSlotError)))({reflectSymbol:function(){return"CannotConvertPOSIXTimeRange"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsProduct(Ce.genericShowArgsArgument(B.showInterval(B.showPOSIXTime)(B.ordPOSIXTime)(B.semiringPOSIXTime)))(Ce.genericShowArgsArgument(B.showInterval(B.showPOSIXTime)(B.ordPOSIXTime)(B.semiringPOSIXTime))))({reflectSymbol:function(){return"CannotSolveTimeConstraints"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsNoArguments)({reflectSymbol:function(){return"CannotGetMintingPolicyScriptIndex"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(x.showAddress))({reflectSymbol:function(){return"CannotGetValidatorHashFromAddress"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(k.showDatum))({reflectSymbol:function(){return"CannotHashDatum"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(H.showMintingPolicy))({reflectSymbol:function(){return"CannotHashMintingPolicy"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(H.showValidator))({reflectSymbol:function(){return"CannotHashValidator"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsProduct(Ce.genericShowArgsArgument(y.showCurrencySymbol))(Ce.genericShowArgsProduct(Ce.genericShowArgsArgument(q.showTokenName))(Ce.genericShowArgsArgument(G.showBigInt))))({reflectSymbol:function(){return"CannotMakeValue"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(L.showStakePubKeyHash))({reflectSymbol:function(){return"CannotWithdrawRewardsPubKey"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(H.showPlutusScriptStakeVali))({reflectSymbol:function(){return"CannotWithdrawRewardsPlutusScript"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(H.showNativeScriptStakeVali))({reflectSymbol:function(){return"CannotWithdrawRewardsNativeScript"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(O.showDataHash))({reflectSymbol:function(){return"DatumNotFound"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsProduct(Ce.genericShowArgsArgument(O.showDataHash))(Ce.genericShowArgsArgument(k.showDatum)))({reflectSymbol:function(){return"DatumWrongHash"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(H.showMintingPolicyHash))({reflectSymbol:function(){return"MintingPolicyHashNotCurrencySymbol"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(H.showMintingPolicyHash))({reflectSymbol:function(){return"MintingPolicyNotFound"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(P.showModifyTxError))({reflectSymbol:function(){return"ModifyTx"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsNoArguments)({reflectSymbol:function(){return"OwnPubKeyAndStakeKeyMissing"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(O.showTransactionInput))({reflectSymbol:function(){return"TxOutRefNotFound"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(O.showTransactionInput))({reflectSymbol:function(){return"TxOutRefWrongType"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(W.showTypeCheckError))({reflectSymbol:function(){return"TypeCheckFailed"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsNoArguments)({reflectSymbol:function(){return"TypedTxOutHasNoDatumHash"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsNoArguments)({reflectSymbol:function(){return"TypedValidatorMissing"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(H.showValidatorHash))({reflectSymbol:function(){return"ValidatorHashNotFound"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(le.showMaybe(M.showScriptHash)))({reflectSymbol:function(){return"WrongRefScriptHash"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsNoArguments)({reflectSymbol:function(){return"CannotSatisfyAny"}}))(Ce.genericShowSum(Ce.genericShowConstructor(Ce.genericShowArgsArgument(H.showMintingPolicyHash))({reflectSymbol:function(){return"ExpectedPlutusScriptGotNativeScript"}}))(Ce.genericShowConstructor(Ce.genericShowArgsProduct(Ce.genericShowArgsArgument(y.showCurrencySymbol))(Ce.genericShowArgsArgument(q.showTokenName)))({reflectSymbol:function(){return"CannotMintZero"}})))))))))))))))))))))))))))))))},gn=function(e){return{required:e,provided:se.mempty(y.monoidValue)}},yn=function(e){return{provided:e,required:se.mempty(y.monoidValue)}},bn=function(e){var n=ge.append(y.semigroupValue)(e.required)(y.negation(y.negateValue)(e.provided));return y.split(y.splitValue)(n).value1},wn=function(e){if(e instanceof D.PubKeyCredential)return x.keyHashCredential(fe.unwrap()(e.value0));if(e instanceof D.ScriptCredential)return x.scriptHashCredential(fe.unwrap()(e.value0));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1453, column 36 - line 1455, column 74): "+[e.constructor.name])},Cn=function(e){return ae.prop({reflectSymbol:function(){return"valueSpentBalancesOutputs"}})()()(he.SProxy.value)(e)},hn=function(e){return ae.prop({reflectSymbol:function(){return"valueSpentBalancesInputs"}})()()(he.SProxy.value)(e)},An=function(e){return ae.prop({reflectSymbol:function(){return"unbalancedTx"}})()()(he.SProxy.value)(e)},Sn=function(e){return function(n){return i.bind(d.bindStateT(w.monadContract))(ne.use(d.monadStateStateT(w.monadContract))((t=An(te.strongForget),r=K._transaction(te.strongForget),function(e){return t(r(e))})))((function(t){return i.bind(d.bindStateT(w.monadContract))(xe.liftEffect(d.monadEffectState(w.monadEffectContract))(Y.mapFlipped(De.functorEffect)(e(n)(t))(J.lmap(J.bifunctorEither)(Xe.create))))((function(e){return j.either((u=a.pure(d.applicativeStateT(w.monadContract)),i=c.throwError(c.monadThrowEither),function(e){return u(i(e))}))((r=Y.map(d.functorStateT(w.functorContract))(j.Right.create),o=ue.assign(d.monadStateStateT(w.monadContract))((n=An(me.strongFn),t=K._transaction(me.strongFn),function(e){return n(t(e))})),function(e){return r(o(e))}))(e);var n,t,r,o,u,i}))}));var t,r}},In=function(e){return ae.prop({reflectSymbol:function(){return"refScriptsUtxoMap"}})()()(he.SProxy.value)(e)},Tn=function(e){return ae.prop({reflectSymbol:function(){return"redeemersTxIns"}})()()(he.SProxy.value)(e)},Dn=function(e){return ae.prop({reflectSymbol:function(){return"mintRedeemers"}})()()(he.SProxy.value)(e)},Fn=function(e){return ae.prop({reflectSymbol:function(){return"lookups"}})()()(he.SProxy.value)(e)},En=function(e){return ae.prop({reflectSymbol:function(){return"datums"}})()()(he.SProxy.value)(e)},xn=function(e){return l.runExceptT(i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(Sn(P.attachDatum)(e))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(ge.semigroupArray)(En(me.strongFn))(z.singleton(e))})))},Mn=function(e){var n=An(e),t=K._transaction(e);return function(e){return n(t(e))}},Rn=function(e){var n=Mn(e),t=g._body(e);return function(e){return n(t(e))}},Pn=function(e){return i.bind(d.bindStateT(w.monadContract))(f.gets(d.monadStateStateT(w.monadContract))(ne.view((n=Rn(te.strongForget),t=g._certs(te.strongForget),r=re.non(Q.eqArray(g.eqCertificate))([])(te.profunctorForget),o=ne.to(z.length),function(e){return n(t(r(o(e))))}))))((function(n){return i.discard(i.discardUnit)(d.bindStateT(w.monadContract))(ue.modifying(d.monadStateStateT(w.monadContract))((t=Rn(me.strongFn),r=g._certs(me.strongFn),o=re.non(Q.eqArray(g.eqCertificate))([])(ve.profunctorFn),function(e){return t(r(o(e)))}))(z.cons(e)))((function(){return a.pure(d.applicativeStateT(w.monadContract))(n)}));var t,r,o}));var n,t,r,o},kn=i.bind(d.bindStateT(w.monadContract))(ne.use(d.monadStateStateT(w.monadContract))((n=Rn(te.strongForget),t=g._networkId(te.strongForget),function(e){return n(t(e))})))(le.maybe(s.asks(d.monadAskStateT(w.monadAskContractEnvContra))((function(e){return e.networkId})))(a.pure(d.applicativeStateT(w.monadContract)))),Bn=i.bind(d.bindStateT(w.monadContract))(f.gets(d.monadStateStateT(w.monadContract))((function(e){return ee.join(y.joinSemilatticeValue)(bn(e.valueSpentBalancesInputs))(bn(e.valueSpentBalancesOutputs))})))((function(e){return i.bind(d.bindStateT(w.monadContract))(kn)((function(n){return y.isZero(e)?a.pure(d.applicativeStateT(w.monadContract))(new j.Right(Te.unit)):l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(Y.mapFlipped(l.functorExceptT(d.functorStateT(w.functorContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(Fn(te.strongForget)))(fe.unwrap()))((function(t){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(function(){if(t.ownPaymentPubKeyHash instanceof le.Nothing&&t.ownStakePubKeyHash instanceof le.Nothing)return c.throwError(l.monadThrowExceptT(d.monadStateT(w.monadContract)))(Ye.value);if(t.ownPaymentPubKeyHash instanceof le.Just&&t.ownStakePubKeyHash instanceof le.Just)return a.pure(l.applicativeExceptT(d.monadStateT(w.monadContract)))({address:L.payPubKeyHashBaseAddress(n)(t.ownPaymentPubKeyHash.value0)(t.ownStakePubKeyHash.value0),amount:e,datum:N.NoOutputDatum.value,scriptRef:le.Nothing.value});if(t.ownPaymentPubKeyHash instanceof le.Just&&t.ownStakePubKeyHash instanceof le.Nothing)return a.pure(l.applicativeExceptT(d.monadStateT(w.monadContract)))({address:L.payPubKeyHashEnterpriseAddress(n)(t.ownPaymentPubKeyHash.value0),amount:e,datum:N.NoOutputDatum.value,scriptRef:le.Nothing.value});if(t.ownPaymentPubKeyHash instanceof le.Nothing&&t.ownStakePubKeyHash instanceof le.Just)return a.pure(l.applicativeExceptT(d.monadStateT(w.monadContract)))({address:L.stakePubKeyHashRewardAddress(n)(t.ownStakePubKeyHash.value0),amount:e,datum:N.NoOutputDatum.value,scriptRef:le.Nothing.value});throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 763, column 14 - line 782, column 10): "+[t.ownPaymentPubKeyHash.constructor.name,t.ownStakePubKeyHash.constructor.name])}())((function(e){return ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((n=Rn(me.strongFn),t=g._outputs(me.strongFn),function(e){return n(t(e))}))(z.cons(e));var n,t}))})))}))})),Nn=function(e){var n=function(e){return Y.map(d.functorStateT(w.functorContract))(X.flip(I.fromPlutusTxOutputWithRefScript)(e))(kn)};return function(t){if(t instanceof le.Just)return le.maybe(Nn(e)(le.Nothing.value))((r=Y.map(d.functorStateT(w.functorContract))(j.Right.create),function(e){return r(n(e))}))(ce.lookup(O.ordTransactionInput)(e)(V.utxoWithScriptRef(t.value0)));var r,o;if(t instanceof le.Nothing)return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(Y.mapFlipped(l.functorExceptT(d.functorStateT(w.functorContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(Fn(te.strongForget)))((o=fe.unwrap(),function(e){return o(e).txOutputs})))((function(t){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(w.monadContract)))(new $e(e))(ce.lookup(O.ordTransactionInput)(e)(t)))((function(e){return v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(n(e))}))})));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 933, column 23 - line 941, column 38): "+[t.constructor.name])}},Ln=l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(Y.mapFlipped(l.functorExceptT(d.functorStateT(w.functorContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(Fn(te.strongForget)))((r=fe.unwrap(),function(e){return r(e).txOutputs})))((function(e){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(In(te.strongForget)))((function(n){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(kn))((function(t){var r,o,a=Y.mapFlipped(ce.functorMap)(ce.union(O.ordTransactionInput)(e)(n))(I.fromPlutusTxOutputWithRefScript(t));return ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((r=An(me.strongFn),o=K._utxoIndex(me.strongFn),function(e){return r(o(e))}))(X.flip(ce.union(O.ordTransactionInput))(a))}))}))}))),_n=function(){return function(e){return function(n){return i.bind(d.bindStateT(w.monadContract))(function(){if(n instanceof V.SpendInput)return i.discard(i.discardUnit)(d.bindStateT(w.monadContract))(ue.modifying(d.monadStateStateT(w.monadContract))((e=Rn(me.strongFn),t=g._inputs(me.strongFn),function(n){return e(t(n))}))(be.insert(O.ordTransactionInput)(fe.unwrap()(n.value0).input)))((function(){return a.pure(d.applicativeStateT(w.monadContract))(n.value0)}));var e,t,r,o;if(n instanceof V.RefInput){var u=fe.unwrap()(n.value0).input;return i.discard(i.discardUnit)(d.bindStateT(w.monadContract))(ue.modifying(d.monadStateStateT(w.monadContract))((r=Rn(me.strongFn),o=g._referenceInputs(me.strongFn),function(e){return r(o(e))}))(be.insert(O.ordTransactionInput)(u)))((function(){return a.pure(d.applicativeStateT(w.monadContract))(n.value0)}))}throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 989, column 17 - line 996, column 22): "+[n.constructor.name])}())((function(n){return i.discard(i.discardUnit)(d.bindStateT(w.monadContract))((t=n,ue.modifying(d.monadStateStateT(w.monadContract))(In(me.strongFn))(ce.insert(O.ordTransactionInput)(t.input)(t.output))))((function(){return function(n){var t=fe.unwrap()(fe.unwrap()(n.output).output).referenceScript,r=a.pure(d.applicativeStateT(w.monadContract))(c.throwError(c.monadThrowEither)(new an(t)));return Q.notEq(le.eqMaybe(M.eqScriptHash))(new le.Just(fe.unwrap()(e)))(t)?r:a.pure(d.applicativeStateT(w.monadContract))(new j.Right(Te.unit))}(n)}));var t}))}}},Un=function(e){return function(n){return function(t){var r=function(e){return function(n){if(n instanceof V.DatumInline)return new N.OutputDatum(e);if(n instanceof V.DatumWitness)return new N.OutputDatumHash(h.datumHash(e));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1448, column 21 - line 1450, column 60): "+[n.constructor.name])}};return i.bind(d.bindStateT(w.monadContract))(v.lift(d.monadTransStateT)(w.monadContract)(C.getQueryHandle))((function(o){if(t instanceof V.MustIncludeDatum)return xn(t.value0);if(t instanceof V.MustValidateIn)return i.bind(d.bindStateT(w.monadContract))(s.asks(d.monadAskStateT(w.monadAskContractEnvContra))((function(e){return e.ledgerConstants})))((function(e){return i.bind(d.bindStateT(w.monadContract))(Ee.liftAff(Ee.monadAffState(w.monadAffContract))(i.bind(Fe.bindAff)(o.getEraSummaries)(j.either((n=xe.liftEffect(Fe.monadEffectAff),r=we.show(R.showClientError),function(e){return n(Me.throw(r(e)))}))(a.pure(Fe.applicativeAff)))))((function(n){return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(xe.liftEffect(d.monadEffectState(w.monadEffectContract))(Y.mapFlipped(De.functorEffect)(B.posixTimeRangeToTransactionValidity(n)(e.systemStart)(t.value0))(J.lmap(J.bifunctorEither)(Le.create(t.value0)))))((function(e){return ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((n=Rn(me.strongFn),t=oe._Newtype()()(ve.profunctorFn),function(e){return n(t(e))}))((function(n){var t={};for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t.ttl=e.timeToLive,t.validityStartInterval=e.validityStartInterval,t}));var n,t})))}));var n,r}));if(t instanceof V.MustBeSignedBy)return l.runExceptT(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(le.semigroupMaybe(ge.semigroupArray))((b=Rn(me.strongFn),C=g._requiredSigners(me.strongFn),function(e){return b(C(e))}))(new le.Just([fe.wrap()(fe.unwrap()(fe.unwrap()(t.value0)))])));var b,C,I,D,M,k,q,W,K,X,$;if(t instanceof V.MustSpendAtLeast){var ee=T.fromPlutusValue(t.value0);return l.runExceptT(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(sn)(hn(me.strongFn))(gn(ee)))}if(t instanceof V.MustProduceAtLeast)return ee=T.fromPlutusValue(t.value0),l.runExceptT(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(sn)(Cn(me.strongFn))(gn(ee)));if(t instanceof V.MustSpendPubKeyOutput)return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(Nn(t.value0)(le.Nothing.value))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((n=Rn(me.strongFn),r=g._inputs(me.strongFn),function(e){return n(r(e))}))(be.insert(O.ordTransactionInput)(t.value0)))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(sn)(hn(me.strongFn))(yn(e.amount))}));var n,r})));if(t instanceof V.MustSpendScriptOutput)return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(Nn(t.value0)(t.value2))((function(e){return e.datum instanceof N.NoOutputDatum?c.throwError(l.monadThrowExceptT(d.monadStateT(w.monadContract)))(new en(t.value0)):i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(w.monadContract)))(new He(e.address))(m.addressPaymentValidatorHash(e.address)))((function(r){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(function(){if(t.value2 instanceof le.Nothing)return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(l.except(d.applicativeStateT(w.monadContract))(Y.map(j.functorEither)(fe.unwrap())((e=r,function(n){return j.note(new on(e))(ce.lookup(H.ordValidatorHash)(e)(n))})(n))))((function(e){return Sn(P.attachPlutusScript)(e)}));var e;if(t.value2 instanceof le.Just)return _n()(r)(t.value2.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1096, column 13 - line 1102, column 80): "+[t.value2.constructor.name])}())((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(function(){if(e.datum instanceof N.OutputDatumHash)return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(i.bind(d.bindStateT(w.monadContract))((n=e.datum.value0,i.bind(d.bindStateT(w.monadContract))(Y.mapFlipped(d.functorStateT(w.functorContract))(ne.use(d.monadStateStateT(w.monadContract))(Fn(te.strongForget)))((t=fe.unwrap(),function(e){return t(e).datums})))((function(e){return a.pure(d.applicativeStateT(w.monadContract))(j.note(new Ge(n))(ce.lookup(O.ordDataHash)(n)(e)))}))))((function(n){var t,r;return j.isRight(n)?a.pure(d.applicativeStateT(w.monadContract))(n):Ee.liftAff(Ee.monadAffState(w.monadAffContract))(Y.mapFlipped(Fe.functorAff)(o.getDatumByHash(e.datum.value0))((t=j.note(new Ne(e.datum.value0)),r=i.join(le.bindMaybe),function(e){return t(r(j.hush(e)))})))})))((function(e){return xn(e)}));var n,t;if(e.datum instanceof N.OutputDatum)return a.pure(l.applicativeExceptT(d.monadStateT(w.monadContract)))(Te.unit);if(e.datum instanceof N.NoOutputDatum)return c.throwError(l.monadThrowExceptT(d.monadStateT(w.monadContract)))(Be.value);throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1105, column 13 - line 1118, column 58): "+[e.datum.constructor.name])}())((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((n=Rn(me.strongFn),r=g._inputs(me.strongFn),function(e){return n(r(e))}))(be.insert(O.ordTransactionInput)(t.value0)))((function(){var n={tag:_.Spend.value,index:ye.zero(G.semiringBigInt),data:fe.unwrap()(t.value1),exUnits:ye.zero(ye.semiringRecord()(ye.semiringRecordCons({reflectSymbol:function(){return"mem"}})()(ye.semiringRecordCons({reflectSymbol:function(){return"steps"}})()(ye.semiringRecordNil)(G.semiringBigInt))(G.semiringBigInt)))};return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(sn)(hn(me.strongFn))(yn(e.amount)))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(ge.semigroupArray)(Tn(me.strongFn))(z.singleton(new Se.Tuple(n,new le.Just(t.value0)))))((function(){return Sn(P.attachRedeemer)(n)}))}))}));var n,r}))}))}))})));if(t instanceof V.MustSpendNativeScriptOutput)return l.runExceptT(i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((I=Rn(me.strongFn),D=g._inputs(me.strongFn),function(e){return I(D(e))}))(be.insert(O.ordTransactionInput)(t.value0)))((function(){return Sn(P.attachNativeScript)(t.value1)})));if(t instanceof V.MustReferenceOutput)return l.runExceptT(ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((M=Rn(me.strongFn),k=g._referenceInputs(me.strongFn),function(e){return M(k(e))}))(be.insert(O.ordTransactionInput)(t.value0)));if(t instanceof V.MustMintValue)return l.runExceptT(i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(function(){if(t.value4 instanceof le.Nothing)return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(l.except(d.applicativeStateT(w.monadContract))((n=t.value0,function(e){return j.note(new Ze(n))(ce.lookup(H.ordMintingPolicyHash)(n)(e))})(e)))((function(e){if(e instanceof H.PlutusMintingPolicy)return Sn(P.attachPlutusScript)(e.value0);if(e instanceof H.NativeMintingPolicy)return c.throwError(l.monadThrowExceptT(d.monadStateT(w.monadContract)))(new cn(t.value0));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1145, column 13 - line 1152, column 60): "+[e.constructor.name])}));var n,r,o,u;if(t.value4 instanceof le.Just)return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))((r=t.value4.value0,u=function(){if(r instanceof V.RefInput)return r.value0;if(r instanceof V.SpendInput)return r.value0;throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1034, column 10 - line 1036, column 28): "+[r.constructor.name])}(),a.pure(d.applicativeStateT(w.monadContract))(j.note(new an(le.Nothing.value))((o=fe.unwrap()(fe.unwrap()(u).output).scriptRef,i.bind(le.bindMaybe)(o)((function(e){return e instanceof p.NativeScriptRef?a.pure(le.applicativeMaybe)(!0):a.pure(le.applicativeMaybe)(!1)})))))))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(a.when(l.applicativeExceptT(d.monadStateT(w.monadContract)))(e)(c.throwError(l.monadThrowExceptT(d.monadStateT(w.monadContract)))(new cn(t.value0))))((function(){return _n()(t.value0)(t.value4.value0)}))}));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1142, column 7 - line 1158, column 78): "+[t.value4.constructor.name])}())((function(){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(w.monadContract)))(new Qe(t.value0))(y.mpsSymbol(t.value0)))((function(e){var n=y["mkSingletonValue'"](e)(t.value2);return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(de.lessThan(G.ordBigInt)(t.value3)(ye.zero(G.semiringBigInt))?i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(w.monadContract)))(new We(e,t.value2,t.value3))(n(pe.negate(G.ringBigInt)(t.value3))))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(sn)(hn(me.strongFn))(yn(e)))((function(){return a.pure(l.applicativeExceptT(d.monadStateT(w.monadContract)))(Y.map(le.functorMaybe)(y.getNonAdaAsset)(n(t.value3)))}))})):Q.eq(G.eqBigInt)(t.value3)(ye.zero(G.semiringBigInt))?c.throwError(l.monadThrowExceptT(d.monadStateT(w.monadContract)))(new ln(e,t.value2)):i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(w.monadContract)))(new We(e,t.value2,t.value3))(n(t.value3)))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(sn)(Cn(me.strongFn))(yn(e)))((function(){return a.pure(l.applicativeExceptT(d.monadStateT(w.monadContract)))(Y.map(le.functorMaybe)(y.getNonAdaAsset)(n(t.value3)))}))})))((function(e){var n={tag:_.Mint.value,index:ye.zero(G.semiringBigInt),data:fe.unwrap()(t.value1),exUnits:ye.zero(ye.semiringRecord()(ye.semiringRecordCons({reflectSymbol:function(){return"mem"}})()(ye.semiringRecordCons({reflectSymbol:function(){return"steps"}})()(ye.semiringRecordNil)(G.semiringBigInt))(G.semiringBigInt)))};return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(Tn(me.strongFn))(z.filter((function(e){return Q.notEq(_.eqRedeemerTag)(e.value0.tag)(_.Mint.value)}))))((function(){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))((r=t.value0,function(e){return i.discard(i.discardUnit)(d.bindStateT(w.monadContract))(ue.modifying(d.monadStateStateT(w.monadContract))(Dn(me.strongFn))(ce.insert(H.ordMintingPolicyHash)(r)(e)))((function(){return i.bind(d.bindStateT(w.monadContract))(Y.mapFlipped(d.functorStateT(w.functorContract))(ne.use(d.monadStateStateT(w.monadContract))(Dn(te.strongForget)))(ce.toUnfoldable(Ie.unfoldableArray)))((function(e){return a.pure(d.applicativeStateT(w.monadContract))(z.mapWithIndex((function(e){return function(n){return{tag:n.value1.tag,index:G.fromInt(e),data:n.value1.data,exUnits:n.value1.exUnits}}}))(e))}))}))})(n)))((function(n){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(ge.semigroupArray)(Tn(me.strongFn))(Y.map(Y.functorArray)((function(e){return new Se.Tuple(e,le.Nothing.value)}))(n)))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(le.semigroupMaybe(g.semigroupMint))((n=Rn(me.strongFn),t=g._mint(me.strongFn),function(e){return n(t(e))}))(Y.map(le.functorMaybe)(fe.wrap())(e));var n,t}))}));var r}))}))}))})));if(t instanceof V.MustMintValueUsingNativeScript)return l.runExceptT((q=fe.wrap()(fe.unwrap()(S.nativeScriptHash(t.value0))),i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(Sn(P.attachNativeScript)(t.value0))((function(){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(w.monadContract)))(new Qe(q))(y.mpsSymbol(q)))((function(e){var n=y["mkSingletonValue'"](e)(t.value1);return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(de.lessThan(G.ordBigInt)(t.value2)(ye.zero(G.semiringBigInt))?i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(w.monadContract)))(new We(e,t.value1,t.value2))(n(pe.negate(G.ringBigInt)(t.value2))))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(sn)(hn(me.strongFn))(yn(e)))((function(){return a.pure(l.applicativeExceptT(d.monadStateT(w.monadContract)))(Y.map(le.functorMaybe)(y.getNonAdaAsset)(n(t.value2)))}))})):i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(w.monadContract)))(new We(e,t.value1,t.value2))(n(t.value2)))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(sn)(Cn(me.strongFn))(yn(e)))((function(){return a.pure(l.applicativeExceptT(d.monadStateT(w.monadContract)))(Y.map(le.functorMaybe)(y.getNonAdaAsset)(n(t.value2)))}))})))((function(e){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(le.semigroupMaybe(g.semigroupMint))((n=Rn(me.strongFn),t=g._mint(me.strongFn),function(e){return n(t(e))}))(Y.map(le.functorMaybe)(fe.wrap())(e));var n,t}))}))}))));if(t instanceof V.MustPayToPubKeyAddress)return i.bind(d.bindStateT(w.monadContract))(kn)((function(e){var n=T.fromPlutusValue(t.value4);return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(Ae.for(l.applicativeExceptT(d.monadStateT(w.monadContract)))(Ae.traversableMaybe)(t.value2)((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(a.when(l.applicativeExceptT(d.monadStateT(w.monadContract)))(Q.eq(V.eqDatumPresence)(e.value1)(V.DatumWitness.value))(xn(e.value0)))((function(){return a.pure(l.applicativeExceptT(d.monadStateT(w.monadContract)))(r(e.value0)(e.value1))}))})))((function(r){var o,a,u={address:function(){if(t.value1 instanceof le.Just)return L.payPubKeyHashBaseAddress(e)(t.value0)(t.value1.value0);if(t.value1 instanceof le.Nothing)return L.payPubKeyHashEnterpriseAddress(e)(t.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1234, column 21 - line 1236, column 68): "+[t.value1.constructor.name])}(),amount:n,datum:le.fromMaybe(N.NoOutputDatum.value)(r),scriptRef:t.value3};return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((o=Rn(me.strongFn),a=g._outputs(me.strongFn),function(e){return o(a(e))}))(z.cons(u)))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(sn)(Cn(me.strongFn))(yn(n))}))})))}));if(t instanceof V.MustPayToScript)return i.bind(d.bindStateT(w.monadContract))(kn)((function(e){var n,o,a,u,c=T.fromPlutusValue(t.value5);return l.runExceptT((a=r(t.value2)(t.value3),u={address:function(){if(t.value1 instanceof le.Nothing)return E.validatorHashEnterpriseAddress(e)(t.value0);if(t.value1 instanceof le.Just)return x.baseAddressToAddress(x.baseAddress({network:e,paymentCred:x.scriptHashCredential(fe.unwrap()(t.value0)),delegationCred:wn(t.value1.value0)}));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1252, column 24 - line 1258, column 20): "+[t.value1.constructor.name])}(),amount:c,datum:a,scriptRef:t.value4},i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((n=Rn(me.strongFn),o=g._outputs(me.strongFn),function(e){return n(o(e))}))(z.cons(u)))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(sn)(Cn(me.strongFn))(yn(c))}))))}));if(t instanceof V.MustPayToNativeScript)return i.bind(d.bindStateT(w.monadContract))(kn)((function(e){var n,r,o,a=T.fromPlutusValue(t.value2);return l.runExceptT((o={address:function(){if(t.value1 instanceof le.Nothing)return E.validatorHashEnterpriseAddress(e)(fe.wrap()(fe.unwrap()(t.value0)));if(t.value1 instanceof le.Just)return x.baseAddressToAddress(x.baseAddress({network:e,paymentCred:x.scriptHashCredential(fe.unwrap()(t.value0)),delegationCred:wn(t.value1.value0)}));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1273, column 24 - line 1280, column 20): "+[t.value1.constructor.name])}(),amount:a,datum:N.NoOutputDatum.value,scriptRef:le.Nothing.value},i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((n=Rn(me.strongFn),r=g._outputs(me.strongFn),function(e){return n(r(e))}))(z.cons(o)))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(sn)(Cn(me.strongFn))(yn(a))}))))}));if(t instanceof V.MustHashDatum){var ae=h.datumHash(t.value1);return Q.eq(O.eqDataHash)(ae)(t.value0)?xn(t.value1):a.pure(d.applicativeStateT(w.monadContract))(c.throwError(c.monadThrowEither)(new je(t.value0,t.value1)))}if(t instanceof V.MustRegisterStakePubKey)return l.runExceptT(Y.void(l.functorExceptT(d.functorStateT(w.functorContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(Pn(new g.StakeRegistration(x.keyHashCredential(fe.unwrap()(fe.unwrap()(t.value0))))))));if(t instanceof V.MustDeregisterStakePubKey)return l.runExceptT(Y.void(l.functorExceptT(d.functorStateT(w.functorContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(Pn(new g.StakeDeregistration(x.keyHashCredential(fe.unwrap()(fe.unwrap()(t.value0))))))));if(t instanceof V.MustRegisterStakeScript)return l.runExceptT(Y.void(l.functorExceptT(d.functorStateT(w.functorContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(Pn(new g.StakeRegistration(x.scriptHashCredential(fe.unwrap()(t.value0)))))));if(t instanceof V.MustDeregisterStakePlutusScript)return l.runExceptT((W=new g.StakeDeregistration(x.scriptHashCredential(fe.unwrap()(E.plutusScriptStakeValidatorHash(t.value0)))),i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(Pn(W)))((function(e){var n={tag:_.Cert.value,index:G.fromInt(e),data:fe.unwrap()(t.value1),exUnits:ye.zero(ye.semiringRecord()(ye.semiringRecordCons({reflectSymbol:function(){return"mem"}})()(ye.semiringRecordCons({reflectSymbol:function(){return"steps"}})()(ye.semiringRecordNil)(G.semiringBigInt))(G.semiringBigInt)))};return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(Sn(P.attachPlutusScript)(fe.unwrap()(t.value0)))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(Sn(P.attachRedeemer)(n))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(ge.semigroupArray)(Tn(me.strongFn))(z.singleton(new Se.Tuple(n,le.Nothing.value)))}))}))}))));if(t instanceof V.MustDeregisterStakeNativeScript)return i.discard(i.discardUnit)(d.bindStateT(w.monadContract))(Y.void(d.functorStateT(w.functorContract))(Pn(new g.StakeDeregistration(x.scriptHashCredential(fe.unwrap()(E.nativeScriptStakeValidatorHash(t.value0)))))))((function(){return Sn(P.attachNativeScript)(fe.unwrap()(t.value0))}));if(t instanceof V.MustRegisterPool)return l.runExceptT(Y.void(l.functorExceptT(d.functorStateT(w.functorContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(Pn(new g.PoolRegistration(t.value0)))));if(t instanceof V.MustRetirePool)return l.runExceptT(Y.void(l.functorExceptT(d.functorStateT(w.functorContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(Pn(new g.PoolRetirement({poolKeyHash:t.value0,epoch:t.value1})))));if(t instanceof V.MustDelegateStakePubKey)return l.runExceptT(Y.void(l.functorExceptT(d.functorStateT(w.functorContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(Pn(new g.StakeDelegation(x.keyHashCredential(fe.unwrap()(fe.unwrap()(t.value0))),t.value1)))));if(t instanceof V.MustDelegateStakePlutusScript)return l.runExceptT(function(){var e=new g.StakeDelegation(x.scriptHashCredential(fe.unwrap()(E.plutusScriptStakeValidatorHash(t.value0))),t.value2);return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(Pn(e)))((function(e){var n={tag:_.Cert.value,index:G.fromInt(e),data:fe.unwrap()(t.value1),exUnits:ye.zero(ye.semiringRecord()(ye.semiringRecordCons({reflectSymbol:function(){return"mem"}})()(ye.semiringRecordCons({reflectSymbol:function(){return"steps"}})()(ye.semiringRecordNil)(G.semiringBigInt))(G.semiringBigInt)))};return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(Sn(P.attachPlutusScript)(fe.unwrap()(t.value0)))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(Sn(P.attachRedeemer)(n))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(ge.semigroupArray)(Tn(me.strongFn))(z.singleton(new Se.Tuple(n,le.Nothing.value)))}))}))}))}());if(t instanceof V.MustDelegateStakeNativeScript)return i.discard(i.discardUnit)(d.bindStateT(w.monadContract))(Y.void(d.functorStateT(w.functorContract))(Pn(new g.StakeDelegation(x.scriptHashCredential(fe.unwrap()(E.nativeScriptStakeValidatorHash(t.value0))),t.value1))))((function(){return Sn(P.attachNativeScript)(fe.unwrap()(t.value0))}));if(t instanceof V.MustWithdrawStakePubKey)return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(kn))((function(e){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(v.lift(d.monadTransStateT)(w.monadContract)(w.wrapQueryM(F.getPubKeyHashDelegationsAndRewards(t.value0)))))((function(n){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(a.pure(d.applicativeStateT(w.monadContract))(j.note(new Ke(t.value0))(n)))((function(n){var r,o,a,u=U.stakePubKeyHashRewardAddress(e)(t.value0);return ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((r=Rn(me.strongFn),o=g._withdrawals(me.strongFn),a=re.non(ce.eqMap(U.eqRewardAddress)(y.eqCoin))(ce.empty)(ve.profunctorFn),function(e){return r(o(a(e)))}))(ce.union(U.ordRewardAddress)(ce.singleton(u)(le.fromMaybe(ye.zero(G.semiringBigInt))(n.rewards))))}))}))})));if(t instanceof V.MustWithdrawStakePlutusScript)return l.runExceptT((K=E.plutusScriptStakeValidatorHash(t.value0),i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(kn))((function(e){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(v.lift(d.monadTransStateT)(w.monadContract)(w.wrapQueryM(F.getValidatorHashDelegationsAndRewards(K)))))((function(n){var r=U.stakeValidatorHashRewardAddress(e)(K);return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(a.pure(d.applicativeStateT(w.monadContract))(j.note(new ze(t.value0))(n)))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((n=Rn(me.strongFn),o=g._withdrawals(me.strongFn),a=re.non(ce.eqMap(U.eqRewardAddress)(y.eqCoin))(ce.empty)(ve.profunctorFn),function(e){return n(o(a(e)))}))(ce.union(U.ordRewardAddress)(ce.singleton(r)(le.fromMaybe(ye.zero(G.semiringBigInt))(e.rewards)))))((function(){var e={tag:_.Reward.value,index:ye.zero(G.semiringBigInt),data:fe.unwrap()(t.value1),exUnits:ye.zero(ye.semiringRecord()(ye.semiringRecordCons({reflectSymbol:function(){return"mem"}})()(ye.semiringRecordCons({reflectSymbol:function(){return"steps"}})()(ye.semiringRecordNil)(G.semiringBigInt))(G.semiringBigInt)))};return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(Sn(P.attachPlutusScript)(fe.unwrap()(t.value0)))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(Sn(P.attachRedeemer)(e))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(ge.semigroupArray)(Tn(me.strongFn))(z.singleton(new Se.Tuple(e,le.Nothing.value)))}))}))}));var n,o,a}))}))}))));if(t instanceof V.MustWithdrawStakeNativeScript)return l.runExceptT(function(){var e=E.nativeScriptStakeValidatorHash(t.value0);return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(kn))((function(n){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(v.lift(d.monadTransStateT)(w.monadContract)(w.wrapQueryM(F.getValidatorHashDelegationsAndRewards(e)))))((function(r){var o=U.stakeValidatorHashRewardAddress(n)(e);return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(a.pure(d.applicativeStateT(w.monadContract))(j.note(new Je(t.value0))(r)))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((n=Rn(me.strongFn),r=g._withdrawals(me.strongFn),a=re.non(ce.eqMap(U.eqRewardAddress)(y.eqCoin))(ce.empty)(ve.profunctorFn),function(e){return n(r(a(e)))}))(ce.union(U.ordRewardAddress)(ce.singleton(o)(le.fromMaybe(ye.zero(G.semiringBigInt))(e.rewards)))))((function(){return Sn(P.attachNativeScript)(fe.unwrap()(t.value0))}));var n,r,a}))}))}))}());if(t instanceof V.MustSatisfyAnyOf)return i.bind(d.bindStateT(w.monadContract))(f.get(d.monadStateStateT(w.monadContract)))((function(r){var o=function(t){if(t instanceof ie.Nil)return a.pure(d.applicativeStateT(w.monadContract))(c.throwError(c.monadThrowEither)(un.value));if(t instanceof ie.Cons)return Z.foldM(ie.foldableList)(d.monadStateT(w.monadContract))((function(a){return function(a){return l.runExceptT((i=u.applySecond(d.applyStateT(w.monadContract))(f.put(d.monadStateStateT(w.monadContract))(r))(o(t.value1)),c.catchError(l.monadErrorExceptT(d.monadStateT(w.monadContract)))(c.catchError(d.monadErrorStateT(w.monadErrorErrorContract))(Un(e)(n)(a))((function(e){return i})))((function(e){return i}))));var i}}))(new j.Right(Te.unit))(t.value0);throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1423, column 9 - line 1425, column 62): "+[t.constructor.name])};return o(z.toUnfoldable(ie.unfoldableList)(Y.map(Y.functorArray)(z.toUnfoldable(ie.unfoldableList))(t.value0)))}));if(t instanceof V.MustNotBeValid)return l.runExceptT(ue.assign(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((X=Mn(me.strongFn),$=g._isValid(me.strongFn),function(e){return X($(e))}))(!1));throw new Error("Failed pattern match at Ctl.Internal.Types.ScriptLookups (line 1049, column 3 - line 1442, column 46): "+[t.constructor.name])}))}}},Hn=l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(En(te.strongForget)))((function(e){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((n=te.strongForget,ae.prop({reflectSymbol:function(){return"costModels"}})()()(he.SProxy.value)(n))))((function(n){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((t=Tn(te.strongForget),r=ne.to(Y.map(Y.functorArray)(Se.fst)),function(e){return t(r(e))})))((function(t){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((r=An(te.strongForget),o=K._transaction(te.strongForget),function(e){return r(o(e))})))((function(r){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(xe.liftEffect(d.monadEffectState(w.monadEffectContract))(Y.mapFlipped(De.functorEffect)(P.setScriptDataHash(n)(t)(e)(r))(j.Right.create)))((function(e){return ue.assign(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(Mn(me.strongFn))(e)}))}));var r,o}));var t,r}));var n})));o.mintingPolicy=function(e){return fe.over()()(Pe)((function(n){return{mps:z.singleton(e),datums:n.datums,ownPaymentPubKeyHash:n.ownPaymentPubKeyHash,ownStakePubKeyHash:n.ownStakePubKeyHash,paymentPubKeyHashes:n.paymentPubKeyHashes,scripts:n.scripts,txOutputs:n.txOutputs,typedValidator:n.typedValidator}}))(se.mempty(dn))},o.mkUnbalancedTx=function(){return function(e){return function(n){return function(t){return function(r){return Y.mapFlipped(w.functorContract)(function(e){return function(n){return function(t){return function(r){return i.bind(w.bindContract)(Y.map(w.functorContract)(fe.unwrap())(b.getProtocolParameters))((function(o){var u={unbalancedTx:K.emptyUnbalancedTx,valueSpentBalancesInputs:{required:se.mempty(y.monoidValue),provided:se.mempty(y.monoidValue)},valueSpentBalancesOutputs:{required:se.mempty(y.monoidValue),provided:se.mempty(y.monoidValue)},datums:se.mempty(se.monoidArray),redeemersTxIns:se.mempty(se.monoidArray),mintRedeemers:ce.empty,lookups:t,refScriptsUtxoMap:ce.empty,costModels:o.costModels};return Y.map(w.functorContract)((function(e){return e.value0 instanceof j.Left?new j.Left(e.value0.value0):new j.Right(e.value1)}))(X.flip(d.runStateT)(u)(function(e){return function(n){return function(t){var r=function(e){var n=Z.traverse_(l.applicativeExceptT(d.monadStateT(w.monadContract)))(Z.foldableArray)((function(n){return l.ExceptT(e(n))}));return function(e){return l.runExceptT(n(e))}};return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(Y.mapFlipped(l.functorExceptT(d.functorStateT(w.functorContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(Fn(te.strongForget)))(fe.unwrap()))((function(o){var u=Y.map(Y.functorArray)(E.validatorHash)(o.scripts),c=ce.fromFoldable(H.ordValidatorHash)(Z.foldableArray)(z.zip(u)(o.scripts)),s=Y.map(Y.functorArray)(E.mintingPolicyHash)(o.mps),f=ce.fromFoldable(H.ordMintingPolicyHash)(Z.foldableArray)(z.zip(s)(o.mps));return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(l.except(d.applicativeStateT(w.monadContract))(function(e){var n=z.partition((function(e){return e instanceof V.MustValidateIn}))(e),t=z.mapMaybe((function(e){return e instanceof V.MustValidateIn?new le.Just(e.value0):le.Nothing.value}))(n.yes);return i.bind(j.bindEither)(Z.foldM(Z.foldableArray)(j.monadEither)((function(e){return function(n){var t=B.intersection(B.ordPOSIXTime)(e)(n);return B.isEmpty(B.ordPOSIXTime)(t)?new j.Left(new _e(e,n)):a.pure(j.applicativeEither)(t)}}))(B.always(B.ordPOSIXTime))(t))((function(e){return a.pure(j.applicativeEither)(z.cons(new V.MustValidateIn(e))(n.no))}))}(t.constraints)))((function(o){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(r(Un(f)(c))(o))((function(){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(Y.mapFlipped(l.functorExceptT(d.functorStateT(w.functorContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(Dn(te.strongForget)))(ce.toUnfoldable(Ie.unfoldableArray)))((function(o){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(v.lift(l.monadTransExceptT)(d.monadStateT(w.monadContract))(Z.traverse_(d.applicativeStateT(w.monadContract))(Z.foldableArray)((a=Sn(P.attachRedeemer),function(e){return a(Se.snd(e))}))(o)))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(r(function(e){return function(n){return function(n){return function(n){return i.bind(d.bindStateT(w.monadContract))(kn)((function(t){return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(Fn(te.strongForget)))((function(r){var o=Y.map(ce.functorMap)(I.fromPlutusTxOutputWithRefScript(t))(r.txOutputs);return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(w.monadContract)))(rn.value)(r.typedValidator))((function(r){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(v.lift(d.monadTransStateT)(w.monadContract)(Y.mapFlipped(w.functorContract)(W.typeTxOutRef()(e)(t)(X.flip(ce.lookup(O.ordTransactionInput))(o))(r)(n.txOutRef))(J.lmap(J.bifunctorEither)(nn.create))))((function(e){var t,r,o=W.typedTxOutRefValue()(e);return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((t=Rn(me.strongFn),r=g._inputs(me.strongFn),function(e){return t(r(e))}))(be.insert(O.ordTransactionInput)(n.txOutRef)))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(sn)(hn(me.strongFn))(yn(o))}))}))}))})))}))}}}}(e)(n)(Re.Proxy.value))(t.ownInputs))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(r((n=e.ToData1(),function(e){return i.bind(d.bindStateT(w.monadContract))(v.lift(d.monadTransStateT)(w.monadContract)(C.getQueryHandle))((function(t){return i.bind(d.bindStateT(w.monadContract))(kn)((function(r){return l.runExceptT(i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(ne.use(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(Fn(te.strongForget)))((function(o){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(w.monadContract)))(rn.value)(o.typedValidator))((function(o){var a=T.fromPlutusValue(e.value),u=W.mkTypedTxOut()(n)(r)(o)(e.datum)(a),c=W.typedTxOutTxOut()(u);return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(A.liftM(l.monadErrorExceptT(d.monadStateT(w.monadContract)))(tn.value)(W.typedTxOutDatumHash()(u)))((function(e){return i.bind(l.bindExceptT(d.monadStateT(w.monadContract)))(Ee.liftAff(Ee.monadAffState(w.monadAffContract))(Y.mapFlipped(Fe.functorAff)(t.getDatumByHash(e))((n=j.note(new Ne(e)),r=i.join(le.bindMaybe),function(e){return n(r(j.hush(e)))}))))((function(e){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(ue.modifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))((n=Rn(me.strongFn),t=g._outputs(me.strongFn),function(e){return n(t(e))}))(z.cons(c)))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(xn(e))((function(){return ue.appendModifying(l.monadStateExceptT(d.monadStateStateT(w.monadContract)))(sn)(Cn(me.strongFn))(yn(a))}))}));var n,t}));var n,r}))}))})))}))}))}))(t.ownOutputs))((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(Hn)((function(){return i.discard(i.discardUnit)(l.bindExceptT(d.monadStateT(w.monadContract)))(Bn)((function(){return Ln}))}))}));var n}))}));var a}))}))}))})))}}}(e)(n)(r)))}))}}}}(e)(n)(t)(r))(Y.map(j.functorEither)((function(e){var n,t,r,o,a=function(e){return ue.over((n=K._transaction(me.strongFn),t=g._witnessSet(me.strongFn),function(e){return n(t(e))}))(fe.over()()(g.TransactionWitnessSet)((function(e){return{plutusData:le.Nothing.value,redeemers:le.Nothing.value,bootstraps:e.bootstraps,nativeScripts:e.nativeScripts,plutusScripts:e.plutusScripts,vkeys:e.vkeys}})))(e);var n,t}((n=e.unbalancedTx,ue.set((t=K._transaction(me.strongFn),r=g._body(me.strongFn),o=g._scriptDataHash(me.strongFn),function(e){return t(r(o(e)))}))(le.Nothing.value)(n)));return fe.wrap()({unbalancedTx:a,datums:e.datums,redeemersTxIns:e.redeemersTxIns})})))}}}}},o.unspentOutputs=function(e){return fe.over()()(Pe)((function(n){return{txOutputs:e,datums:n.datums,mps:n.mps,ownPaymentPubKeyHash:n.ownPaymentPubKeyHash,ownStakePubKeyHash:n.ownStakePubKeyHash,paymentPubKeyHashes:n.paymentPubKeyHashes,scripts:n.scripts,typedValidator:n.typedValidator}}))(se.mempty(dn))},o.semigroupScriptLookups=fn,o.showUnattachedUnbalancedT=vn,o.showMkUnbalancedTxError=pn}(c),function(e){"use strict";e["Contract.ScriptLookups"]=e["Contract.ScriptLookups"]||{};var n=e["Contract.ScriptLookups"],t=e["Ctl.Internal.Types.ScriptLookups"];n.mkUnbalancedTx=function(){return function(e){return function(n){return t.mkUnbalancedTx()(e)(n)}}}}(c),function(e){"use strict";e["Ctl.Internal.ReindexRedeemers"]=e["Ctl.Internal.ReindexRedeemers"]||{};var n=e["Ctl.Internal.ReindexRedeemers"],t=e["Control.Bind"],r=e["Ctl.Internal.Cardano.Types.Transaction"],o=e["Ctl.Internal.Types.RedeemerTag"],a=e["Ctl.Internal.Types.Transaction"],u=e["Data.Array"],i=e["Data.BigInt"],c=e["Data.Either"],l=e["Data.Functor"],s=e["Data.Maybe"],f=e["Data.Show.Generic"],d=e["Data.Traversable"],v=e["Data.Tuple"],m=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),p={to:function(e){return new m(e)},from:function(e){return e.value0}},g={show:f.genericShow(p)(f.genericShowConstructor(f.genericShowArgsArgument(r.showRedeemer))({reflectSymbol:function(){return"CannotGetTxOutRefIndexForRedeemer"}}))};n["reindexSpentScriptRedeemers'"]=function(e){return function(n){var r;return d.traverse(d.traversableArray)(c.applicativeEither)((r=e,function(e){return e.value0.tag instanceof o.Spend&&e.value1 instanceof s.Just?t.bind(c.bindEither)(c.note(new m(e.value0))(l.map(s.functorMaybe)(i.fromInt)(u.elemIndex(a.eqTransactionInput)(e.value1.value0)(r))))((function(n){return new c.Right(new v.Tuple({tag:e.value0.tag,index:n,data:e.value0.data,exUnits:e.value0.exUnits},new s.Just(e.value1.value0)))})):new c.Right(new v.Tuple(e.value0,e.value1))}))(n)}},n.showReindexErrors=g}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.Error"]=e["Ctl.Internal.BalanceTx.Error"]||{};var n=e["Ctl.Internal.BalanceTx.Error"],t=e["Control.Bind"],r=e["Control.Category"],o=e["Ctl.Internal.Plutus.Types.Value"],a=e["Ctl.Internal.QueryM.Ogmios"],u=e["Ctl.Internal.ReindexRedeemers"],i=e["Ctl.Internal.Types.Natural"],c=e["Ctl.Internal.Types.PlutusData"],l=e["Ctl.Internal.Types.RedeemerTag"],s=e["Ctl.Internal.Types.ScriptLookups"],f=e["Ctl.Internal.Types.Transaction"],d=e["Data.Array"],v=e["Data.Bifunctor"],m=e["Data.BigInt"],p=e["Data.Either"],g=e["Data.Eq"],y=e["Data.EuclideanRing"],b=e["Data.Foldable"],w=e["Data.FoldableWithIndex"],C=e["Data.Function"],h=e["Data.Functor"],A=e["Data.Generic.Rep"],S=e["Data.Int"],I=e["Data.Map.Internal"],T=e["Data.Maybe"],D=e["Data.Monoid"],F=e["Data.Semigroup"],E=e["Data.Semiring"],x=e["Data.Show"],M=e["Data.Show.Generic"],R=e["Data.String.CodePoints"],P=e["Data.String.Common"],k=e["Data.String.Utils"],B=e["Data.Tuple"],N=function(){function e(){}return e.value=new e,e}(),L=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),_=function(){function e(){}return e.value=new e,e}(),U=function(){function e(){}return e.value=new e,e}(),H=function(){function e(){}return e.value=new e,e}(),q=function(){function e(){}return e.value=new e,e}(),O=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),V=function(){function e(){}return e.value=new e,e}(),W=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),K=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),z=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),J=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),G=function(){function e(){}return e.value=new e,e}(),j={show:M.genericShow({to:function(e){return e},from:function(e){return e}})(M.genericShowConstructor(M.genericShowArgsArgument(o.showValue))({reflectSymbol:function(){return"InvalidInContext"}}))},Q={to:function(e){return N.value},from:function(e){return A.NoArguments.value}},Z={show:M.genericShow(Q)(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"Impossible"}}))},X={show:M.genericShow({to:function(e){return e},from:function(e){return e}})(M.genericShowConstructor(M.genericShowArgsArgument(o.showValue))({reflectSymbol:function(){return"Expected"}}))},Y={to:function(e){if(e instanceof A.Inl)return new L(e.value0.value0,e.value0.value1.value0,e.value0.value1.value1);if(e instanceof A.Inr&&e.value0 instanceof A.Inl)return _.value;if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inl)return U.value;if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inl)return H.value;if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inl)return q.value;if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inl)return new O(e.value0.value0.value0.value0.value0.value0);if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof A.Inl)return V.value;if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inl)return new W(e.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value1);if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inl)return new K(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0,e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value1);if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inl)return new z(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inl)return new J(e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0);if(e instanceof A.Inr&&e.value0 instanceof A.Inr&&e.value0.value0 instanceof A.Inr&&e.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr&&e.value0.value0.value0.value0.value0.value0.value0.value0.value0.value0 instanceof A.Inr)return G.value;throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Error (line 84, column 1 - line 84, column 41): "+[e.constructor.name])},from:function(e){if(e instanceof L)return new A.Inl(new A.Product(e.value0,new A.Product(e.value1,e.value2)));if(e instanceof _)return new A.Inr(new A.Inl(A.NoArguments.value));if(e instanceof U)return new A.Inr(new A.Inr(new A.Inl(A.NoArguments.value)));if(e instanceof H)return new A.Inr(new A.Inr(new A.Inr(new A.Inl(A.NoArguments.value))));if(e instanceof q)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(A.NoArguments.value)))));if(e instanceof O)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(e.value0))))));if(e instanceof V)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(A.NoArguments.value)))))));if(e instanceof W)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(new A.Product(e.value0,e.value1)))))))));if(e instanceof K)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(new A.Product(e.value0,e.value1))))))))));if(e instanceof z)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(e.value0))))))))));if(e instanceof J)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inl(e.value0)))))))))));if(e instanceof G)return new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(new A.Inr(A.NoArguments.value)))))))))));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Error (line 84, column 1 - line 84, column 41): "+[e.constructor.name])}},$={show:M.genericShow({to:function(e){return e},from:function(e){return e}})(M.genericShowConstructor(M.genericShowArgsArgument(o.showValue))({reflectSymbol:function(){return"Actual"}}))},ee=function(e){return h.map(h.functorArray)(p.either(p.Right.create)(p.Right.create))(e)},ne=function(e){var n=h.map(h.functorArray)((function(e){return p.Left.create(function(e){return e+"\n"}(e))}))(P.split("\n")(e)),t=d.uncons(n);if(t instanceof T.Nothing)return[];if(t instanceof T.Just)return F.append(F.semigroupArray)([t.value0.head])(ee(t.value0.tail));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Error (line 140, column 3 - line 142, column 51): "+[t.constructor.name])},te=function(e){return ee(h.map(h.functorArray)(v.bimap(v.bifunctorEither)((function(e){return"- "+e}))((function(e){return" "+e})))(e))},re=function(e){return function(n){var o,u=function(n){return F.append(F.semigroupArray)(function(e){return ne(x.show(l.showRedeemerTag)(e.redeemerTag)+":"+m.toString(i.toBigInt(e.redeemerIndex)))}(n))(te(function(n){var r=function(n){return C.flip(b.find(b.foldableArray))(e.redeemersTxIns)((function(e){return g.eq(l.eqRedeemerTag)(e.value0.tag)(n.redeemerTag)&&g.eq(m.eqBigInt)(e.value0.index)(i.toBigInt(n.redeemerIndex))}))}(n),o=h.mapFlipped(T.functorMaybe)(t.bind(T.bindMaybe)(r)(B.snd))((function(e){return"Input: "+x.show(f.showTransactionInput)(e)})),a=h.mapFlipped(T.functorMaybe)(r)((function(e){return"Redeemer: "+x.show(c.showPlutusData)(e.value0.data)}));return b.foldMap(b.foldableArray)(D.monoidArray)(ne)(d.catMaybes([a,o]))}(n)))},s=function(e){if(e instanceof a.ExtraRedeemers)return F.append(F.semigroupArray)(ne("Extra redeemers:"))(te(b.foldMap(b.foldableArray)(D.monoidArray)(u)(e.value0)));if(e instanceof a.MissingRequiredDatums)return F.append(F.semigroupArray)(ne("Supplied with datums:"))(F.append(F.semigroupArray)(te(b.foldMap(b.foldableMaybe)(D.monoidArray)(b.foldMap(b.foldableArray)(D.monoidArray)(ne))(e.value0.provided)))(F.append(F.semigroupArray)(ne("But missing required datums:"))(te(b.foldMap(b.foldableArray)(D.monoidArray)(ne)(e.value0.missing)))));if(e instanceof a.MissingRequiredScripts)return F.append(F.semigroupArray)(ne("Supplied with scripts:"))(F.append(F.semigroupArray)(te(w.foldMapWithIndex(I.foldableWithIndexMap)(D.monoidArray)((function(e){return function(n){return F.append(F.semigroupArray)(u(e))(ne("Script: "+n))}}))(e.value0.resolved)))(F.append(F.semigroupArray)(ne("But missing required scripts:"))(te(b.foldMap(b.foldableArray)(D.monoidArray)(ne)(e.value0.missing)))));if(e instanceof a.ValidatorFailed)return F.append(F.semigroupArray)(ne(e.value0.error))(F.append(F.semigroupArray)(ne("Trace:"))((n=b.foldMap(b.foldableArray)(D.monoidArray)(ne)(e.value0.traces),t=S.toStringAs(S.decimal)(b.length(b.foldableArray)(E.semiringInt)(d.filter(p.isLeft)(n)))+". ",r=2*S.ceil(S.toNumber(R.length(t))/2)|0,o=C.applyN((function(e){return" "+e}))(y.div(y.euclideanRingInt)(r)(2)),ee(b.foldl(b.foldableArray)((function(e){return function(n){return F.append(F.semigroupArray)(e)([v.bimap(v.bifunctorEither)((t=b.length(b.foldableArray)(E.semiringInt)(e),function(e){return k.padEnd(r)(S.toStringAs(S.decimal)(t+1|0)+". ")+e}))(o)(n)]);var t}}))([])(n)))));var n,t,r,o;if(e instanceof a.UnknownInputReferencedByRedeemer)return ne("Unknown input referenced by redeemer: "+x.show(x.showRecord()(x.showRecordFieldsCons({reflectSymbol:function(){return"index"}})(x.showRecordFieldsCons({reflectSymbol:function(){return"txId"}})(x.showRecordFieldsNil)(x.showString))(x.showInt)))(e.value0));if(e instanceof a.NonScriptInputReferencedByRedeemer)return ne("Non script input referenced by redeemer: "+x.show(x.showRecord()(x.showRecordFieldsCons({reflectSymbol:function(){return"index"}})(x.showRecordFieldsCons({reflectSymbol:function(){return"txId"}})(x.showRecordFieldsNil)(x.showString))(x.showInt)))(e.value0));if(e instanceof a.IllFormedExecutionBudget&&e.value0 instanceof T.Nothing)return ne("Ill formed execution budget: Execution budget missing");if(e instanceof a.IllFormedExecutionBudget&&e.value0 instanceof T.Just)return F.append(F.semigroupArray)(ne("Ill formed execution budget:"))(te(F.append(F.semigroupArray)(ne("Memory: "+m.toString(i.toBigInt(e.value0.value0.memory))))(ne("Steps: "+m.toString(i.toBigInt(e.value0.value0.steps))))));if(e instanceof a.NoCostModelForLanguage)return ne('No cost model for language "'+e.value0+'"');throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Error (line 209, column 24 - line 242, column 60): "+[e.constructor.name])},A=function(e){return function(n){return F.append(F.semigroupArray)(u(e))(te(b.foldMap(b.foldableArray)(D.monoidArray)(s)(n)))}};return o=function(){if(n instanceof a.UnparsedError)return ne("Unknown error: "+n.value0);if(n instanceof a.ScriptFailures)return F.append(F.semigroupArray)(ne("Script failures:"))(te(w.foldMapWithIndex(I.foldableWithIndexMap)(D.monoidArray)(A)(n.value0)));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Error (line 173, column 21 - line 176, column 48): "+[n.constructor.name])}(),P.joinWith("")(h.map(h.functorArray)(p.either(r.identity(r.categoryFn))(r.identity(r.categoryFn)))(o))}},oe={show:function(e){return e instanceof W?"ExUnitsEvaluationFailed: "+re(e.value0)(e.value1):M.genericShow(Y)(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsProduct(M.genericShowArgsArgument(X))(M.genericShowArgsProduct(M.genericShowArgsArgument($))(M.genericShowArgsArgument(j))))({reflectSymbol:function(){return"BalanceInsufficientError"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"CouldNotConvertScriptOutputToTxInput"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"CouldNotGetChangeAddress"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"CouldNotGetCollateral"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"CouldNotGetUtxos"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsArgument(x.showString))({reflectSymbol:function(){return"CollateralReturnError"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"CollateralReturnMinAdaValueCalcError"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsProduct(M.genericShowArgsArgument(s.showUnattachedUnbalancedT))(M.genericShowArgsArgument(a.showTxEvaluationFailure)))({reflectSymbol:function(){return"ExUnitsEvaluationFailed"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsProduct(M.genericShowArgsArgument(Z))(M.genericShowArgsArgument(x.showString)))({reflectSymbol:function(){return"InsufficientUtxoBalanceToCoverAsset"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsArgument(u.showReindexErrors))({reflectSymbol:function(){return"ReindexRedeemersError"}}))(M.genericShowSum(M.genericShowConstructor(M.genericShowArgsArgument(f.showTransactionInput))({reflectSymbol:function(){return"UtxoLookupFailedFor"}}))(M.genericShowConstructor(M.genericShowArgsNoArguments)({reflectSymbol:function(){return"UtxoMinAdaValueCalculationFailed"}})))))))))))))(e)}};n.BalanceInsufficientError=L,n.CouldNotGetChangeAddress=U,n.CouldNotGetCollateral=H,n.CouldNotGetUtxos=q,n.CollateralReturnError=O,n.CollateralReturnMinAdaValueCalcError=V,n.ExUnitsEvaluationFailed=W,n.InsufficientUtxoBalanceToCoverAsset=K,n.ReindexRedeemersError=z,n.UtxoLookupFailedFor=J,n.UtxoMinAdaValueCalculationFailed=G,n.Impossible=N,n.showBalanceTxError=oe}(c),function(e){"use strict";e.random=Math.random}(c["Effect.Random"]=c["Effect.Random"]||{}),function(e){"use strict";e["Effect.Random"]=e["Effect.Random"]||{};var n=e["Effect.Random"],t=e["Effect.Random"],r=e["Data.Int"];n.randomInt=function(e){return function(n){return function(){var o=t.random(),a=(r.toNumber(n)-r.toNumber(e)+1)*o+r.toNumber(e);return r.floor(a)}}}}(c),function(e){"use strict";e["Ctl.Internal.CoinSelection.UtxoIndex"]=e["Ctl.Internal.CoinSelection.UtxoIndex"]||{};var n,t,r,o,a=e["Ctl.Internal.CoinSelection.UtxoIndex"],u=e["Control.Applicative"],i=e["Ctl.Internal.Cardano.Types.Value"],c=e["Ctl.Internal.Types.Transaction"],l=e["Data.Array"],s=e["Data.Boolean"],f=e["Data.Eq"],d=e["Data.Foldable"],v=e["Data.Function"],m=e["Data.Functor"],p=e["Data.Lens.Getter"],g=e["Data.Lens.Internal.Forget"],y=e["Data.Lens.Iso"],b=e["Data.Lens.Record"],w=e["Data.Lens.Setter"],C=e["Data.Map.Internal"],h=e["Data.Maybe"],A=e["Data.Newtype"],S=e["Data.Ord"],I=e["Data.Ordering"],T=e["Data.Profunctor.Strong"],D=e["Data.Set"],F=e["Data.Tuple"],E=e["Data.Unfoldable"],x=e["Effect.Class"],M=e["Effect.Random"],R=e["Type.Proxy"],P=function(){function e(){}return e.value=new e,e}(),k=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),B=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),N=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),L=function(){function e(){}return e.value=new e,e}(),_=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),U=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),H=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),q=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),O=function(e){return e},V={eq:function(e){return function(n){return e instanceof L&&n instanceof L||e instanceof _&&n instanceof _&&f.eq(i.eqAssetClass)(e.value0)(n.value0)}}},W={compare:function(e){return function(n){if(e instanceof L&&n instanceof L)return I.EQ.value;if(e instanceof L)return I.LT.value;if(n instanceof L)return I.GT.value;if(e instanceof _&&n instanceof _)return S.compare(i.ordAssetClass)(e.value0)(n.value0);throw new Error("Failed pattern match at Ctl.Internal.CoinSelection.UtxoIndex (line 116, column 1 - line 116, column 26): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return V}},K=(n=D.fromFoldable(d.foldableArray)(i.ordAssetClass),t=A.unwrap(),function(e){return n(i.valueAssetClasses(t(e).amount))}),z={indexAnyWith:C.empty,indexSingletons:C.empty,indexPairs:C.empty,utxos:C.empty},J=function(e){return y.iso((function(e){return e}))(O)(e)},G=function(e){var n=J(e.Profunctor0()),t=b.prop({reflectSymbol:function(){return"indexAnyWith"}})()()(R.Proxy.value)(e);return function(e){return n(t(e))}},j=function(e){var n=J(e.Profunctor0()),t=b.prop({reflectSymbol:function(){return"indexPairs"}})()()(R.Proxy.value)(e);return function(e){return n(t(e))}},Q=function(e){var n=J(e.Profunctor0()),t=b.prop({reflectSymbol:function(){return"indexSingletons"}})()()(R.Proxy.value)(e);return function(e){return n(t(e))}},Z=function(e){return function(n){var t=function(e){var n=K(e),t=D.toUnfoldable(E.unfoldableArray)(n);return 0===t.length?P.value:1===t.length?new k(t[0]):2===t.length?new B(t[0],t[1]):new N(n)}(e);if(t instanceof P)return w.over(Q(T.strongFn))(n(L.value));if(t instanceof k){var r=w.over(j(T.strongFn))(n(L.value)),o=w.over(Q(T.strongFn))(n(new _(t.value0)));return function(e){return r(o(e))}}if(t instanceof B){var a=w.over(G(T.strongFn))(n(L.value)),u=w.over(j(T.strongFn))(n(new _(t.value0))),i=w.over(j(T.strongFn))(n(new _(t.value1)));return function(e){return a(u(i(e)))}}if(t instanceof N){var c=w.over(G(T.strongFn))(v.flip(d.foldl(D.foldableSet)(v.flip((function(e){return n(_.create(e))}))))(t.value0)),l=w.over(G(T.strongFn))(n(L.value));return function(e){return c(l(e))}}throw new Error("Failed pattern match at Ctl.Internal.CoinSelection.UtxoIndex (line 204, column 3 - line 216, column 57): "+[t.constructor.name])}},X=function(e){var n=J(e.Profunctor0()),t=b.prop({reflectSymbol:function(){return"utxos"}})()()(R.Proxy.value)(e);return function(e){return n(t(e))}},Y=function(e){var n,t=C.update(W)((n=C.delete(c.ordTransactionInput)(e.value0),function(e){return h.Just.create(n(e))})),r=w.over(X(T.strongFn))(C.delete(c.ordTransactionInput)(e.value0)),o=Z(e.value1)(t);return function(e){return r(o(e))}},$=(r=l.foldl(v.flip((function(e){var n,t=C.alter(W)((n=h.maybe(C.singleton(e.value0)(e.value1))(C.insert(c.ordTransactionInput)(e.value0)(e.value1)),function(e){return h.Just.create(n(e))})),r=w.over(X(T.strongFn))(C.insert(c.ordTransactionInput)(e.value0)(e.value1)),o=Z(e.value1)(t);return function(e){return r(o(e))}})))(z),o=C.toUnfoldable(E.unfoldableArray),function(e){return r(o(e))}),ee=p.view(X(g.strongForget));a.Asset=_,a.AssetLovelace=L,a.SelectAnyWith=q,a.SelectPairWith=H,a.SelectSingleton=U,a.buildUtxoIndex=$,a.emptyUtxoIndex=z,a.selectRandomWithFilter=function(e){return function(n){return function(t){var r=function(){var e=function(e){return function(t){return h.fromMaybe(C.empty)(C.lookup(W)(e)(p.viewOn(n)(t(g.strongForget))))}};if(t instanceof U)return e(t.value0)((function(e){return Q(e)}));if(t instanceof H)return e(t.value0)((function(e){return j(e)}));if(t instanceof q)return e(t.value0)((function(e){return G(e)}));throw new Error("Failed pattern match at Ctl.Internal.CoinSelection.UtxoIndex (line 281, column 5 - line 287, column 41): "+[t.constructor.name])}();return m.mapFlipped(e.Monad0().Bind1().Apply0().Functor0())(function(e){return function(n){if(C.isEmpty(n))return u.pure(e.Monad0().Applicative0())(h.Nothing.value);if(s.otherwise)return x.liftEffect(e)((function(){var e=M.randomInt(0)(C.size(n)-1|0)();return l.index(C.toUnfoldable(E.unfoldableArray)(n))(e)}));throw new Error("Failed pattern match at Ctl.Internal.CoinSelection.UtxoIndex (line 322, column 1 - line 326, column 24): "+[n.constructor.name])}}(e)(r))(m.map(h.functorMaybe)((function(e){return new F.Tuple(e,Y(e)(n))})))}}},a.utxoIndexDeleteEntry=Y,a.utxoIndexUniverse=ee}(c),function(e){"use strict";e["Data.Map"]=e["Data.Map"]||{};var n,t=e["Data.Map"],r=e["Data.Functor"],o=e["Data.Map.Internal"],a=e["Data.Set"],u=(n=r.void(o.functorMap),function(e){return a.fromMap(n(e))});t.keys=u}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.CoinSelection"]=e["Ctl.Internal.BalanceTx.CoinSelection"]||{};var n,t,r,o,a,u=e["Ctl.Internal.BalanceTx.CoinSelection"],i=e["Control.Applicative"],c=e["Control.Bind"],l=e["Control.Monad.Error.Class"],s=e["Ctl.Internal.BalanceTx.Error"],f=e["Ctl.Internal.Cardano.Types.Value"],d=e["Ctl.Internal.CoinSelection.UtxoIndex"],v=e["Ctl.Internal.Plutus.Conversion.Value"],m=e["Ctl.Internal.Types.ByteArray"],p=e["Ctl.Internal.Types.TokenName"],g=e["Ctl.Internal.Types.Transaction"],y=e["Data.Array"],b=e["Data.Array.NonEmpty"],w=e["Data.Array.NonEmpty.Internal"],C=e["Data.BigInt"],h=e["Data.Boolean"],A=e["Data.Foldable"],S=e["Data.Function"],I=e["Data.Functor"],T=e["Data.Lens.Getter"],D=e["Data.Lens.Internal.Forget"],F=e["Data.Lens.Iso.Newtype"],E=e["Data.Lens.Record"],x=e["Data.Lens.Setter"],M=e["Data.Map"],R=e["Data.Map.Internal"],P=e["Data.Maybe"],k=e["Data.Monoid"],B=e["Data.Newtype"],N=e["Data.Ord"],L=e["Data.Profunctor.Strong"],_=e["Data.Ring"],U=e["Data.Semiring"],H=e["Data.Set"],q=e["Data.Show"],O=e["Data.Tuple"],V=e["Type.Proxy"],W=function(){function e(){}return e.value=new e,e}(),K=function(){function e(){}return e.value=new e,e}(),z=function(){function e(){}return e.value=new e,e}(),J=function(){function e(){}return e.value=new e,e}(),G=function(e){return function(n){var t="tn: "+m.byteArrayToHex(p.getTokenName(e.value1))+", ",r="quantity: "+C.toString(n)+"))";return"(Asset (cs: "+m.byteArrayToHex(f.getCurrencySymbol(e.value0))+", "+(t+r)}},j=function(e){return function(n){return function(t){return function(t){var r,o=b.fromArray(t.tail);if(o instanceof P.Nothing)return d.selectRandomWithFilter(e)(n)(t.head);if(o instanceof P.Just)return c.bindFlipped(e.Monad0().Bind1())(P["maybe'"]((function(t){return j(e)(n)(o.value0)}))((r=i.pure(e.Monad0().Applicative0()),function(e){return r(P.Just.create(e))})))(d.selectRandomWithFilter(e)(n)(t.head));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 454, column 5 - line 459, column 54): "+[o.constructor.name])}(b.uncons(t))}}},Q=function(e){return function(n){return function(t){if(N.lessThan(C.ordBigInt)(n.currentQuantity(t))(n.requiredQuantity)){var r=new s.InsufficientUtxoBalanceToCoverAsset(s.Impossible.value,n.assetDisplayString);return c.bind(e.Monad0().Bind1())(n.selectQuantityCover(t))(P.maybe(l.throwError(e)(r))((o=i.pure(e.Monad0().Applicative0()),function(e){return o(P.Just.create(e))})))}var o,a;if(h.otherwise){var u=function(){if(n.selectionStrategy instanceof K)return 1;if(n.selectionStrategy instanceof W)return 2;throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 381, column 9 - line 383, column 40): "+[n.selectionStrategy.constructor.name])}(),f=U.mul(C.semiringBigInt)(n.requiredQuantity)(C.fromInt(u)),d=(a=_.sub(C.ringBigInt)(f),function(e){return C.abs(a(n.currentQuantity(e)))}),v=function(e){if(N.lessThan(C.ordBigInt)(d(e))(d(t)))return new P.Just(e);if(h.otherwise)return P.Nothing.value;throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 370, column 7 - line 370, column 67): "+[e.constructor.name])};return I.map(e.Monad0().Bind1().Apply0().Functor0())((function(e){return c.bindFlipped(P.bindMaybe)(v)(e)}))(n.selectQuantityImprove(t))}throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 348, column 1 - line 353, column 30): "+[n.constructor.name,t.constructor.name])}}},Z=(n=B.wrap(),function(e){return n({leftoverUtxos:e,selectedUtxos:R.empty})}),X=(Z(d.emptyUtxoIndex),A.foldMap(R.foldableMap)(f.monoidValue)((t=B.unwrap(),function(e){return t(e).amount}))),Y=(r=B.unwrap(),function(e){return X(r(e).selectedUtxos)}),$=function(e){return f["valueToCoin'"](Y(e))},ee=function(e){var n=F._Newtype()()(e.Profunctor0()),t=E.prop({reflectSymbol:function(){return"selectedUtxos"}})()()(V.Proxy.value)(e);return function(e){return n(t(e))}},ne=(o=H.fromFoldable(H.foldableSet)(g.ordTransactionInput),a=T.view(ee(D.strongForget)),function(e){return o(M.keys(a(e)))}),te=function(e){var n=F._Newtype()()(e.Profunctor0()),t=E.prop({reflectSymbol:function(){return"leftoverUtxos"}})()()(V.Proxy.value)(e);return function(e){return n(t(e))}},re=function(e){var n=x.over(ee(L.strongFn))(R.insert(g.ordTransactionInput)(e.value0)(e.value1)),t=x.over(te(L.strongFn))(d.utxoIndexDeleteEntry(e));return function(e){return n(t(e))}},oe=function(e){return function(n){return function(t){return function(r){var o,a=(o=S.flip(re)(r),function(e){return o(O.fst(e))}),u=function(e){return function(n){if(n instanceof z)return I.map(w.functorNonEmptyArray)(S.applyFlipped(e))(b["cons'"](d.SelectSingleton.create)([d.SelectPairWith.create,d.SelectAnyWith.create]));if(n instanceof J)return b.singleton(new d.SelectSingleton(e));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 437, column 3 - line 442, column 48): "+[n.constructor.name])}}(n)(t);return I.map(e.Monad0().Bind1().Apply0().Functor0())(I.map(P.functorMaybe)(a))(j(e)(T.viewOn(r)(te(D.strongForget)))(u))}}}};u.SelectionStrategyOptimal=W,u._leftoverUtxos=te,u.performMultiAssetSelection=function(e){return function(n){return function(t){return function(r){return function(o){var a,u,m,p,g,b,w=(m=Q(n)(function(e){return function(n){return function(t){return{assetDisplayString:q.show(f.showCoin)(t),currentQuantity:$,requiredQuantity:B.unwrap()(t),selectQuantityCover:oe(e)(d.AssetLovelace.value)(z.value),selectQuantityImprove:oe(e)(d.AssetLovelace.value)(J.value),selectionStrategy:n}}}}(e)(t)(f.valueToCoin(o))),p=f.valueAssets(o),a=Q(n),u=function(e){return function(n){return function(t){return{assetDisplayString:G(t.value0)(t.value1),currentQuantity:(r=t.value0,o=f.getAssetQuantity(r),function(e){return o(Y(e))}),requiredQuantity:t.value1,selectQuantityCover:oe(e)(new d.Asset(t.value0))(z.value),selectQuantityImprove:oe(e)(new d.Asset(t.value0))(J.value),selectionStrategy:n};var r,o}}}(e)(t),g=function(e){return a(u(e))},y.snoc(I.map(I.functorArray)(g)(p))(m)),C=X(d.utxoIndexUniverse(r)),h=new s.BalanceInsufficientError(v.toPlutusValue(o),v.toPlutusValue(C),v.toPlutusValue(k.mempty(f.monoidValue))),A=f.leq(o)(C);if(A)return(b=e.Monad0(),function(e){return function(n){var t=function(e){return function(n){return function(r){if(0===n.length&&0===r.length)return i.pure(b.Applicative0())(e);var o=y.uncons(n);if(o instanceof P.Nothing)return t(e)(r)([]);if(o instanceof P.Just)return c.bind(b.Bind1())(o.value0.head(e))((function(n){if(n instanceof P.Nothing)return t(e)(o.value0.tail)(r);if(n instanceof P.Just)return t(n.value0)(o.value0.tail)(y.snoc(r)(o.value0.head));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 422, column 17 - line 424, column 49): "+[n.constructor.name])}));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 419, column 5 - line 424, column 49): "+[o.constructor.name])}}};return t(e)(n)([])}})(Z(r))(w);if(!A)return l.throwError(n)(h);throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.CoinSelection (line 134, column 3 - line 138, column 42): "+[A.constructor.name])}}}}},u.selectedInputs=ne}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.Constraints"]=e["Ctl.Internal.BalanceTx.Constraints"]||{};var n,t,r,o,a,u=e["Ctl.Internal.BalanceTx.Constraints"],i=e["Ctl.Internal.BalanceTx.CoinSelection"],c=e["Ctl.Internal.Plutus.Conversion.Address"],l=e["Ctl.Internal.Types.Transaction"],s=e["Data.Function"],f=e["Data.Lens.Iso.Newtype"],d=e["Data.Lens.Record"],v=e["Data.Lens.Setter"],m=e["Data.Map.Internal"],p=e["Data.Maybe"],g=e["Data.Monoid"],y=e["Data.Newtype"],b=e["Data.Profunctor.Strong"],w=e["Data.Set"],C=e["Type.Proxy"],h=(n=y.wrap()({additionalUtxos:m.empty,maxChangeOutputTokenQuantity:p.Nothing.value,nonSpendableInputs:g.mempty(w.monoidSet(l.ordTransactionInput)),srcAddresses:p.Nothing.value,changeAddress:p.Nothing.value,selectionStrategy:i.SelectionStrategyOptimal.value}),t=s.applyFlipped(n),r=y.unwrap(),function(e){return t(r(e))}),A=function(e){var n=f._Newtype()()(e.Profunctor0()),t=d.prop({reflectSymbol:function(){return"changeAddress"}})()()(C.Proxy.value)(e);return function(e){return n(t(e))}},S=(o=y.wrap(),a=v.setJust(A(b.strongFn)),function(e){return o(a(c.fromPlutusAddressWithNetworkTag(e)))});u.buildBalanceTxConstraints=h,u.mustSendChangeToAddress=S,u._additionalUtxos=function(e){var n=f._Newtype()()(e.Profunctor0()),t=d.prop({reflectSymbol:function(){return"additionalUtxos"}})()()(C.Proxy.value)(e);return function(e){return n(t(e))}},u._changeAddress=A,u._maxChangeOutputTokenQuantity=function(e){var n=f._Newtype()()(e.Profunctor0()),t=d.prop({reflectSymbol:function(){return"maxChangeOutputTokenQuantity"}})()()(C.Proxy.value)(e);return function(e){return n(t(e))}},u._nonSpendableInputs=function(e){var n=f._Newtype()()(e.Profunctor0()),t=d.prop({reflectSymbol:function(){return"nonSpendableInputs"}})()()(C.Proxy.value)(e);return function(e){return n(t(e))}},u._selectionStrategy=function(e){var n=f._Newtype()()(e.Profunctor0()),t=d.prop({reflectSymbol:function(){return"selectionStrategy"}})()()(C.Proxy.value)(e);return function(e){return n(t(e))}},u._srcAddresses=function(e){var n=f._Newtype()()(e.Profunctor0()),t=d.prop({reflectSymbol:function(){return"srcAddresses"}})()()(C.Proxy.value)(e);return function(e){return n(t(e))}}}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.Types"]=e["Ctl.Internal.BalanceTx.Types"]||{};var n,t,r,o,a,u,i,c=e["Ctl.Internal.BalanceTx.Types"],l=e["Control.Bind"],s=e["Control.Monad.Except.Trans"],f=e["Control.Monad.Reader.Class"],d=e["Control.Monad.Reader.Trans"],v=e["Control.Monad.Trans.Class"],m=e["Ctl.Internal.BalanceTx.Constraints"],p=e["Ctl.Internal.Cardano.Types.Transaction"],g=e["Ctl.Internal.Contract.Monad"],y=e["Ctl.Internal.Types.Scripts"],b=e["Ctl.Internal.Wallet"],w=e["Data.Function"],C=e["Data.Functor"],h=e["Data.Lens.Getter"],A=e["Data.Lens.Internal.Forget"],S=e["Data.Map.Internal"],I=e["Data.Maybe"],T=e["Data.Newtype"],D=e["Data.Set"],F=(n=v.lift(d.monadTransReaderT)(g.monadContract),function(e){return s.ExceptT(n(e))}),E=(t=v.lift(s.monadTransExceptT)(d.monadReaderT(g.monadContract)),r=v.lift(d.monadTransReaderT)(g.monadContract),function(e){return t(r(e))}),x=(o=v.lift(s.monadTransExceptT)(d.monadReaderT(g.monadContract)),a=v.lift(d.monadTransReaderT)(g.monadContract),u=f.asks(g.monadAskContractEnvContra),function(e){return o(a(u(e)))}),M=x((function(e){return e.networkId})),R=x((i=T.unwrap(),function(e){return function(e){return e.coinsPerUtxoUnit}(i(e.ledgerConstants.pparams))})),P=x(l.composeKleisliFlipped(I.bindMaybe)(b.cip30Wallet)((function(e){return e.wallet})));c.FinalizedTransaction=function(e){return e},c.askCip30Wallet=P,c.askCoinsPerUtxoUnit=R,c.askCostModelsForLanguages=function(e){return C.mapFlipped(s.functorExceptT(d.functorReaderT(g.functorContract)))(x((n=T.unwrap(),function(e){return function(e){return e.costModels}(n(e.ledgerConstants.pparams))})))(T.over()()(p.Costmdls)(S.filterKeys(y.ordLanguage)(w.flip(D.member(y.ordLanguage))(e))));var n},c.askNetworkId=M,c.asksConstraints=function(e){return f.asks(s.monadAskExceptT(d.monadAskReaderT(g.monadContract)))((n=h.view(e(A.strongForget)),function(e){return n(e.constraints)}));var n},c.liftEitherContract=F,c.liftContract=E,c.withBalanceTxConstraints=function(e){var n=m.buildBalanceTxConstraints(e);return w.flip(d.runReaderT)({constraints:n})}}(c),function(e){"use strict";e["Data.Ord.Max"]=e["Data.Ord.Max"]||{};var n=e["Data.Ord.Max"],t=e["Data.Ord"];n.semigroupMax=function(e){return{append:function(n){return function(r){return t.max(e)(n)(r)}}}}}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.Collateral"]=e["Ctl.Internal.BalanceTx.Collateral"]||{};var n,t,r,o,a=e["Ctl.Internal.BalanceTx.Collateral"],u=e["Control.Applicative"],i=e["Control.Bind"],c=e["Control.Monad.Except.Trans"],l=e["Control.Monad.Reader.Trans"],s=e["Ctl.Internal.BalanceTx.Collateral.Select"],f=e["Ctl.Internal.BalanceTx.Error"],d=e["Ctl.Internal.BalanceTx.Types"],v=e["Ctl.Internal.BalanceTx.UtxoMinAda"],m=e["Ctl.Internal.Cardano.Types.Transaction"],p=e["Ctl.Internal.Cardano.Types.Value"],g=e["Ctl.Internal.Contract.Monad"],y=e["Ctl.Internal.Types.BigNum"],b=e["Ctl.Internal.Types.OutputDatum"],w=e["Data.BigInt"],C=e["Data.Either"],h=e["Data.Eq"],A=e["Data.Foldable"],S=e["Data.Functor"],I=e["Data.Lens.Setter"],T=e["Data.Maybe"],D=e["Data.Monoid"],F=e["Data.Newtype"],E=e["Data.Ord"],x=e["Data.Ord.Max"],M=e["Data.Profunctor.Strong"],R=e["Data.Ring"],P=e["Data.Semigroup"],k=e["Data.Semiring"],B=e["Effect.Class"],N=(n=F.unwrap(),t=F.unwrap(),function(e){return p.getNonAdaAsset(n(t(e).output).amount)}),L=(r=F.unwrap(),o=F.unwrap(),function(e){return p["valueToCoin'"](r(o(e).output).amount)}),_=function(e){var n=k.add(w.semiringBigInt)(e);return function(e){return n(L(e))}};a.addTxCollateral=function(e){return function(n){return I.setJust((r=m._body(M.strongFn),o=m._collateral(M.strongFn),function(e){return r(o(e))}))(S.map(S.functorArray)((t=F.unwrap(),function(e){return t(e).input}))(e))(n);var t,r,o}},a.addTxCollateralReturn=function(e){return function(n){return function(t){var r=A.foldMap(A.foldableArray)(p.monoidNonAdaAsset)(N)(e),o=A.foldl(A.foldableArray)(_)(k.zero(w.semiringBigInt))(e),a=E.lessThanOrEq(w.ordBigInt)(o)(s.minRequiredCollateral)&&h.eq(p.eqNonAdaAsset)(r)(D.mempty(p.monoidNonAdaAsset));if(a)return u.pure(c.applicativeExceptT(l.monadReaderT(g.monadContract)))(n);if(!a)return function(e){return function(r){var o=F.wrap()(y.toBigInt(y.maxValue)),a={address:t,amount:p.mkValue(o)(r),datum:b.NoOutputDatum.value,scriptRef:T.Nothing.value};return i.bind(c.bindExceptT(l.monadReaderT(g.monadContract)))(d.askCoinsPerUtxoUnit)((function(t){return i.bind(c.bindExceptT(l.monadReaderT(g.monadContract)))(S.mapFlipped(l.functorReaderT(g.functorContract))(B.liftEffect(l.monadEffectReader(g.monadEffectContract))(v.utxoMinAdaValue(t)(F.wrap()(a))))(C.note(f.CollateralReturnMinAdaValueCalcError.value)))((function(t){var o=F.unwrap()(P.append(x.semigroupMax(w.ordBigInt))(R.sub(w.ringBigInt)(e)(s.minRequiredCollateral))(t)),u=F.wrap()({amount:p.mkValue(F.wrap()(o))(r),address:a.address,datum:a.datum,scriptRef:a.scriptRef}),i=R.sub(w.ringBigInt)(e)(o);return c.except(l.applicativeReaderT(g.applicativeContract))(function(){var e,t,r,o,a=E.greaterThan(w.ordBigInt)(i)(k.zero(w.semiringBigInt));if(a)return new C.Right(I.setJust((r=m._body(M.strongFn),o=m._totalCollateral(M.strongFn),function(e){return r(o(e))}))(F.wrap()(i))(I.setJust((e=m._body(M.strongFn),t=m._collateralReturn(M.strongFn),function(n){return e(t(n))}))(u)(n)));if(!a)return new C.Left(new f.CollateralReturnError("Negative totalCollateral after covering min-utxo-ada requirement."));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Collateral (line 116, column 7 - line 124, column 80): "+[a.constructor.name])}())}))}))}}(o)(r);throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.Collateral (line 70, column 5 - line 74, column 59): "+[a.constructor.name])}}}}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.Helpers"]=e["Ctl.Internal.BalanceTx.Helpers"]||{};var n=e["Ctl.Internal.BalanceTx.Helpers"],t=e["Ctl.Internal.Cardano.Types.Transaction"],r=e["Ctl.Internal.Types.UnbalancedTransaction"],o=e["Data.Lens.Getter"],a=e["Data.Lens.Internal.Forget"],u=e["Data.Lens.Lens"],i=e["Data.Lens.Setter"],c=e["Data.Profunctor.Strong"],l=e["Data.Tuple"],s=function(e){return u["lens'"]((function(e){return new l.Tuple(e.unbalancedTx,(function(n){return{unbalancedTx:n,datums:e.datums,redeemersTxIns:e.redeemersTxIns}}))}))(e)},f=function(e){return u["lens'"]((function(e){return new l.Tuple(o.viewOn(e)((n=s(a.strongForget),t=r._transaction(a.strongForget),function(e){return n(t(e))})),(function(n){return i.over(s(c.strongFn))(i.set(r._transaction(c.strongFn))(n))(e)}));var n,t}))(e)};n["_body'"]=function(e){return u["lens'"]((function(e){return new l.Tuple(o.viewOn(e)((n=f(a.strongForget),r=t._body(a.strongForget),function(e){return n(r(e))})),(function(n){return i.over(f(c.strongFn))(i.set(t._body(c.strongFn))(n))(e)}));var n,r}))(e)},n._redeemersTxIns=function(e){return u["lens'"]((function(e){return new l.Tuple(e.redeemersTxIns,(function(n){return{unbalancedTx:e.unbalancedTx,datums:e.datums,redeemersTxIns:n}}))}))(e)},n["_transaction'"]=f,n._unbalancedTx=s}(c),function(e){let n;n=t(1164),n=t(6359)(n),e._minFee=e=>t=>r=>o=>{try{const a=n.LinearFee.new(o,r);return e.just(n.min_fee(t,a))}catch(n){return e.nothing}},e._minScriptFee=e=>t=>n.min_script_fee(t,e)}(c["Ctl.Internal.Serialization.MinFee"]=c["Ctl.Internal.Serialization.MinFee"]||{}),function(e){"use strict";e["Ctl.Internal.Serialization.MinFee"]=e["Ctl.Internal.Serialization.MinFee"]||{};var n=e["Ctl.Internal.Serialization.MinFee"],t=e["Ctl.Internal.Serialization.MinFee"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Control.Monad.Error.Class"],u=e["Ctl.Internal.Cardano.Types.NativeScript"],i=e["Ctl.Internal.Cardano.Types.Transaction"],c=e["Ctl.Internal.FfiHelpers"],l=e["Ctl.Internal.NativeScripts"],s=e["Ctl.Internal.Serialization"],f=e["Ctl.Internal.Serialization.Hash"],d=e["Ctl.Internal.Types.BigNum"],v=e["Data.Array"],m=e["Data.BigInt"],p=e["Data.Foldable"],g=e["Data.Functor"],y=e["Data.Lens.Setter"],b=e["Data.Maybe"],w=e["Data.Monoid"],C=e["Data.Newtype"],h=e["Data.Profunctor.Strong"],A=e["Data.Semiring"],S=e["Data.Set"],I=e["Data.Tuple"],T=e["Effect.Class"],D=e["Effect.Exception"],F=new I.Tuple(b.fromJust()(i.mkPublicKey("ed25519_pk1p9sf9wz3t46u9ghht44203gerxt82kzqaqw74fqrmwjmdy8sjxmqknzq8j")),b.fromJust()(i.mkEd25519Signature("ed25519_sig1mr6pm5kanam2wkmae70jx7fjkzepghefj0lmnczu6fra6auf2urgrte5axxhunw4x34l3l8tj9c0t4le39tj8lpjdgxmqnujw07tkzs9m6t6x")));n.calculateMinFeeCsl=function(e){return function(n){return function(I){return function(E){return function(x){var M=function(e){return function(n){var t,r,o,a,c,s,d,m,A,I,T,D,E,x=(t=S.fromFoldable(p.foldableArray)(f.ordEd25519KeyHash),r=g.map(g.functorArray)(C.unwrap()),o=b.fromMaybe(w.mempty(w.monoidArray)),a=C.unwrap(),function(e){return t(r(o(function(e){return e.requiredSigners}(a(e.body)))))})(C.unwrap()(n)),M=l.getMaximumSigners(x)(new u.ScriptAll((c=b.fromMaybe(w.mempty(w.monoidArray)),s=C.unwrap(),function(e){return c(function(e){return e.nativeScripts}(s(e.witnessSet)))})(C.unwrap()(n)))),R=0===(d=S.size(e))?1:d,P=(A=b.fromMaybe(0),I=g.map(b.functorMaybe)((m=g.map(g.functorArray)(C.unwrap()),function(e){return v.length(m(e))})),T=C.unwrap(),function(e){return A(I(function(e){return e.requiredSigners}(T(e.body))))})(C.unwrap()(n));return y.set((D=i._witnessSet(h.strongFn),E=i._vkeys(h.strongFn),function(e){return D(E(e))}))(new b.Just(v.replicate((P+M|0)+R|0)(F)))(n)}}(E)(x);return o.bind(e.Monad0().Bind1())(T.liftEffect(e)(s.convertTransaction(M)))((function(u){return o.bind(e.Monad0().Bind1())(a.liftMaybe(n)(D.error("Unable to calculate min_fee"))(g.map(b.functorMaybe)(d.toBigInt)(t._minFee(c.maybeFfiHelper)(u)(d.fromUInt(I.txFeeFixed))(d.fromUInt(I.txFeePerByte)))))((function(n){return o.bind(e.Monad0().Bind1())(T.liftEffect(e)(s.convertExUnitPrices(I.prices)))((function(o){var a=d.toBigInt(t._minScriptFee(o)(u));return r.pure(e.Monad0().Applicative0())(C.wrap()(A.add(m.semiringBigInt)(n)(a)))}))}))}))}}}}}}(c),function(e){"use strict";e["Ctl.Internal.Contract.MinFee"]=e["Ctl.Internal.Contract.MinFee"]||{};var n=e["Ctl.Internal.Contract.MinFee"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Category"],a=e["Ctl.Internal.Cardano.Types.Transaction"],u=e["Ctl.Internal.Contract"],i=e["Ctl.Internal.Contract.Monad"],c=e["Ctl.Internal.Contract.QueryHandle"],l=e["Ctl.Internal.Contract.Wallet"],s=e["Ctl.Internal.Helpers"],f=e["Ctl.Internal.Serialization.Address"],d=e["Ctl.Internal.Serialization.Hash"],v=e["Ctl.Internal.Serialization.MinFee"],m=e["Ctl.Internal.Types.Transaction"],p=e["Data.Array"],g=e["Data.Either"],y=e["Data.Foldable"],b=e["Data.Functor"],w=e["Data.Lens.Getter"],C=e["Data.Lens.Internal.Forget"],h=e["Data.List.Types"],A=e["Data.Map"],S=e["Data.Map.Internal"],I=e["Data.Maybe"],T=e["Data.Newtype"],D=e["Data.Semigroup"],F=e["Data.Set"],E=e["Data.Show"],x=e["Data.Traversable"],M=e["Data.Tuple"],R=e["Effect.Aff"],P=e["Effect.Aff.Class"],k=e["Effect.Exception"];n.calculateMinFee=function(e){return function(n){return r.bind(i.bindContract)(function(e){return function(n){var u,v,B,N=(v=S.fromFoldable(m.ordTransactionInput)(y.foldableArray),B=b.map(b.functorArray)((u=T.unwrap(),function(e){return n=u(e),new M.Tuple(n.input,n.output);var n})),function(e){return v(B(e))}),L=function(e){return function(n){return function(n){return function(t){return function(r){return b.map(e.Bind1().Apply0().Functor0())(F.fromFoldable(y.foldableArray)(n))(x.for(e.Applicative0())(x.traversableArray)(p.fromFoldable(F.foldableSet)(t))(r))}}}}};return r.bind(i.bindContract)(c.getQueryHandle)((function(u){var c,v,x,M=F.difference(m.ordTransactionInput)(w.viewOn(e)((c=a._body(C.strongForget),v=a._inputs(C.strongForget),function(e){return c(v(e))})))(A.keys(n)),B=F.fromFoldable(h.foldableList)(f.ordAddress)(b.map(h.functorList)((x=T.unwrap(),function(e){return x(e).address}))(S.values(n)));return r.bind(i.bindContract)(L(i.monadContract)(m.ordTransactionInput)(f.ordAddress)(M)((function(e){return s.liftedM(i.monadErrorErrorContract)(k.error("Couldn't get tx output for "+E.show(m.showTransactionInput)(e)))(b.map(i.functorContract)(b.map(I.functorMaybe)((t=T.unwrap(),function(e){return t(e).address})))(P.liftAff(i.monadAffContract)(b.mapFlipped(R.functorAff)(u.getUtxoByOref(e))((n=r.join(I.bindMaybe),function(e){return n(g.hush(e))})))));var n,t})))((function(n){var u,c,v=F.fromFoldable(y.foldableArray)(m.ordTransactionInput)(I.fromMaybe([])(w.viewOn(e)((u=a._body(C.strongForget),c=a._collateral(C.strongForget),function(e){return u(c(e))}))));return r.bind(i.bindContract)(b.map(i.functorContract)(I.maybe(S.empty)(N))(l.getWalletCollateral))((function(e){return r.bind(i.bindContract)(L(i.monadContract)(m.ordTransactionInput)(f.ordAddress)(v)((function(n){return s.liftM(i.monadErrorErrorContract)(k.error("Couldn't get tx output for "+E.show(m.showTransactionInput)(n)))(b.map(I.functorMaybe)((t=T.unwrap(),function(e){return t(e).address}))(S.lookup(m.ordTransactionInput)(n)(e)));var t})))((function(e){return r.bind(i.bindContract)(b.map(i.functorContract)(F.fromFoldable(y.foldableArray)(f.ordAddress))(l.getWalletAddresses))((function(a){var u=F.intersection(f.ordAddress)(a)(F.union(f.ordAddress)(F.union(f.ordAddress)(B)(n))(e));return r.bind(i.bindContract)(b.map(i.functorContract)(F.mapMaybe(d.ordEd25519KeyHash)(o.identity(o.categoryFn)))(L(i.monadContract)(f.ordAddress)(I.ordMaybe(d.ordEd25519KeyHash))(u)((function(e){return r.bind(i.bindContract)(s.liftM(i.monadErrorErrorContract)(k.error("Could not extract payment credential from Address: "+E.show(f.showAddress)(e)))(f.addressPaymentCred(e)))((function(e){return t.pure(i.applicativeContract)(f.stakeCredentialToKeyHash(e))}))}))))((function(e){var n=F.fromFoldable(y.foldableArray)(d.ordEd25519KeyHash)(p.mapMaybe(r.composeKleisliFlipped(I.bindMaybe)(f.stakeCredentialToKeyHash)(f.addressStakeCred))(p.fromFoldable(F.foldableSet)(u)));return t.pure(i.applicativeContract)(D.append(F.semigroupSet(d.ordEd25519KeyHash))(e)(n))}))}))}))}))}))}))}}(e)(n))((function(n){return r.bind(i.bindContract)(u.getProtocolParameters)((function(t){return v.calculateMinFeeCsl(i.monadEffectContract)(i.monadThrowErrorContract)(t)(n)(e)}))}))}}}(c),function(e){"use strict";e["Ctl.Internal.TxOutput"]=e["Ctl.Internal.TxOutput"]||{};var n,t=e["Ctl.Internal.TxOutput"],r=e["Ctl.Internal.Address"],o=e["Ctl.Internal.Serialization.PlutusData"],a=e["Ctl.Internal.Serialization.ToBytes"],u=e["Ctl.Internal.Types.ByteArray"],i=e["Ctl.Internal.Types.OutputDatum"],c=e["Data.Functor"],l=e["Data.Maybe"],s=e["Data.Newtype"],f=function(e){return(n=s.unwrap(),function(e){return u.byteArrayToHex(n(e))})(a.toBytes()(o.convertPlutusData(e)));var n},d=(n=s.unwrap(),function(e){return u.byteArrayToHex(n(e))});t.transactionInputToTxOutRef=function(e){return{txId:u.byteArrayToHex(s.unwrap()(e.transactionId)),index:e.index}},t.transactionOutputToOgmiosTxOut=function(e){return{address:r.addressToOgmiosAddress(e.address),value:e.amount,datumHash:c.map(l.functorMaybe)(d)(i.outputDatumDataHash(e.datum)),datum:c.map(l.functorMaybe)(f)(i.outputDatumDatum(e.datum)),script:e.scriptRef}}}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx.ExUnitsAndMinFee"]=e["Ctl.Internal.BalanceTx.ExUnitsAndMinFee"]||{};var n=e["Ctl.Internal.BalanceTx.ExUnitsAndMinFee"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Error.Class"],a=e["Control.Monad.Except.Trans"],u=e["Control.Monad.Reader.Trans"],i=e["Ctl.Internal.BalanceTx.Constraints"],c=e["Ctl.Internal.BalanceTx.Error"],l=e["Ctl.Internal.BalanceTx.Helpers"],s=e["Ctl.Internal.BalanceTx.Types"],f=e["Ctl.Internal.Cardano.Types.ScriptRef"],d=e["Ctl.Internal.Cardano.Types.Transaction"],v=e["Ctl.Internal.Contract.MinFee"],m=e["Ctl.Internal.Contract.Monad"],p=e["Ctl.Internal.Contract.QueryHandle"],g=e["Ctl.Internal.Plutus.Conversion"],y=e["Ctl.Internal.ReindexRedeemers"],b=e["Ctl.Internal.Transaction"],w=e["Ctl.Internal.TxOutput"],C=e["Ctl.Internal.Types.Natural"],h=e["Ctl.Internal.Types.RedeemerTag"],A=e["Ctl.Internal.Types.Scripts"],S=e["Ctl.Internal.Types.Transaction"],I=e["Ctl.Internal.Types.UnbalancedTransaction"],T=e["Data.Array"],D=e["Data.Bifunctor"],F=e["Data.Either"],E=e["Data.Foldable"],x=e["Data.Function"],M=e["Data.Functor"],R=e["Data.Lens.Getter"],P=e["Data.Lens.Internal.Forget"],k=e["Data.Lens.Setter"],B=e["Data.Map.Internal"],N=e["Data.Maybe"],L=e["Data.Monoid"],_=e["Data.Newtype"],U=e["Data.Ord"],H=e["Data.Profunctor.Strong"],q=e["Data.Semigroup"],O=e["Data.Set"],V=e["Data.Traversable"],W=e["Data.Tuple"],K=e["Data.UInt"],z=e["Data.Unfoldable"],J=e.Effect,G=e["Effect.Aff.Class"],j=e["Effect.Class"],Q=function(e){return function(n){return M.mapFlipped(M.functorArray)(e)((function(e){return N.maybe(e)((function(n){return new W.Tuple({tag:e.value0.tag,index:e.value0.index,data:e.value0.data,exUnits:{mem:C.toBigInt(n.memory),steps:C.toBigInt(n.steps)}},e.value1)}))(B.lookup(U.ordRecord()(U.ordRecordCons(U.ordRecordCons(U.ordRecordNil)()({reflectSymbol:function(){return"redeemerTag"}})(h.ordRedeemerTag))()({reflectSymbol:function(){return"redeemerIndex"}})(C.ordNatural)))({redeemerTag:e.value0.tag,redeemerIndex:C["fromBigInt'"](e.value0.index)})(n))}))}},Z=function(e){var n,t,r,o,a=R.viewOn(e.unbalancedTx)(I._transaction(P.strongForget));return k.setJust((r=d._witnessSet(H.strongFn),o=d._redeemers(H.strongFn),function(e){return r(o(e))}))(M.map(M.functorArray)(W.fst)(e.redeemersTxIns))(k.setJust((n=d._witnessSet(H.strongFn),t=d._plutusData(H.strongFn),function(e){return n(t(e))}))(M.map(M.functorArray)(_.unwrap())(e.datums))(a))},X=function(e){return function(n){var t=function(e){return r.bindFlipped(N.bindMaybe)(f.getPlutusScript)(e.scriptRef)},o=Z(e),i=R.viewOn(o)(d._body(P.strongForget)),l=R.viewOn(o)(d._witnessSet(P.strongForget)),v=M.map(M.functorArray)(_.wrap())(N.fromMaybe(L.mempty(L.monoidArray))(_.unwrap()(l).plutusData)),p=N.fromMaybe(L.mempty(L.monoidArray))(_.unwrap()(l).redeemers);return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(a.except(u.applicativeReaderT(m.applicativeContract))(function(e){var r,o=T.fromFoldable(O.foldableSet)(q.append(O.semigroupSet(S.ordTransactionInput))(e.inputs)(e.referenceInputs));return M.map(F.functorEither)((r=M.map(M.functorArray)(t),function(e){return T.catMaybes(r(e))}))(V.for(F.applicativeEither)(V.traversableArray)(o)((function(e){return F.note(new c.UtxoLookupFailedFor(e))(B.lookup(S.ordTransactionInput)(e)(n))})))}(i)))((function(e){var n,t=q.append(q.semigroupArray)(N.fromMaybe(L.mempty(L.monoidArray))(function(e){return e.plutusScripts}(_.unwrap()(l))))(e),i=E.foldMap(E.foldableArray)(O.monoidSet(A.ordLanguage))((n=_.unwrap(),function(e){return O.singleton(W.snd(n(e)))}))(t);return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(s.askCostModelsForLanguages(i))((function(e){return j.liftEffect(a.monadEffectExceptT(u.monadEffectReader(m.monadEffectContract)))(M.map(J.functorEffect)(s.FinalizedTransaction)(b.setScriptDataHash(e)(p)(v)(o)))}))}))}};n.evalExUnitsAndMinFee=function(e){return function(n){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(o.liftEither(a.monadThrowExceptT(u.monadReaderT(m.monadContract)))(D.lmap(D.bifunctorEither)(c.ReindexRedeemersError.create)(function(e){var n,t,r=T.fromFoldable(O.foldableSet)(R.viewOn(e)((n=l["_body'"](P.strongForget),t=d._inputs(P.strongForget),function(e){return n(t(e))})));return M.mapFlipped(F.functorEither)(y["reindexSpentScriptRedeemers'"](r)(e.redeemersTxIns))((function(n){return k.set(l._redeemersTxIns(H.strongFn))(n)(e)}))}(e))))((function(e){var f,y=Z(e);return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))((f=y,function(e){var n=r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(s.askNetworkId)((function(e){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(M.mapFlipped(a.functorExceptT(u.functorReaderT(m.functorContract)))(s.asksConstraints((function(e){return i._additionalUtxos(e)})))(g.fromPlutusUtxoMap(e)))((function(e){return t.pure(a.applicativeExceptT(u.monadReaderT(m.monadContract)))(_.wrap()(B.fromFoldable(U.ordRecord()(U.ordRecordCons(U.ordRecordCons(U.ordRecordNil)()({reflectSymbol:function(){return"txId"}})(U.ordString))()({reflectSymbol:function(){return"index"}})(K.uintOrd)))(E.foldableArray)(M.map(M.functorArray)(D.bimap(D.bifunctorTuple)(w.transactionInputToTxOutRef)(w.transactionOutputToOgmiosTxOut))(B.toUnfoldable(z.unfoldableArray)(e)))))}))}));return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(s.liftContract(p.getQueryHandle))((function(i){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(n)((function(n){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(M.map(a.functorExceptT(u.functorReaderT(m.functorContract)))(_.unwrap())(s.liftContract(G.liftAff(m.monadAffContract)(i.evaluateTx(f)(n)))))((function(n){if(n instanceof F.Right)return t.pure(a.applicativeExceptT(u.monadReaderT(m.monadContract)))(n.value0);if(n instanceof F.Left&&R.viewOn(f)(d._isValid(P.strongForget)))return o.throwError(a.monadThrowExceptT(u.monadReaderT(m.monadContract)))(new c.ExUnitsEvaluationFailed(e,n.value0));if(n instanceof F.Left)return t.pure(a.applicativeExceptT(u.monadReaderT(m.monadContract)))(_.wrap()(B.empty));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx.ExUnitsAndMinFee (line 98, column 3 - line 102, column 36): "+[n.constructor.name])}))}))}))})(e))((function(o){var c,f=(c=e,function(e){return k.over(l._redeemersTxIns(H.strongFn))(x.flip(Q)(e))(c)})(o);return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(X(f)(n))((function(e){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(s.askNetworkId)((function(n){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(M.map(a.functorExceptT(u.functorReaderT(m.functorContract)))(g.fromPlutusUtxoMap(n))(s.asksConstraints((function(e){return i._additionalUtxos(e)}))))((function(n){return r.bind(a.bindExceptT(u.monadReaderT(m.monadContract)))(s.liftContract(v.calculateMinFee(e)(n)))((function(e){return t.pure(a.applicativeExceptT(u.monadReaderT(m.monadContract)))(new W.Tuple(f,_.unwrap()(e)))}))}))}))}))}))}))}},n.finalizeTransaction=X}(c),function(e){"use strict";e["Ctl.Internal.BalanceTx"]=e["Ctl.Internal.BalanceTx"]||{};var n,t,r=e["Ctl.Internal.BalanceTx"],o=e["Control.Applicative"],a=e["Control.Apply"],u=e["Control.Bind"],i=e["Control.Monad.Error.Class"],c=e["Control.Monad.Except.Trans"],l=e["Control.Monad.Logger.Class"],s=e["Control.Monad.Reader.Trans"],f=e["Control.Parallel"],d=e["Ctl.Internal.BalanceTx.CoinSelection"],v=e["Ctl.Internal.BalanceTx.Collateral"],m=e["Ctl.Internal.BalanceTx.Constraints"],p=e["Ctl.Internal.BalanceTx.Error"],g=e["Ctl.Internal.BalanceTx.ExUnitsAndMinFee"],y=e["Ctl.Internal.BalanceTx.Helpers"],b=e["Ctl.Internal.BalanceTx.Types"],w=e["Ctl.Internal.BalanceTx.UtxoMinAda"],C=e["Ctl.Internal.Cardano.Types.Transaction"],h=e["Ctl.Internal.Cardano.Types.Value"],A=e["Ctl.Internal.CoinSelection.UtxoIndex"],S=e["Ctl.Internal.Contract"],I=e["Ctl.Internal.Contract.Monad"],T=e["Ctl.Internal.Contract.QueryHandle"],D=e["Ctl.Internal.Contract.Wallet"],F=e["Ctl.Internal.Helpers"],E=e["Ctl.Internal.Partition"],x=e["Ctl.Internal.Plutus.Conversion.Value"],M=e["Ctl.Internal.Plutus.Types.Value"],R=e["Ctl.Internal.Types.OutputDatum"],P=e["Ctl.Internal.Types.Scripts"],k=e["Ctl.Internal.Types.Transaction"],B=e["Ctl.Internal.Types.UnbalancedTransaction"],N=e["Data.Array"],L=e["Data.Array.NonEmpty"],_=e["Data.Array.NonEmpty.Internal"],U=e["Data.BigInt"],H=e["Data.Either"],q=e["Data.Eq"],O=e["Data.Foldable"],V=e["Data.Function"],W=e["Data.Functor"],K=e["Data.Lens.Getter"],z=e["Data.Lens.Internal.Forget"],J=e["Data.Lens.Setter"],G=e["Data.Log.Tag"],j=e["Data.Map.Internal"],Q=e["Data.Maybe"],Z=e["Data.Monoid"],X=e["Data.Newtype"],Y=e["Data.Ord"],$=e["Data.Profunctor.Strong"],ee=e["Data.Ring"],ne=e["Data.Semigroup"],te=e["Data.Semiring"],re=e["Data.Set"],oe=e["Data.Show"],ae=e["Data.Traversable"],ue=e["Data.Tuple"],ie=e["Data.Unfoldable"],ce=e.Effect,le=e["Effect.Aff.Class"],se=e["Effect.Class"],fe=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),de=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),ve=h.eqValue,me={compare:V.on(Y.compare(Y.ordInt))((n=X.unwrap(),function(e){return N.length(h.valueAssets(n(e)))})),Eq0:function(){return ve}},pe=function(e){return J.over((n=y["_body'"]($.strongFn),t=C._outputs($.strongFn),function(e){return n(t(e))}))(V.flip(ne.append(ne.semigroupArray))(e));var n,t},ge=function(e){return function(n){return X.wrap()({address:e,amount:n,datum:R.NoOutputDatum.value,scriptRef:Q.Nothing.value})}},ye=function(e){return Q.maybe(Z.mempty(h.monoidValue))((n=h.mkValue(Z.mempty(h.monoidCoin)),t=X.unwrap(),function(e){return n(t(e))}))(K.viewOn(e)(C._mint(z.strongForget)));var n,t},be=function(e){return h.mkValue(K.viewOn(e)(C._fee(z.strongForget)))(Z.mempty(h.monoidNonAdaAsset))},we=(t=X.unwrap(),function(e){return t(e).amount}),Ce=function(e){return function(n){return W.map(H.functorEither)(O.foldMap(O.foldableArray)(h.monoidValue)(we))(ae.for(H.applicativeEither)(ae.traversableArray)(N.fromFoldable(re.foldableSet)(K.viewOn(n)(C._inputs(z.strongForget))))((function(n){return H.note(new p.UtxoLookupFailedFor(n))(j.lookup(k.ordTransactionInput)(n)(e))})))}},he=function(e){return O.foldMap(O.foldableArray)(h.monoidValue)(we)(K.viewOn(e)(C._outputs(z.strongForget)))},Ae=function(e){return function(n){return function(t){return W.mapFlipped(H.functorEither)(Ce(n)(t))((function(n){return h.minus(ne.append(h.semigroupValue)(he(t))(ne.append(h.semigroupValue)(be(t))(h.coinToValue(e))))(ne.append(h.semigroupValue)(n)(ye(t)))}))}}},Se=function(e){return function(n){return function(t){return function(r){var o,a=K.viewOn(r)(y["_body'"](z.strongForget)),i=function(e){return function(n){var t=G.tag(n),r=oe.show(e);return function(e){return t(r(e))}}};return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(c.except(s.applicativeReaderT(I.applicativeContract))(Ce(n)(a)))((o=V.flip(l.trace(l.monadLoggerExceptT(l.monadLoggerReaderT(I.monadLoggerContract))))(e+":"),function(e){return o((n=e,G.fromArray(ne.append(ne.semigroupArray)([i(h.showValue)("Input Value")(n),i(h.showValue)("Mint Value")(ye(a)),i(h.showCoin)("Fees")(K.viewOn(a)(C._fee(z.strongForget)))])(function(e){if(e instanceof Q.Nothing)return[i(h.showValue)("Output Value")(he(a))];if(e instanceof Q.Just)return[i(h.showValue)("Output Value without change")(he(a)),i(h.showValue)("Change Value")(O.foldMap(O.foldableArray)(h.monoidValue)(we)(e.value0))];throw new Error("Failed pattern match at Ctl.Internal.BalanceTx (line 765, column 5 - line 765, column 74): "+[e.constructor.name])}(t)))));var n}))}}}},Ie=function(e){return function(n){return function(t){return Se(e)(n)(new Q.Just(t.changeOutputs))(t.transaction)}}},Te=function(e){return function(n){return function(t){return function(r){var a,i,l,f,d,v,g,y=K.viewOn(r)(C._outputs(z.strongForget)),A=F.fromMaybeFlipped(L.fromArray(W.map(W.functorArray)((a=X.unwrap(),function(e){return h["valueToCoin'"](a(e).amount)}))(y)))(L.singleton(te.zero(U.semiringBigInt))),S=(i=h.minus(ne.append(h.semigroupValue)(n)(ye(r)))(ne.append(h.semigroupValue)(he(r))(ne.append(h.semigroupValue)(be(r))(h.coinToValue(t)))),h.mkValue(Y.max(U.ordBigInt)(i.value0)(te.zero(U.semiringBigInt)))(h.posNonAdaAsset(i.value1))),T=h["valueToCoin'"](S),D=h.valueAssets(S),x=O.foldr(O.foldableArray)((l=L.zipWith(ne.append(h.semigroupValue)),f=function(e){return function(n){var t,r,o=W.mapFlipped(W.functorArray)(e)((t=h.getAssetQuantity(n.value0),r=X.unwrap(),function(e){return t(r(e).amount)})),a=F.fromMaybeFlipped(L.fromArray(o))(L.singleton(te.one(U.semiringBigInt)));return W.map(_.functorNonEmptyArray)(h.assetToValue(n.value0))(F.fromMaybeFlipped(E.partition(E.partitionBigInt)(n.value1)(a))(E.equipartition(E.equipartitionBigInt)(n.value1)(O.length(_.foldableNonEmptyArray)(te.semiringInt)(a))))}}(y),function(e){return l(f(e))}))(L.replicate(O.length(O.foldableArray)(te.semiringInt)(y))(Z.mempty(h.monoidValue)))(D),M=L.sortWith(me)((function(e){return ue.fst(e)}))(L.zip(x)(A));return q.eq(h.eqValue)(S)(Z.mempty(h.monoidValue))&&q.notEq(q.eqArray(C.eqTransactionOutput))(K.viewOn(r)(C._outputs(z.strongForget)))(Z.mempty(Z.monoidArray))?o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract)))(Z.mempty(Z.monoidArray)):W.map(c.functorExceptT(s.functorReaderT(I.functorContract)))(W.map(W.functorArray)(ge(e)))(u.bindFlipped(c.bindExceptT(s.monadReaderT(I.monadContract)))(function(e){return function(n){return function(t){var r,o,a=function(e){var t,r=(t=O.null(O.foldableArray),function(e){return t(h.valueAssets(e.value))}),o=function(e){return h.mkValue(X.wrap()(e.minCoin))(e.value.value1)};return function(t){return u=L.uncons(t),i=function(t){var r,a=L["cons'"](u.head)(u.tail),i=W.map(_.functorNonEmptyArray)(o)(a),c=Y.max(U.ordBigInt)(te.zero(U.semiringBigInt))(ee.sub(U.ringBigInt)(n)(e)),l=(r=W.map(_.functorNonEmptyArray)((function(e){return e.outputAda}))(a),function(e){return W.map(_.functorNonEmptyArray)(h.lovelaceValueOf)(F.fromMaybeFlipped(E.partition(E.partitionBigInt)(e)(r))(E.equipartition(E.equipartitionBigInt)(e)(O.length(_.foldableNonEmptyArray)(te.semiringInt)(r))))})(c);return L.toArray(L.zipWith(ne.append(h.semigroupValue))(i)(l))},(c=L.fromArray(u.tail))instanceof Q.Just&&Y.lessThan(U.ordBigInt)(n)(e)&&r(u.head)?a(ee.sub(U.ringBigInt)(e)(u.head.minCoin))(c.value0):i();var u,i,c}},i=ae.for(c.applicativeExceptT(s.monadReaderT(I.monadContract)))(_.traversableNonEmptyArray)(t)((function(n){return W.map(c.functorExceptT(s.functorReaderT(I.functorContract)))((function(e){return{value:n.value0,outputAda:n.value1,minCoin:e}}))((t=n.value0,r=ge(e)(t),u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(b.askCoinsPerUtxoUnit)((function(e){return se.liftEffect(s.monadEffectReader(I.monadEffectContract))(W.mapFlipped(ce.functorEffect)(w.utxoMinAdaValue(e)(r))(H.note(p.UtxoMinAdaValueCalculationFailed.value)))}))));var t,r})),l=(r=O.sum(_.foldableNonEmptyArray)(U.semiringBigInt),o=W.map(_.functorNonEmptyArray)((function(e){return e.minCoin})),function(e){return r(o(e))});return W.mapFlipped(c.functorExceptT(s.functorReaderT(I.functorContract)))(i)((function(e){return a(l(e))(e)}))}}}(e)(T))((d=M,v=function(e){return new ue.Tuple(h.mkValue(Z.mempty(h.monoidCoin))(e.value1),X.unwrap()(e.value0))},g=function(e){return h.mkValue(X.wrap()(e.value1))(e.value0.value1)},W.mapFlipped(c.functorExceptT(s.functorReaderT(I.functorContract)))(b.asksConstraints((function(e){return m._maxChangeOutputTokenQuantity(e)})))((function(e){if(e instanceof Q.Nothing)return d;if(e instanceof Q.Just)return W.map(_.functorNonEmptyArray)(v)(u.bindFlipped(_.bindNonEmptyArray)(h.equipartitionValueWithTokenQuantityUpperBound(e.value0))(W.map(_.functorNonEmptyArray)(g)(d)));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx (line 506, column 67 - line 512, column 12): "+[e.constructor.name])})))))}}}},De=function(e){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(b.askCoinsPerUtxoUnit)((function(n){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(se.liftEffect(s.monadEffectReader(I.monadEffectContract))(W.mapFlipped(ce.functorEffect)(w.utxoMinAdaValue(n)(e))(H.note(p.UtxoMinAdaValueCalculationFailed.value))))((function(n){var t=X.unwrap()(e),r=Y.max(U.ordBigInt)(h["valueToCoin'"](t.amount))(n);return o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract)))(X.wrap()(function(){var e={};for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.amount=h.mkValue(r)(h.getNonAdaAsset(t.amount)),e}()))}))}))};r.balanceTxWithConstraints=function(e){return function(n){var t,r,l,w,F=(l=K.viewOn(e)(y["_transaction'"](z.strongForget)),u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(Q.maybe(b.askNetworkId)(o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract))))(K.viewOn(l)((t=C._body(z.strongForget),r=C._networkId(z.strongForget),function(e){return t(r(e))}))))((function(e){return o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract)))(J.setJust((n=C._body($.strongFn),t=C._networkId($.strongFn),function(e){return n(t(e))}))(e)(l));var n,t}))),E=u.bindFlipped(c.bindExceptT(s.monadReaderT(I.monadContract)))(i.liftMaybe(c.monadThrowExceptT(s.monadReaderT(I.monadContract)))(p.CouldNotGetChangeAddress.value))(u.bindFlipped(c.bindExceptT(s.monadReaderT(I.monadContract)))(Q.maybe(b.liftContract(D.getChangeAddress))((w=o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract))),function(e){return w(Q.Just.create(e))})))(b.asksConstraints((function(e){return m._changeAddress(e)}))));return u.bind(I.bindContract)(S.getProtocolParameters)((function(t){return u.bind(I.bindContract)(T.getQueryHandle)((function(r){return b.withBalanceTxConstraints(n)(c.runExceptT((w=X.unwrap()(t).stakeAddressDeposit,S=(l=K.viewOn(e)(y["_transaction'"](z.strongForget)),function(e){var n,t,r,o,a,u,i=X.unwrap()(O.fold(j.foldableMap)(h.monoidCoin)(Q.fromMaybe(j.empty)(K.viewOn(l)((n=C._body(z.strongForget),t=C._withdrawals(z.strongForget),function(e){return n(t(e))}))))),c=(a=O.sum(O.foldableArray)(U.semiringBigInt),u=W.map(W.functorArray)((function(n){return n instanceof C.StakeRegistration?X.unwrap()(e):n instanceof C.StakeDeregistration?ee.negate(U.ringBigInt)(X.unwrap()(e)):te.zero(U.semiringBigInt)})),function(e){return a(u(e))})(O.fold(O.foldableMaybe)(Z.monoidArray)(K.viewOn(l)((r=C._body(z.strongForget),o=C._certs(z.strongForget),function(e){return r(o(e))}))));return ee.sub(U.ringBigInt)(c)(i)})(w),u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(b.asksConstraints((function(e){return m._srcAddresses(e)})))(Q.maybe(b.liftContract(D.getWalletAddresses))(o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract))))))((function(n){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(E)((function(t){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(b.liftEitherContract(W.mapFlipped(I.functorContract)(f.parTraverse(I.parallelParContractContra)(ae.traversableArray)((T=W.map(I.functorContract)(H.hush),E=le.liftAff(I.monadAffContract),function(e){return T(E(r.utxosAt(e)))}))(n))((l=W.map(H.functorEither)(O.foldr(O.foldableArray)(j.union(k.ordTransactionInput))(j.empty)),w=ae.traverse(ae.traversableArray)(H.applicativeEither)(H.note(p.CouldNotGetUtxos.value)),function(e){return l(w(e))}))))((function(n){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(function(){var n=N.null(K.viewOn(e)(y._redeemersTxIns(z.strongForget)));if(n)return F;if(!n)return u.bindFlipped(c.bindExceptT(s.monadReaderT(I.monadContract)))(function(e){return function(n){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(b.liftEitherContract(W.map(I.functorContract)(H.note(p.CouldNotGetCollateral.value))(D.getWalletCollateral)))((function(t){var r=v.addTxCollateral(t)(n);return v.addTxCollateralReturn(t)(r)(e)}))}}(t))(F);throw new Error("Failed pattern match at Ctl.Internal.BalanceTx (line 190, column 7 - line 195, column 76): "+[n.constructor.name])}())((function(r){var l,f,v=j.union(k.ordTransactionInput)(n)(K.viewOn(e)((l=y._unbalancedTx(z.strongForget),f=B._utxoIndex(z.strongForget),function(e){return l(f(e))})));return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(b.liftContract(I.filterLockedUtxos(v)))((function(n){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(b.asksConstraints((function(e){return m._selectionStrategy(e)})))((function(l){return f={strategy:l,unbalancedTx:J.set(y["_transaction'"]($.strongFn))(r)(e),changeAddress:t,allUtxos:v,utxos:n,certsFee:S},F=function(){var e=K.viewOn(K.viewOn(K.viewOn(f.unbalancedTx)(y["_transaction'"](z.strongForget)))(C._witnessSet(z.strongForget)))(C._plutusScripts(z.strongForget));if(e instanceof Q.Just)return V.flip(N.any)(e.value0)((function(e){return e.value1 instanceof P.PlutusV1}));if(e instanceof Q.Nothing)return!1;throw new Error("Failed pattern match at Ctl.Internal.BalanceTx (line 288, column 5 - line 292, column 23): "+[e.constructor.name])}(),E=u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(W.map(c.functorExceptT(s.functorReaderT(I.functorContract)))(Q.isJust)(b.askCip30Wallet))((function(e){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(e?b.liftContract(W.mapFlipped(I.functorContract)(D.getWalletCollateral)((t=re.fromFoldable(O.foldableArray)(k.ordTransactionInput),r=W.map(W.functorArray)((n=X.unwrap(),function(e){return n(e).input})),o=O.fold(O.foldableMaybe)(Z.monoidArray),function(e){return t(r(o(e)))}))):Z.mempty(c.monoidExceptT(s.monadReaderT(I.monadContract))(re.monoidSet(k.ordTransactionInput))))((function(e){return W.mapFlipped(c.functorExceptT(s.functorReaderT(I.functorContract)))(b.asksConstraints((function(e){return m._nonSpendableInputs(e)})))((n=ne.append(re.semigroupSet(k.ordTransactionInput))(e),function(e){return t=n(e),O.foldr(O.foldableArray)((function(e){return function(n){var r,o,a=!(re.member(k.ordTransactionInput)(e.value0)(t)||re.member(k.ordTransactionInput)(e.value0)(K.viewOn(f.unbalancedTx)((r=y["_body'"](z.strongForget),o=C._referenceInputs(z.strongForget),function(e){return r(o(e))})))),u=Q.isJust(X.unwrap()(e.value1).scriptRef),i=X.unwrap()(e.value1).datum instanceof R.OutputDatum,c=!(F&&(i||u));return a&&c?{spendable:j.insert(k.ordTransactionInput)(e.value0)(e.value1)(n.spendable),invalidInContext:n.invalidInContext}:a&&!c?{invalidInContext:j.insert(k.ordTransactionInput)(e.value0)(e.value1)(n.invalidInContext),spendable:n.spendable}:n}}))({spendable:j.empty,invalidInContext:j.empty})(j.toUnfoldable(ie.unfoldableArray)(f.utxos));var t}));var n}));var n,t,r,o})),w=function(e){if(e instanceof fe)return u.discard(u.discardUnit)(c.bindExceptT(s.monadReaderT(I.monadContract)))(Ie("Pre-balancing (Stage 1)")(f.allUtxos)(e.value0))((function(){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(function(e){var n,t=(n=K.viewOn(pe(e.changeOutputs)(e.transaction))(y["_body'"](z.strongForget)),u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(c.except(s.applicativeReaderT(I.applicativeContract))(Ae(f.certsFee)(f.allUtxos)(n)))(d.performMultiAssetSelection(c.monadEffectExceptT(s.monadEffectReader(I.monadEffectContract)))(c.monadThrowExceptT(s.monadReaderT(I.monadContract)))(f.strategy)(e.leftoverUtxos)));return W.mapFlipped(c.functorExceptT(s.functorReaderT(I.functorContract)))(t)((function(n){return{transaction:J.over((t=y["_body'"]($.strongFn),r=C._inputs($.strongFn),function(e){return t(r(e))}))(re.union(k.ordTransactionInput)(d.selectedInputs(n)))(e.transaction),leftoverUtxos:K.viewOn(n)(d._leftoverUtxos(z.strongForget)),changeOutputs:e.changeOutputs,minFee:e.minFee};var t,r}))}(e.value0))(T)}));if(e instanceof de)return u.discard(u.discardUnit)(c.bindExceptT(s.monadReaderT(I.monadContract)))(Ie("Balancing change and fees (Stage 2)")(f.allUtxos)(e.value0))((function(){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(function(e){var n=X.wrap()(pe(e.changeOutputs)(e.transaction));return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(g.evalExUnitsAndMinFee(n)(f.allUtxos))((function(n){return o.pure(c.applicativeExceptT(s.monadReaderT(I.monadContract)))({transaction:n.value0,minFee:n.value1,changeOutputs:e.changeOutputs,leftoverUtxos:e.leftoverUtxos})}))}(e.value0))((function(n){var t,r,o,i,l=Y.lessThanOrEq(U.ordBigInt)(n.minFee)(e.value0.minFee);if(l)return re.isEmpty(K.viewOn(n.transaction)((t=y["_body'"](z.strongForget),r=C._inputs(z.strongForget),function(e){return t(r(e))})))?u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(d.performMultiAssetSelection(c.monadEffectExceptT(s.monadEffectReader(I.monadEffectContract)))(c.monadThrowExceptT(s.monadReaderT(I.monadContract)))(f.strategy)(e.value0.leftoverUtxos)(h.lovelaceValueOf(te.one(U.semiringBigInt))))((function(t){return T({transaction:J.over((r=y["_body'"]($.strongFn),o=C._inputs($.strongFn),function(e){return r(o(e))}))(re.union(k.ordTransactionInput)(d.selectedInputs(t)))(n.transaction),leftoverUtxos:K.viewOn(t)(d._leftoverUtxos(z.strongForget)),changeOutputs:e.value0.changeOutputs,minFee:e.value0.minFee});var r,o})):a.applySecond(c.applyExceptT(s.monadReaderT(I.monadContract)))(function(e){return Se("Balanced transaction (Done)")(e)(Q.Nothing.value)}(f.allUtxos)(n.transaction))(g.finalizeTransaction(n.transaction)(f.allUtxos));if(!l)return T({transaction:J.set((o=y["_body'"]($.strongFn),i=C._fee($.strongFn),function(e){return o(i(e))}))(n.minFee)(e.value0.transaction),leftoverUtxos:e.value0.leftoverUtxos,changeOutputs:e.value0.changeOutputs,minFee:n.minFee});throw new Error("Failed pattern match at Ctl.Internal.BalanceTx (line 353, column 9 - line 373, column 16): "+[l.constructor.name])}))}));throw new Error("Failed pattern match at Ctl.Internal.BalanceTx (line 345, column 5 - line 345, column 62): "+[e.constructor.name])},T=function(e){var n=K.viewOn(e.transaction)(y["_body'"](z.strongForget));return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(c.except(s.applicativeReaderT(I.applicativeContract))(Ce(f.allUtxos)(n)))((function(t){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(Te(f.changeAddress)(t)(f.certsFee)(n))((function(n){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(c.except(s.applicativeReaderT(I.applicativeContract))(Ae(f.certsFee)(f.allUtxos)(K.viewOn(pe(n)(e.transaction))(y["_body'"](z.strongForget)))))((function(t){return w((q.eq(h.eqValue)(t)(Z.mempty(h.monoidValue))?de.create:fe.create)({changeOutputs:n,leftoverUtxos:e.leftoverUtxos,minFee:e.minFee,transaction:e.transaction}))}))}))}))},B=function(e){return w(fe.create(e))},u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))(E)((function(e){return u.bind(c.bindExceptT(s.monadReaderT(I.monadContract)))((n=f.unbalancedTx,W.map(c.functorExceptT(s.functorReaderT(I.functorContract)))((function(e){return J.set((t=y["_body'"]($.strongFn),r=C._outputs($.strongFn),function(e){return t(r(e))}))(e)(n);var t,r}))(ae.traverse(ae.traversableArray)(c.applicativeExceptT(s.monadReaderT(I.monadContract)))(De)(K.viewOn(n)((t=y["_body'"](z.strongForget),r=C._outputs(z.strongForget),function(e){return t(r(e))}))))))((function(n){return(r=O.foldMap(j.foldableMap)(h.monoidValue)((o=X.unwrap(),function(e){return o(e).amount}))(e.invalidInContext),function(e){return i.catchError(c.monadErrorExceptT(s.monadReaderT(I.monadContract)))(e)((n=i.throwError(c.monadThrowExceptT(s.monadReaderT(I.monadContract))),function(e){return n((t=e)instanceof p.BalanceInsufficientError?new p.BalanceInsufficientError(t.value0,t.value1,ne.append(M.semigroupValue)(t.value2)(x.toPlutusValue(r))):t);var t}));var n})(B((t=n,function(e){return n=A.buildUtxoIndex(e),{transaction:t,leftoverUtxos:n,changeOutputs:Z.mempty(Z.monoidArray),minFee:te.zero(U.semiringBigInt)};var n})(e.spendable)));var t,r,o}));var n,t,r}));var f,w,T,F,E,B}))}))}))}));var l,w,T,E}))})))));var l,w,S}))}))}}}(c),function(e){"use strict";e["Ctl.Internal.Contract.Sign"]=e["Ctl.Internal.Contract.Sign"]||{};var n=e["Ctl.Internal.Contract.Sign"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Reader.Class"],a=e["Ctl.Internal.Cardano.Types.Transaction"],u=e["Ctl.Internal.Contract.Monad"],i=e["Ctl.Internal.Contract.QueryHandle"],c=e["Ctl.Internal.Contract.Wallet"],l=e["Ctl.Internal.Helpers"],s=e["Ctl.Internal.Serialization.Address"],f=e["Ctl.Internal.Types.Transaction"],d=e["Ctl.Internal.Wallet"],v=e["Data.Array"],m=e["Data.Either"],p=e["Data.Foldable"],g=e["Data.Function"],y=e["Data.Functor"],b=e["Data.Lens.Getter"],w=e["Data.Lens.Internal.Forget"],C=e["Data.Lens.Setter"],h=e["Data.Map.Internal"],A=e["Data.Maybe"],S=e["Data.Newtype"],I=e["Data.Profunctor.Strong"],T=e["Data.Set"],D=e["Data.Show"],F=e["Data.Traversable"],E=e["Data.Tuple"],x=e["Effect.Aff"],M=e["Effect.Aff.Class"],R=e["Effect.Class"],P=e["Effect.Exception"];n.signTransaction=function(e){return r.bind(u.bindContract)(o.asks(u.monadAskContractEnvContra)((function(e){return e.hooks})))((function(n){return r.discard(r.discardUnit)(u.bindContract)(p.for_(u.applicativeContract)(p.foldableMaybe)(n.beforeSign)((o=y.void(u.functorContract),k=R.liftEffect(u.monadEffectContract),function(e){return o(k(P.try(e)))})))((function(){return c.withWallet((function(n){if(n instanceof d.Nami)return M.liftAff(u.monadAffContract)(d.callCip30Wallet(n.value0)((function(n){return g.flip(n.signTx)(e)})));if(n instanceof d.Gero)return M.liftAff(u.monadAffContract)(d.callCip30Wallet(n.value0)((function(n){return g.flip(n.signTx)(e)})));if(n instanceof d.Flint)return M.liftAff(u.monadAffContract)(d.callCip30Wallet(n.value0)((function(n){return g.flip(n.signTx)(e)})));if(n instanceof d.Eternl){var o=v.fromFoldable(T.foldableSet)(b.viewOn(e)((k=a._body(w.strongForget),B=a._inputs(w.strongForget),function(e){return k(B(e))})));return r.discard(r.discardUnit)(u.bindContract)(function(e){return r.bind(u.bindContract)(i.getQueryHandle)((function(n){return r.bind(u.bindContract)(c.getWalletAddresses)((function(o){return r.bind(u.bindContract)(y.map(u.functorContract)((b=h.filter(f.ordTransactionInput)((i=g.flip(v.elem(s.eqAddress))(o),d=S.unwrap(),function(e){return i(d(e).address)})),w=h.fromFoldable(f.ordTransactionInput)(p.foldableArray),function(e){return b(w(e))}))(F.traverse(F.traversableArray)(u.applicativeContract)((function(e){return r.bind(u.bindContract)(l.liftedM(u.monadErrorErrorContract)(P.error("Could not get utxo"))(M.liftAff(u.monadAffContract)(y.map(x.functorAff)((o=r.join(A.bindMaybe),function(e){return o(m.hush(e))}))(n.getUtxoByOref(e)))))((function(n){return t.pure(u.applicativeContract)(new E.Tuple(e,n))}));var o}))(e)))((function(e){var n=function(o){return r.bind(u.bindContract)(y.mapFlipped(u.functorContract)(c.getWalletUtxos)(A.fromMaybe(h.empty)))((function(i){return t.unless(u.applicativeContract)(h.isSubmap(f.ordTransactionInput)(a.eqTransactionOutput)(e)(i))(r.discard(r.discardUnit)(u.bindContract)(t.when(u.applicativeContract)(0===o)(R.liftEffect(u.monadEffectContract)(P.throw("walletWaitForInputs: timeout while waiting for wallet UTxO set and CTL query layer UTxO set to synchronize. UTxOs from Ogmios: "+D.show(h.showMap(f.showTransactionInput)(a.showTransactionOutput))(e)+", UTxOs from wallet: "+D.show(h.showMap(f.showTransactionInput)(a.showTransactionOutput))(i)+", UTxOs that didn't appear in the wallet: "+D.show(h.showMap(f.showTransactionInput)(a.showTransactionOutput))(h.difference(f.ordTransactionInput)(e)(i))))))((function(){return r.discard(r.discardUnit)(u.bindContract)(M.liftAff(u.monadAffContract)(x.delay(S.wrap()(1e3))))((function(){return n(o-1|0)}))})))}))};return n(150)}));var i,d,b,w}))}))}(o))((function(){return M.liftAff(u.monadAffContract)(d.callCip30Wallet(n.value0)((function(n){return g.flip(n.signTx)(e)})))}))}var k,B;if(n instanceof d.Lode)return M.liftAff(u.monadAffContract)(d.callCip30Wallet(n.value0)((function(n){return g.flip(n.signTx)(e)})));if(n instanceof d.NuFi)return M.liftAff(u.monadAffContract)(d.callCip30Wallet(n.value0)((function(n){return g.flip(n.signTx)(e)})));if(n instanceof d.KeyWallet)return M.liftAff(u.monadAffContract)(r.bind(x.bindAff)(S.unwrap()(n.value0).signTx(e))((function(n){return t.pure(x.applicativeAff)(new A.Just(C.appendOver(a.semigroupTransactionWitne)(a._witnessSet(I.strongFn))(n)(e)))})));throw new Error("Failed pattern match at Ctl.Internal.Contract.Sign (line 42, column 14 - line 56, column 52): "+[n.constructor.name])}))}));var o,k}))}}(c),function(e){"use strict";e["Contract.Transaction"]=e["Contract.Transaction"]||{};var n=e["Contract.Transaction"],t=e["Contract.Monad"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Control.Monad.Reader.Class"],u=e["Ctl.Internal.BalanceTx"],i=e["Ctl.Internal.Contract.Monad"],c=e["Ctl.Internal.Contract.QueryHandle"],l=e["Ctl.Internal.Contract.Sign"],s=e["Data.Functor"],f=e["Data.Newtype"],d=e["Data.Traversable"],v=e.Effect,m=e["Effect.Aff.Class"],p=e["Effect.Class"],g=e["Effect.Exception"],y=function(e){return e},b=u.balanceTxWithConstraints;n.balanceTxWithConstraints=b,n.signTransaction=function(){var e=s.map(i.functorContract)(y),n=t.liftedM("Error signing the transaction"),r=f.unwrap();return function(t){return e(n(l.signTransaction(r(t))))}},n.submitE=function(e){return o.bind(i.bindContract)(c.getQueryHandle)((function(n){return o.bind(i.bindContract)(m.liftAff(i.monadAffContract)(n.submitTx(f.unwrap()(e))))((function(n){return o.discard(o.discardUnit)(i.bindContract)(s.void(i.functorContract)(o.bind(i.bindContract)(a.asks(i.monadAskContractEnvContra)((function(e){return e.hooks.onSubmit})))(d.traverse(d.traversableMaybe)(i.applicativeContract)((function(n){return p.liftEffect(i.monadEffectContract)(s.void(v.functorEffect)(g.try(n(f.unwrap()(e)))))})))))((function(){return r.pure(i.applicativeContract)(n)}))}))}))}}(c),function(e){"use strict";e["Contract.Utxos"]=e["Contract.Utxos"]||{};var n=e["Contract.Utxos"],t=e["Contract.Monad"],r=e["Control.Bind"],o=e["Control.Monad.Reader.Class"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Contract.QueryHandle"],i=e["Ctl.Internal.Plutus.Conversion"],c=e["Ctl.Internal.Plutus.Conversion.Address"],l=e["Ctl.Internal.Plutus.Types.Address"],s=e["Ctl.Internal.Service.Error"],f=e["Effect.Aff.Class"];n.utxosAt=function(e){return function(n){return r.bind(a.bindContract)(o.asks(a.monadAskContractEnvContra)((function(e){return e.networkId})))((function(o){return r.bind(a.bindContract)(u.getQueryHandle)((function(u){var d=c.fromPlutusAddress(o)(l.getAddress(e)(n));return r.bind(a.bindContract)(t.liftedE(s.showClientError)(f.liftAff(a.monadAffContract)(u.utxosAt(d))))((function(e){return t.liftContractM("utxosAt: failed to convert utxos")(i.toPlutusUtxoMap(e))}))}))}))}}}(c),function(e){let n,r;n=t(1164),r=t(9167),n=t(6359)(n),r=t(6359)(r),e.apply_params_to_script=e=>t=>o=>a=>{let u,i=a.language_version();try{let n=a.bytes(),t=o.to_bytes();try{u=r.apply_params_to_script_no_panic(t,n)}catch(n){return e("Error applying argument to script: ".concat(n.toString()))}}catch(n){return e("Error serializing arguments: ".concat(n.toString()))}return t(n.PlutusScript.new_with_version(u,i))}}(c["Ctl.Internal.ApplyArgs"]=c["Ctl.Internal.ApplyArgs"]||{}),function(e){"use strict";e["Data.Profunctor.Choice"]=e["Data.Profunctor.Choice"]||{};var n=e["Data.Profunctor.Choice"],t=e["Data.Either"],r=e["Data.Functor"],o=e["Data.Profunctor"],a={left:function(e){return function(n){if(n instanceof t.Left)return new t.Left(e(n.value0));if(n instanceof t.Right)return new t.Right(n.value0);throw new Error("Failed pattern match at Data.Profunctor.Choice (line 32, column 1 - line 35, column 16): "+[e.constructor.name,n.constructor.name])}},right:r.map(t.functorEither),Profunctor0:function(){return o.profunctorFn}};n.left=function(e){return e.left},n.choiceFn=a}(c),function(e){"use strict";e["Ctl.Internal.ApplyArgs"]=e["Ctl.Internal.ApplyArgs"]||{};var n=e["Ctl.Internal.ApplyArgs"],t=e["Ctl.Internal.ApplyArgs"],r=e["Control.Bind"],o=e["Ctl.Internal.Deserialization.WitnessSet"],a=e["Ctl.Internal.Serialization.PlutusData"],u=e["Ctl.Internal.Serialization.PlutusScript"],i=e["Ctl.Internal.Types.PlutusData"],c=e["Data.Either"],l=e["Data.Profunctor.Choice"],s=e["Data.Show"],f=e["Data.Show.Generic"],d=function(e){return e},v={show:f.genericShow({to:function(e){return e},from:function(e){return e}})(f.genericShowConstructor(f.genericShowArgsArgument(s.showString))({reflectSymbol:function(){return"ApplyArgsError"}}))},m=t.apply_params_to_script(c.Left.create)(c.Right.create);n.applyArgs=function(e){return function(n){return l.left(l.choiceFn)(d)((t=a.convertPlutusData(new i.List(n)),r.bind(c.bindEither)(m(t)(u.convertPlutusScript(e)))((function(e){return new c.Right(o.convertPlutusScript(e))}))));var t}},n.showApplyArgsError=v}(c),function(e){"use strict";e["Ctl.Internal.Contract.AwaitTxConfirmed"]=e["Ctl.Internal.Contract.AwaitTxConfirmed"]||{};var n,t=e["Ctl.Internal.Contract.AwaitTxConfirmed"],r=e["Contract.Monad"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Control.Monad.Reader.Class"],i=e["Control.Parallel"],c=e["Ctl.Internal.Contract.Monad"],l=e["Ctl.Internal.Contract.QueryBackend"],s=e["Ctl.Internal.Contract.QueryHandle"],f=e["Ctl.Internal.Service.Error"],d=e["Data.Either"],v=e["Data.Foldable"],m=e["Data.Functor"],p=e["Data.Maybe"],g=e["Data.Newtype"],y=e["Data.Number"],b=e["Data.Show"],w=e["Data.Time.Duration"],C=e["Data.UInt"],h=e["Data.Unit"],A=e["Effect.Aff"],S=e["Effect.Aff.Class"],I=e["Effect.Class"],T=e["Effect.Exception"],D=function(e){return function(n){var t=a.bind(c.bindContract)(n)((function(n){return o.unless(c.applicativeContract)(n)(a.discard(a.discardUnit)(c.bindContract)(S.liftAff(c.monadAffContract)(A.delay(e)))((function(){return t})))}));return t}},F=(n=y.infinity,function(e){var t,F=(t=g.wrap()(1e3),a.discard(a.discardUnit)(c.bindContract)(D(t)(function(e){return a.bind(c.bindContract)(s.getQueryHandle)((function(n){return S.liftAff(c.monadAffContract)(a.bind(A.bindAff)(n.doesTxExist(e))(d.either((t=I.liftEffect(A.monadEffectAff),r=b.show(f.showClientError),function(e){return t(T.throw(r(e)))}))(o.pure(A.applicativeAff))));var t,r}))}(e)))((function(){return a.bind(c.bindContract)(m.mapFlipped(c.functorContract)(u.asks(c.monadAskContractEnvContra)((function(e){return e.backend})))(a.composeKleisli(p.bindMaybe)(l.getBlockfrostBackend)((function(e){return e.confirmTxDelay}))))((function(n){return a.bind(c.bindContract)(m.mapFlipped(c.functorContract)(u.asks(c.monadAskContractEnvContra)((function(e){return e.backend})))((function(e){return p.isJust(l.getBlockfrostBackend(e))})))((function(u){return a.discard(a.discardUnit)(c.bindContract)(o.when(c.applicativeContract)(u)(a.discard(a.discardUnit)(c.bindContract)(D(t)(function(e){return a.bind(c.bindContract)(s.getQueryHandle)((function(n){return a.bind(c.bindContract)(r.liftedE(f.showClientError)(S.liftAff(c.monadAffContract)(n.getUtxoByOref({transactionId:e,index:C.fromInt(0)}))))((function(e){return o.pure(c.applicativeContract)(p.isJust(e))}))}))}(e)))((function(){return v.for_(c.applicativeContract)(v.foldableMaybe)(n)((e=S.liftAff(c.monadAffContract),t=w.fromDuration(w.durationSeconds),function(n){return e(A.delay(t(n)))}));var e,t}))))((function(){return o.pure(c.applicativeContract)(!0)}))}))}))}))),E=w.fromDuration(w.durationSeconds)(n),x=a.discard(a.discardUnit)(c.bindContract)(S.liftAff(c.monadAffContract)(A.delay(E)))((function(){return o.pure(c.applicativeContract)(!1)}));return g.unwrap()(n)===y.infinity?m.void(c.functorContract)(F):a.bind(c.bindContract)(i.parOneOf(c.parallelParContractContra)(c.alternativeParContract)(v.foldableArray)(m.functorArray)([F,x]))((function(e){return e?o.pure(c.applicativeContract)(h.unit):I.liftEffect(c.monadEffectContract)(T.throw("awaitTxConfirmedWithTimeout: timeout exceeded, Transaction not confirmed"))}))});t.awaitTxConfirmed=F}(c),function(e){"use strict";e["Ctl.Internal.Contract.WaitUntilSlot"]=e["Ctl.Internal.Contract.WaitUntilSlot"]||{};var n=e["Ctl.Internal.Contract.WaitUntilSlot"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Control.Monad.Error.Class"],a=e["Control.Monad.Reader.Class"],u=e["Ctl.Internal.Contract"],i=e["Ctl.Internal.Contract.Monad"],c=e["Ctl.Internal.Contract.QueryHandle"],l=e["Ctl.Internal.Helpers"],s=e["Ctl.Internal.Serialization.Address"],f=e["Ctl.Internal.Service.Error"],d=e["Ctl.Internal.Types.BigNum"],v=e["Ctl.Internal.Types.Chain"],m=e["Ctl.Internal.Types.Interval"],p=e["Data.BigInt"],g=e["Data.Either"],y=e["Data.Functor"],b=e["Data.Maybe"],w=e["Data.Newtype"],C=e["Data.Semiring"],h=e["Data.Show"],A=e.Effect,S=e["Effect.Aff"],I=e["Effect.Aff.Class"],T=e["Effect.Class"],D=e["Effect.Exception"],F=y.mapFlipped(i.functorContract)(u.getChainTip)((function(e){if(e instanceof v.Tip)return e.value0.slot;if(e instanceof v.TipAtGenesis)return s.Slot(d.fromInt(0));throw new Error("Failed pattern match at Ctl.Internal.Contract.WaitUntilSlot (line 164, column 31 - line 166, column 52): "+[e.constructor.name])})),E=r.bind(i.bindContract)(F)((function(e){return r.bind(i.bindContract)(l.liftM(i.monadErrorErrorContract)(D.error("Unable to advance slot"))(y.map(b.functorMaybe)(w.wrap())(d.add(w.unwrap()(e))(d.fromInt(1)))))((function(e){return r.bind(i.bindContract)(a.asks(i.monadAskContractEnvContra)((function(e){return e.ledgerConstants})))((function(n){return r.bind(i.bindContract)(c.getQueryHandle)((function(a){return r.bind(i.bindContract)(I.liftAff(i.monadAffContract)(r.bind(S.bindAff)(a.getEraSummaries)(g.either((u=T.liftEffect(S.monadEffectAff),c=h.show(f.showClientError),function(e){return u(D.throw(c(e)))}))(t.pure(S.applicativeAff)))))((function(a){return r.bind(i.bindContract)(T.liftEffect(i.monadEffectContract)(r.bind(A.bindEffect)(m.slotToPosixTime(a)(n.systemStart)(e))((u=l.liftM(o.monadErrorEffect)(D.error("Unable to convert Slot to POSIXTime")),function(e){return u(g.hush(e))}))))((function(e){return t.pure(i.applicativeContract)(C.add(m.semiringPOSIXTime)(w.wrap()(p.fromInt(-1)))(e))}));var u}));var u,c}))}))}))}));n.currentTime=E}(c),function(e){"use strict";e["Ctl.Internal.IsData"]=e["Ctl.Internal.IsData"]||{},e["Ctl.Internal.IsData"].isData=function(e){return function(n){return{FromData0:function(){return e},ToData1:function(){return n}}}}}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.Transaction"]=e["Ctl.Internal.Plutus.Types.Transaction"]||{};var n=e["Ctl.Internal.Plutus.Types.Transaction"],t=e["Data.Lens.Iso.Newtype"],r=e["Data.Lens.Record"],o=e["Type.Proxy"];n._amount=function(e){var n=t._Newtype()()(e.Profunctor0()),a=r.prop({reflectSymbol:function(){return"amount"}})()()(o.Proxy.value)(e);return function(e){return n(a(e))}},n._datum=function(e){var n=t._Newtype()()(e.Profunctor0()),a=r.prop({reflectSymbol:function(){return"datum"}})()()(o.Proxy.value)(e);return function(e){return n(a(e))}},n._output=function(e){var n=t._Newtype()()(e.Profunctor0()),a=r.prop({reflectSymbol:function(){return"output"}})()()(o.Proxy.value)(e);return function(e){return n(a(e))}},n._scriptRef=function(e){var n=t._Newtype()()(e.Profunctor0()),a=r.prop({reflectSymbol:function(){return"scriptRef"}})()()(o.Proxy.value)(e);return function(e){return n(a(e))}}}(c),function(e){"use strict";e["Ctl.Internal.Plutus.Types.TransactionUnspentOutput"]=e["Ctl.Internal.Plutus.Types.TransactionUnspentOutput"]||{},e["Ctl.Internal.Plutus.Types.TransactionUnspentOutput"].mkTxUnspentOut=function(e){return function(n){return{input:e,output:n}}}}(c),function(e){"use strict";e["Ctl.Internal.Types.Redeemer"]=e["Ctl.Internal.Types.Redeemer"]||{},e["Ctl.Internal.Types.Redeemer"].Redeemer=function(e){return e}}(c),function(e){"use strict";e.decodeImpl=function(e,n,t,r){var o,a=new TextDecoder(t);try{o=n(a.decode(r))}catch(n){o=e(n)}return o}}(c["Data.TextDecoder"]=c["Data.TextDecoder"]||{}),function(e){"use strict";e["Data.TextDecoder"]=e["Data.TextDecoder"]||{};var n,t=e["Data.TextDecoder"],r=e["Data.TextDecoder"],o=e["Data.Either"],a=e["Data.Show"],u=function(){function e(){}return e.value=new e,e}(),i=function(){function e(){}return e.value=new e,e}(),c=function(){function e(){}return e.value=new e,e}(),l=function(){function e(){}return e.value=new e,e}(),s=function(){function e(){}return e.value=new e,e}(),f=function(){function e(){}return e.value=new e,e}(),d=function(){function e(){}return e.value=new e,e}(),v=function(){function e(){}return e.value=new e,e}(),m=function(){function e(){}return e.value=new e,e}(),p=function(){function e(){}return e.value=new e,e}(),g=function(){function e(){}return e.value=new e,e}(),y=function(){function e(){}return e.value=new e,e}(),b=function(){function e(){}return e.value=new e,e}(),w=function(){function e(){}return e.value=new e,e}(),C=function(){function e(){}return e.value=new e,e}(),h=function(){function e(){}return e.value=new e,e}(),A=function(){function e(){}return e.value=new e,e}(),S=function(){function e(){}return e.value=new e,e}(),I=function(){function e(){}return e.value=new e,e}(),T=function(){function e(){}return e.value=new e,e}(),D=function(){function e(){}return e.value=new e,e}(),F=function(){function e(){}return e.value=new e,e}(),E=function(){function e(){}return e.value=new e,e}(),x=function(){function e(){}return e.value=new e,e}(),M=function(){function e(){}return e.value=new e,e}(),R=function(){function e(){}return e.value=new e,e}(),P=function(){function e(){}return e.value=new e,e}(),k=function(){function e(){}return e.value=new e,e}(),B=function(){function e(){}return e.value=new e,e}(),N=function(){function e(){}return e.value=new e,e}(),L=function(){function e(){}return e.value=new e,e}(),_=function(){function e(){}return e.value=new e,e}(),U=function(){function e(){}return e.value=new e,e}(),H=function(){function e(){}return e.value=new e,e}(),q=function(){function e(){}return e.value=new e,e}(),O=function(){function e(){}return e.value=new e,e}(),V=function(){function e(){}return e.value=new e,e}(),W=function(){function e(){}return e.value=new e,e}(),K=function(){function e(){}return e.value=new e,e}(),z=function(){function e(){}return e.value=new e,e}(),J={show:function(e){if(e instanceof u)return"utf-8";if(e instanceof i)return"ibm866";if(e instanceof c)return"iso-8859-2";if(e instanceof l)return"iso-8859-3";if(e instanceof s)return"iso-8859-4";if(e instanceof f)return"iso-8859-5";if(e instanceof d)return"iso-8859-6";if(e instanceof v)return"iso-8859-7";if(e instanceof m)return"iso-8859-8";if(e instanceof p)return"iso-8859-8-i";if(e instanceof g)return"iso-8859-10";if(e instanceof y)return"iso-8859-13";if(e instanceof b)return"iso-8859-14";if(e instanceof w)return"iso-8859-15";if(e instanceof C)return"iso-8859-16";if(e instanceof h)return"koi8-r";if(e instanceof A)return"koi8-u";if(e instanceof S)return"macintosh";if(e instanceof I)return"windows-874";if(e instanceof T)return"windows-1250";if(e instanceof D)return"windows-1251";if(e instanceof F)return"windows-1252";if(e instanceof E)return"windows-1253";if(e instanceof x)return"windows-1254";if(e instanceof M)return"windows-1255";if(e instanceof R)return"windows-1256";if(e instanceof P)return"windows-1257";if(e instanceof k)return"windows-1258";if(e instanceof B)return"x-max-cyrillic";if(e instanceof N)return"gbk";if(e instanceof L)return"gb18030";if(e instanceof _)return"big5";if(e instanceof U)return"euc-jp";if(e instanceof H)return"iso-2022-jp";if(e instanceof q)return"shift-jis";if(e instanceof O)return"euc-kr";if(e instanceof V)return"iso-2022-kr";if(e instanceof W)return"utf-16be";if(e instanceof K)return"utf-16le";if(e instanceof z)return"x-user-defined";throw new Error("Failed pattern match at Data.TextDecoder (line 87, column 1 - line 127, column 41): "+[e.constructor.name])}},G=(n=u.value,function(e){return r.decodeImpl(o.Left.create,o.Right.create,a.show(J)(n),e)});t.decodeUtf8=G}(c),function(e){"use strict";e["Ext.Contract.Time"]=e["Ext.Contract.Time"]||{};var n=e["Ext.Contract.Time"],t=e["Data.BigInt"],r=e["Data.Semiring"];n.addTimes=function(e){return function(n){return r.add(t.semiringBigInt)(e)(n)}}}(c),function(e){"use strict";e["Ext.Contract.Value"]=e["Ext.Contract.Value"]||{};var n,t=e["Ext.Contract.Value"],r=e["Contract.Monad"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Ctl.Internal.Contract.Monad"],i=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],c=e["Ctl.Internal.Plutus.Types.Value"],l=e["Ctl.Internal.Scripts"],s=e["Ctl.Internal.Types.ByteArray"],f=e["Ctl.Internal.Types.TokenName"],d=e["Data.Array"],v=e["Data.Either"],m=e["Data.Eq"],p=e["Data.Function"],g=e["Data.Maybe"],y=e["Data.TextDecoder"],b=e["Data.Tuple"],w=a.composeKleisliFlipped(g.bindMaybe)(f.mkTokenName)(s.byteArrayFromAscii),C=(n=r.liftContractM("Cannot make token name"),function(e){return n(w(e))});t.mkTokenName=w,t.runMkTokenName=C,t.mkCurrencySymbol=function(e){return a.bind(u.bindContract)(e)((function(e){return a.bind(u.bindContract)(r.liftContractM("Cannot get cs")(l.scriptCurrencySymbol(e)))((function(n){return o.pure(u.applicativeContract)(new b.Tuple(e,n))}))}))},t.getCurrencyByTokenName=function(e){return function(n){var t=d.filter((function(e){return m.eq(f.eqTokenName)(e.value1.value0)(n)})),r=t(c.flattenNonAdaAssets(e));return 1===r.length?new g.Just(r[0].value0):g.Nothing.value}},t.currencySymbolToString=function(e){return s.byteArrayToHex(i.getCurrencySymbol(e))},t.mkCurrencySymbolFromString=function(e){return r.liftContractM("Impossible to make currency symbol from String")((n=e,a.bind(g.bindMaybe)(s.hexToByteArray(n))(i.mkCurrencySymbol)));var n},t.tokenNameToString=function(e){var n=f.getTokenName(e);return v.either(p.const(g.Nothing.value))(g.Just.create)(y.decodeUtf8(n))}}(c),function(e){"use strict";e["Ext.Data.BigInt"]=e["Ext.Data.BigInt"]||{};var n=e["Ext.Data.BigInt"],t=e["Data.BigInt"];n.eqBigInt=function(e){return function(n){return t.toString(e)===t.toString(n)}}}(c),function(e){"use strict";e["Ext.Data.Either"]=e["Ext.Data.Either"]||{};var n=e["Ext.Data.Either"],t=e["Control.Applicative"],r=e["Ctl.Internal.Contract.Monad"],o=e["Data.Either"],a=e["Data.Show"],u=e["Effect.Class"],i=e["Effect.Exception"];n.eitherContract=function(e){return function(n){return o.either((function(t){return u.liftEffect(r.monadEffectContract)(i.throw(n+a.show(e)(t)))}))(t.pure(r.applicativeContract))}}}(c),function(e){"use strict";e["Ext.Data.Ratio"]=e["Ext.Data.Ratio"]||{};var n=e["Ext.Data.Ratio"],t=e["Data.BigInt"],r=e["Data.Eq"],o=e["Data.Maybe"],a=e["Data.Ratio"],u=e.Math;n.mkBigIntRational=function(e){return r.eq(t.eqBigInt)(e.value1)(t.fromInt(0))?o.Nothing.value:new o.Just(a.reduce(t.ordBigInt)(t.euclideanRingBigInt)(e.value0)(e.value1))},n.roundBigIntRatio=function(e){return t.fromNumber(u.round((n=e,t.toNumber(a.numerator(n))/t.toNumber(a.denominator(n)))));var n}}(c),function(e){"use strict";e["Ext.Seriaization.Key"]=e["Ext.Seriaization.Key"]||{};var n=e["Ext.Seriaization.Key"],t=e["Contract.Monad"],r=e["Ctl.Internal.Serialization.Hash"],o=e["Data.Newtype"];n.pkhToBech32M=function(e){return t.liftContractM("Impossible to serialize pkh")(function(e){return r.ed25519KeyHashToBech32("addr_vkh")(o.unwrap()(o.unwrap()(e)))}(e))}}(c),function(e){"use strict";e["Ext.Serialization.Token"]=e["Ext.Serialization.Token"]||{};var n=e["Ext.Serialization.Token"],t=e["Contract.Monad"],r=e["Control.Bind"],o=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],a=e["Ctl.Internal.Types.ByteArray"],u=e["Data.Maybe"];n.deserializeCurrency=function(e){return t.liftContractM("Impossible to get protocol currency symbol")(r.bind(u.bindMaybe)(a.hexToByteArray(e))(o.mkCurrencySymbol))}}(c),function(e){"use strict";e["Shared.MinAda"]=e["Shared.MinAda"]||{};var n=e["Shared.MinAda"],t=e["Ctl.Internal.Plutus.Types.Value"],r=e["Data.BigInt"].fromInt(2e6),o=t.lovelaceValueOf(r);n.minAda=r,n.minAdaValue=o}(c),function(e){"use strict";e["Fundraising.Calculations"]=e["Fundraising.Calculations"]||{};var n=e["Fundraising.Calculations"],t=e["Control.Applicative"],r=e["Control.Bind"],o=e["Data.BigInt"],a=e["Data.Maybe"],u=e["Data.Ord"],i=e["Data.Semiring"],c=e["Data.Tuple"],l=e["Ext.Data.Ratio"],s=e["Shared.MinAda"];n.calcFee=function(e){return function(n){return r.bind(a.bindMaybe)(l.mkBigIntRational(new c.Tuple(i.mul(o.semiringBigInt)(e)(n),o.fromInt(100))))((function(e){return r.bind(a.bindMaybe)(l.roundBigIntRatio(e))((function(e){var n=u.max(o.ordBigInt)(e)(s.minAda);return t.pure(a.applicativeMaybe)(n)}))}))}}}(c),function(e){"use strict";e["Fundraising.Datum"]=e["Fundraising.Datum"]||{};var n=e["Fundraising.Datum"],t=e["Ctl.Internal.FromData"],r=e["Ctl.Internal.Plutus.Types.Address"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.TypeLevel.Nat"],u=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],i=e["Ctl.Internal.Types.Interval"],c=e["Ctl.Internal.Types.PubKeyHash"],l=e["Ctl.Internal.Types.Transaction"],s={to:function(e){return e},from:function(e){return e}},f={toData:o.genericToData(s)(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PFundraisingDatum"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"PFundraisingDatum"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(c.toDataPaymentPubKeyHash)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(i.toDataPOSIXTime)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataByteArray)(o.toDataArgsRLHelperCons(r.toDataAddress)(o.toDataArgsRLHelperCons(l.toDataTransactionInput)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"tokenOrigin"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatS(a.knownNatZ)))()()()({reflectSymbol:function(){return"managerAddress"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))))()()()({reflectSymbol:function(){return"frTitle"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatZ))))()()()({reflectSymbol:function(){return"frFee"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))))()()()({reflectSymbol:function(){return"frDeadline"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))()()()({reflectSymbol:function(){return"frAmount"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))()()()({reflectSymbol:function(){return"creatorPkh"}})({reflectSymbol:function(){return"PFundraisingDatum"}})()()()()(a.knownNatZ)))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PFundraisingDatum"}})(a.knownNatZ))(a.knownNatZ))},d={fromData:t.genericFromData(s)(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"PFundraisingDatum"}})()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PFundraisingDatum"}})(a.knownNatZ))(t.fromDataArgsArgumentRecor(t.fromDataArgsRLCons(c.fromDataPaymentPubKeyHash)(t.fromDataArgsRLCons(l.fromDataTransactionInput)(t.fromDataArgsRLCons(t.fromDataByteArray)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(i.fromDataPOSIXTime)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(r.fromDataAddress)(t.fromDataArgsRLNilRow)()()({reflectSymbol:function(){return"managerAddress"}}))()()({reflectSymbol:function(){return"frFee"}}))()()({reflectSymbol:function(){return"frDeadline"}}))()()({reflectSymbol:function(){return"frAmount"}}))()()({reflectSymbol:function(){return"frTitle"}}))()()({reflectSymbol:function(){return"tokenOrigin"}}))()()({reflectSymbol:function(){return"creatorPkh"}}))()()())(a.knownNatZ))};n.titleLength=35,n.toDataPFundraisingDatum=f,n.fromDataPFundraisingDatum=d}(c),function(e){let n;n=t(1761),e.fundraisingValidator=n}(c["Fundraising.FundraisingScript"]=c["Fundraising.FundraisingScript"]||{}),function(e){"use strict";e["Protocol.Models"]=e["Protocol.Models"]||{};var n=e["Protocol.Models"],t=e["Ctl.Internal.Plutus.Types.Address"],r=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.TypeLevel.Nat"],u=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],i=e["Ctl.Internal.Types.TokenName"],c={toData:o.genericToData({to:function(e){return e},from:function(e){return e}})(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"Protocol"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"Protocol"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(r.toDataCurrencySymbol)(o.toDataArgsRLHelperCons(i.toDataTokenName)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"protocolTokenName"}})({reflectSymbol:function(){return"Protocol"}})()()()()(a.knownNatS(a.knownNatZ)))()()()({reflectSymbol:function(){return"protocolCurrency"}})({reflectSymbol:function(){return"Protocol"}})()()()()(a.knownNatZ)))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"Protocol"}})(a.knownNatZ))(a.knownNatZ))},l={toData:o.genericToData({to:function(e){return e},from:function(e){return e}})(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PProtocolConfig"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"PProtocolConfig"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"protocolFee"}})({reflectSymbol:function(){return"PProtocolConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))()()()({reflectSymbol:function(){return"minDuration"}})({reflectSymbol:function(){return"PProtocolConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatZ))))()()()({reflectSymbol:function(){return"minAmount"}})({reflectSymbol:function(){return"PProtocolConfig"}})()()()()(a.knownNatZ))()()()({reflectSymbol:function(){return"maxDuration"}})({reflectSymbol:function(){return"PProtocolConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))()()()({reflectSymbol:function(){return"maxAmount"}})({reflectSymbol:function(){return"PProtocolConfig"}})()()()()(a.knownNatS(a.knownNatZ))))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PProtocolConfig"}})(a.knownNatZ))(a.knownNatZ))},s={toData:o.genericToData({to:function(e){return e},from:function(e){return e}})(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PFundriseConfig"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"PFundriseConfig"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(t.toDataAddress)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(r.toDataCurrencySymbol)(o.toDataArgsRLHelperCons(i.toDataTokenName)(o.toDataArgsRLHelperCons(r.toDataCurrencySymbol)(o.toDataArgsRLHelperCons(i.toDataTokenName)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"verTokenName"}})({reflectSymbol:function(){return"PFundriseConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatZ))))()()()({reflectSymbol:function(){return"verCurrencySymbol"}})({reflectSymbol:function(){return"PFundriseConfig"}})()()()()(a.knownNatS(a.knownNatZ)))()()()({reflectSymbol:function(){return"threadTokenName"}})({reflectSymbol:function(){return"PFundriseConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))()()()({reflectSymbol:function(){return"threadCurrencySymbol"}})({reflectSymbol:function(){return"PFundriseConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))()()()({reflectSymbol:function(){return"startedAt"}})({reflectSymbol:function(){return"PFundriseConfig"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))))()()()({reflectSymbol:function(){return"scriptAddress"}})({reflectSymbol:function(){return"PFundriseConfig"}})()()()()(a.knownNatZ)))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PFundriseConfig"}})(a.knownNatZ))(a.knownNatZ))};n.toDataProtocol=c,n.toDataPProtocolConfig=l,n.toDataPFundriseConfig=s}(c),function(e){"use strict";e["Fundraising.Models"]=e["Fundraising.Models"]||{};var n=e["Fundraising.Models"],t=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],r=e["Ctl.Internal.ToData"],o=e["Ctl.Internal.TypeLevel.Nat"],a=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],u=e["Ctl.Internal.Types.TokenName"],i=e["Protocol.Models"],c={toData:r.genericToData({to:function(e){return e},from:function(e){return e}})(r.toDataWithSchemaConstruct({reflectSymbol:function(){return"Fundraising"}})(r.toDataArgsArgumentRecord(r.toDataArgsRecord({reflectSymbol:function(){return"Fundraising"}})(r.toDataArgsRL(r.toDataArgsRLHelperCons(i.toDataProtocol)(r.toDataArgsRLHelperCons(t.toDataCurrencySymbol)(r.toDataArgsRLHelperCons(u.toDataTokenName)(r.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"verTokenName"}})({reflectSymbol:function(){return"Fundraising"}})()()()()(o.knownNatS(o.knownNatS(o.knownNatZ))))()()()({reflectSymbol:function(){return"verTokenCurrency"}})({reflectSymbol:function(){return"Fundraising"}})()()()()(o.knownNatS(o.knownNatZ)))()()()({reflectSymbol:function(){return"protocol"}})({reflectSymbol:function(){return"Fundraising"}})()()()()(o.knownNatZ)))()))()()(a.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"Fundraising"}})(o.knownNatZ))(o.knownNatZ))};n.toDataFundraising=c}(c),function(e){"use strict";e["Fundraising.FundraisingScript"]=e["Fundraising.FundraisingScript"]||{};var n=e["Fundraising.FundraisingScript"],t=e["Fundraising.FundraisingScript"],r=e["Contract.Monad"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Ctl.Internal.ApplyArgs"],c=e["Ctl.Internal.Cardano.TextEnvelope"],l=e["Ctl.Internal.Contract.Monad"],s=e["Ctl.Internal.Scripts"],f=e["Ctl.Internal.ToData"],d=e["Data.Array"],v=e["Data.Maybe"],m=e["Effect.Exception"],p=e["Ext.Contract.Value"],g=e["Fundraising.Models"],y=function(e){return a.bind(l.bindContract)(u.liftMaybe(l.monadThrowErrorContract)(m.error("Error decoding fundraisingValidator"))(a.bind(v.bindMaybe)(c.decodeTextEnvelope(t.fundraisingValidator))((function(e){return c.plutusScriptV2FromEnvelope(e)}))))((function(n){return a.bind(l.bindContract)(r.liftContractE(i.showApplyArgsError)((t=n,function(e){var n=d.singleton(f.toData(g.toDataFundraising)(e));return i.applyArgs(t)(n)})(e)))((function(e){return o.pure(l.applicativeContract)(e)}));var t}))},b="FundraisingThreadToken",w=p.mkTokenName(b),C=r.liftContractM("Cannot make Fundraising token name")(w);n.fundraisingValidatorScript=y,n.getFundraisingValidatorHash=function(e){return a.bind(l.bindContract)(y(e))((function(e){return o.pure(l.applicativeContract)(s.validatorHash(e))}))},n.getFundraisingTokenName=C,n.fundraisingTokenNameString=b}(c),function(e){let n;n=t(1946),e.nftPolicy=n}(c["MintingPolicy.NftMinting"]=c["MintingPolicy.NftMinting"]||{}),function(e){"use strict";e["MintingPolicy.NftMinting"]=e["MintingPolicy.NftMinting"]||{};var n,t=e["MintingPolicy.NftMinting"],r=e["MintingPolicy.NftMinting"],o=e["Contract.Monad"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Ctl.Internal.ApplyArgs"],c=e["Ctl.Internal.Cardano.TextEnvelope"],l=e["Ctl.Internal.Contract.Monad"],s=e["Ctl.Internal.ToData"],f=e["Ctl.Internal.Types.Scripts"],d=e["Ctl.Internal.Types.Transaction"],v=e["Data.Array"],m=e["Data.Functor"],p=e["Data.Maybe"],g=e["Effect.Exception"],y=(n=m.map(l.functorContract)(f.PlutusMintingPolicy.create),function(e){return n((t=e,a.bind(l.bindContract)(u.liftMaybe(l.monadThrowErrorContract)(g.error("Error decoding nftPolicy"))(a.bind(p.bindMaybe)(c.decodeTextEnvelope(r.nftPolicy))((function(e){return c.plutusScriptV2FromEnvelope(e)}))))((function(e){return o.liftContractE(i.showApplyArgsError)((n=e,function(e){var t=v.singleton(s.toData(d.toDataTransactionInput)(e));return i.applyArgs(n)(t)})(t));var n}))));var t});t.mintingPolicy=y}(c),function(e){"use strict";e["MintingPolicy.NftRedeemer"]=e["MintingPolicy.NftRedeemer"]||{};var n=e["MintingPolicy.NftRedeemer"],t=e["Ctl.Internal.ToData"],r=e["Ctl.Internal.TypeLevel.Nat"],o=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],a=e["Ctl.Internal.Types.TokenName"],u=e["Data.Generic.Rep"],i=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l={to:function(e){if(e instanceof u.Inl)return new i(e.value0);if(e instanceof u.Inr)return new c(e.value0);throw new Error("Failed pattern match at MintingPolicy.NftRedeemer (line 21, column 1 - line 21, column 39): "+[e.constructor.name])},from:function(e){if(e instanceof i)return new u.Inl(e.value0);if(e instanceof c)return new u.Inr(e.value0);throw new Error("Failed pattern match at MintingPolicy.NftRedeemer (line 21, column 1 - line 21, column 39): "+[e.constructor.name])}},s={toData:t.genericToData(l)(t.toDataWithSchemaSum(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PMintNft"}})(t.toDataArgsArgument(a.toDataTokenName)({reflectSymbol:function(){return"PMintNft"}}))()()(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PMintNft"}})(r.knownNatZ))(r.knownNatZ))(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PBurnNft"}})(t.toDataArgsArgument(a.toDataTokenName)({reflectSymbol:function(){return"PBurnNft"}}))()()(o.getIndexWithLabelConsI(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PBurnNft"}})(r.knownNatS(r.knownNatZ)))()()({reflectSymbol:function(){return"PBurnNft"}})(r.knownNatS(r.knownNatZ)))(r.knownNatS(r.knownNatZ))))};n.PMintNft=i,n.PBurnNft=c,n.toDataPNftRedeemer=s}(c),function(e){let n;n=t(615),e.verTokenPolicy=n}(c["MintingPolicy.VerTokenMinting"]=c["MintingPolicy.VerTokenMinting"]||{}),function(e){"use strict";e["MintingPolicy.VerTokenMinting"]=e["MintingPolicy.VerTokenMinting"]||{};var n,t=e["MintingPolicy.VerTokenMinting"],r=e["MintingPolicy.VerTokenMinting"],o=e["Contract.Monad"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Ctl.Internal.ApplyArgs"],c=e["Ctl.Internal.Cardano.TextEnvelope"],l=e["Ctl.Internal.Contract.Monad"],s=e["Ctl.Internal.ToData"],f=e["Ctl.Internal.Types.Scripts"],d=e["Data.Array"],v=e["Data.Functor"],m=e["Data.Maybe"],p=e["Effect.Exception"],g=e["Ext.Contract.Value"],y=e["Protocol.Models"],b=g.runMkTokenName("VerificationToken"),w=(n=v.map(l.functorContract)(f.PlutusMintingPolicy.create),function(e){return n((t=e,a.bind(l.bindContract)(u.liftMaybe(l.monadThrowErrorContract)(p.error("Error decoding nftPolicy"))(a.bind(m.bindMaybe)(c.decodeTextEnvelope(r.verTokenPolicy))((function(e){return c.plutusScriptV2FromEnvelope(e)}))))((function(e){return o.liftContractE(i.showApplyArgsError)((n=e,function(e){var t=d.singleton(s.toData(y.toDataProtocol)(e));return i.applyArgs(n)(t)})(t));var n}))));var t});t.mintingPolicy=w,t.verTokenName=b}(c),function(e){"use strict";e["MintingPolicy.VerTokenRedeemers"]=e["MintingPolicy.VerTokenRedeemers"]||{};var n=e["MintingPolicy.VerTokenRedeemers"],t=e["Ctl.Internal.ToData"],r=e["Ctl.Internal.TypeLevel.Nat"],o=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],a=e["Ctl.Internal.Types.TokenName"],u=e["Data.Generic.Rep"],i=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),s={to:function(e){if(e instanceof u.Inl)return new i(e.value0);if(e instanceof u.Inr&&e.value0 instanceof u.Inl)return new c(e.value0.value0);if(e instanceof u.Inr&&e.value0 instanceof u.Inr)return new l(e.value0.value0);throw new Error("Failed pattern match at MintingPolicy.VerTokenRedeemers (line 24, column 1 - line 24, column 44): "+[e.constructor.name])},from:function(e){if(e instanceof i)return new u.Inl(e.value0);if(e instanceof c)return new u.Inr(new u.Inl(e.value0));if(e instanceof l)return new u.Inr(new u.Inr(e.value0));throw new Error("Failed pattern match at MintingPolicy.VerTokenRedeemers (line 24, column 1 - line 24, column 44): "+[e.constructor.name])}},f={toData:t.genericToData(s)(t.toDataWithSchemaSum(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PMintVerToken"}})(t.toDataArgsArgument(a.toDataTokenName)({reflectSymbol:function(){return"PMintVerToken"}}))()()(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PMintVerToken"}})(r.knownNatZ))(r.knownNatZ))(t.toDataWithSchemaSum(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PBurnVerToken"}})(t.toDataArgsArgument(a.toDataTokenName)({reflectSymbol:function(){return"PBurnVerToken"}}))()()(o.getIndexWithLabelConsI(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PBurnVerToken"}})(r.knownNatS(r.knownNatZ)))()()({reflectSymbol:function(){return"PBurnVerToken"}})(r.knownNatS(r.knownNatZ)))(r.knownNatS(r.knownNatZ)))(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PMintProposalVerToken"}})(t.toDataArgsArgument(a.toDataTokenName)({reflectSymbol:function(){return"PMintProposalVerToken"}}))()()(o.getIndexWithLabelConsI(o.getIndexWithLabelConsI(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PMintProposalVerToken"}})(r.knownNatS(r.knownNatS(r.knownNatZ))))()()({reflectSymbol:function(){return"PMintProposalVerToken"}})(r.knownNatS(r.knownNatS(r.knownNatZ))))()()({reflectSymbol:function(){return"PMintProposalVerToken"}})(r.knownNatS(r.knownNatS(r.knownNatZ))))(r.knownNatS(r.knownNatS(r.knownNatZ))))))};n.PMintVerToken=i,n.PBurnVerToken=c,n.PMintProposalVerToken=l,n.toDataPVerTokenRedeemer=f}(c),function(e){"use strict";e["Protocol.Datum"]=e["Protocol.Datum"]||{};var n=e["Protocol.Datum"],t=e["Ctl.Internal.FromData"],r=e["Ctl.Internal.Plutus.Types.Address"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.TypeLevel.Nat"],u=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],i=e["Ctl.Internal.Types.Transaction"],c=e["Data.BigInt"],l=e["Data.Lens.Iso.Newtype"],s=e["Data.Lens.Record"],f=e["Data.Show"],d=e["Type.Proxy"],v=f.showRecord()(f.showRecordFieldsCons({reflectSymbol:function(){return"managerAddress"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"maxAmount"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"maxDuration"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"minAmount"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"minDuration"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"protocolFee"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"tokenOriginRef"}})(f.showRecordFieldsNil)(i.showTransactionInput))(c.showBigInt))(c.showBigInt))(c.showBigInt))(c.showBigInt))(c.showBigInt))(r.showAddress)),m={to:function(e){return e},from:function(e){return e}},p={toData:o.genericToData(m)(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PProtocolDatum"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"PProtocolDatum"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(r.toDataAddress)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(i.toDataTransactionInput)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"tokenOriginRef"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))))()()()({reflectSymbol:function(){return"protocolFee"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))()()()({reflectSymbol:function(){return"minDuration"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatZ))))()()()({reflectSymbol:function(){return"minAmount"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatZ))()()()({reflectSymbol:function(){return"maxDuration"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))()()()({reflectSymbol:function(){return"maxAmount"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatS(a.knownNatZ)))()()()({reflectSymbol:function(){return"managerAddress"}})({reflectSymbol:function(){return"PProtocolDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PProtocolDatum"}})(a.knownNatZ))(a.knownNatZ))},g={fromData:t.genericFromData(m)(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"PProtocolDatum"}})()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PProtocolDatum"}})(a.knownNatZ))(t.fromDataArgsArgumentRecor(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(r.fromDataAddress)(t.fromDataArgsRLCons(i.fromDataTransactionInput)(t.fromDataArgsRLNilRow)()()({reflectSymbol:function(){return"tokenOriginRef"}}))()()({reflectSymbol:function(){return"managerAddress"}}))()()({reflectSymbol:function(){return"protocolFee"}}))()()({reflectSymbol:function(){return"maxDuration"}}))()()({reflectSymbol:function(){return"minDuration"}}))()()({reflectSymbol:function(){return"maxAmount"}}))()()({reflectSymbol:function(){return"minAmount"}}))()()())(a.knownNatZ))};n._minAmount=function(e){var n=l._Newtype()()(e.Profunctor0()),t=s.prop({reflectSymbol:function(){return"minAmount"}})()()(d.Proxy.value)(e);return function(e){return n(t(e))}},n._maxAmount=function(e){var n=l._Newtype()()(e.Profunctor0()),t=s.prop({reflectSymbol:function(){return"maxAmount"}})()()(d.Proxy.value)(e);return function(e){return n(t(e))}},n._minDuration=function(e){var n=l._Newtype()()(e.Profunctor0()),t=s.prop({reflectSymbol:function(){return"minDuration"}})()()(d.Proxy.value)(e);return function(e){return n(t(e))}},n._maxDuration=function(e){var n=l._Newtype()()(e.Profunctor0()),t=s.prop({reflectSymbol:function(){return"maxDuration"}})()()(d.Proxy.value)(e);return function(e){return n(t(e))}},n._protocolFee=function(e){var n=l._Newtype()()(e.Profunctor0()),t=s.prop({reflectSymbol:function(){return"protocolFee"}})()()(d.Proxy.value)(e);return function(e){return n(t(e))}},n._managerAddress=function(e){var n=l._Newtype()()(e.Profunctor0()),t=s.prop({reflectSymbol:function(){return"managerAddress"}})()()(d.Proxy.value)(e);return function(e){return n(t(e))}},n.showPProtocolDatum=v,n.toDataPProtocolDatum=p,n.fromDataPProtocolDatum=g}(c),function(e){let n;n=t(2076),e.protocolValidator=n}(c["Protocol.ProtocolScript"]=c["Protocol.ProtocolScript"]||{}),function(e){"use strict";e["Protocol.ProtocolScript"]=e["Protocol.ProtocolScript"]||{};var n=e["Protocol.ProtocolScript"],t=e["Protocol.ProtocolScript"],r=e["Contract.Monad"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Ctl.Internal.ApplyArgs"],c=e["Ctl.Internal.Cardano.TextEnvelope"],l=e["Ctl.Internal.Contract.Monad"],s=e["Ctl.Internal.Scripts"],f=e["Ctl.Internal.ToData"],d=e["Data.Array"],v=e["Data.Maybe"],m=e["Effect.Exception"],p=e["Protocol.Models"],g=function(e){return a.bind(l.bindContract)(u.liftMaybe(l.monadThrowErrorContract)(m.error("Error decoding protocolValidator"))(a.bind(v.bindMaybe)(c.decodeTextEnvelope(t.protocolValidator))((function(e){return c.plutusScriptV2FromEnvelope(e)}))))((function(n){return a.bind(l.bindContract)(r.liftContractE(i.showApplyArgsError)((t=n,function(e){var n=d.singleton(f.toData(p.toDataProtocol)(e));return i.applyArgs(t)(n)})(e)))((function(e){return o.pure(l.applicativeContract)(e)}));var t}))};n.protocolValidatorScript=g,n.getProtocolValidatorHash=function(e){return a.bind(l.bindContract)(g(e))((function(e){return o.pure(l.applicativeContract)(s.validatorHash(e))}))}}(c),function(e){"use strict";e["Protocol.UserData"]=e["Protocol.UserData"]||{};var n=e["Protocol.UserData"],t=e["Contract.Monad"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],i=e["Ctl.Internal.Types.ByteArray"],c=e["Ctl.Internal.Types.TokenName"],l=e["Data.Maybe"];n.getConfigFromProtocolDatum=function(e){return{minAmountParam:e.minAmount,maxAmountParam:e.maxAmount,minDurationParam:e.minDuration,maxDurationParam:e.maxDuration,protocolFeeParam:e.protocolFee}},n.dataToProtocol=function(e){return o.bind(a.bindContract)(t.liftContractM("Impossible to get protocol currency symbol")(o.bind(l.bindMaybe)(i.hexToByteArray(e.protocolCurrency))(u.mkCurrencySymbol)))((function(n){return o.bind(a.bindContract)(t.liftContractM("Impossible to get protocol token name")(o.bind(l.bindMaybe)(i.byteArrayFromAscii(e.protocolTokenName))(c.mkTokenName)))((function(e){return r.pure(a.applicativeContract)({protocolCurrency:n,protocolTokenName:e})}))}))}}(c),function(e){"use strict";e["Shared.Utxo"]=e["Shared.Utxo"]||{};var n=e["Shared.Utxo"],t=e["Contract.Monad"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Cardano.Types.ScriptRef"],u=e["Ctl.Internal.Contract.Monad"],i=e["Ctl.Internal.FromData"],c=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],l=e["Ctl.Internal.Plutus.Types.Transaction"],s=e["Ctl.Internal.Plutus.Types.Value"],f=e["Ctl.Internal.Types.OutputDatum"],d=e["Ctl.Internal.Types.TokenName"],v=e["Data.Array"],m=e["Data.BigInt"],p=e["Data.Eq"],g=e["Data.Lens.Getter"],y=e["Data.Lens.Internal.Forget"],b=e["Data.Map.Internal"],w=e["Data.Maybe"],C=e["Data.Semiring"],h=e["Data.Unfoldable"],A=function(e){return function(n){var t=g.viewOn(g.viewOn(n.value1)(l._output(y.strongForget)))(l._amount(y.strongForget));return p.eq(m.eqBigInt)(s.valueOf(t)(e.value0)(e.value1))(C.one(m.semiringBigInt))}},S=function(e){return v.filter(A(e))},I=s.singleton(c.adaSymbol)(d.adaToken)(m.fromInt(5e6)),T=v.filter((function(e){var n=g.viewOn(g.viewOn(e.value1)(l._output(y.strongForget)))(l._amount(y.strongForget));return p.notEq(s.eqValue)(n)(I)}));n.getNonCollateralUtxo=function(e){var n=T(b.toUnfoldable(h.unfoldableArray)(e));return o.bind(u.bindContract)(t.liftContractM("Failed to get non collateral utxo")(v.head(n)))((function(e){return r.pure(u.applicativeContract)(b.singleton(e.value0)(e.value1))}))},n.checkTokenInUTxO=A,n.filterByToken=S,n.getUtxoByNFT=function(e){return function(n){return function(r){return t.liftContractM(e+" UTxO with given nft not found")(v.head(S(n)(b.toUnfoldable(h.unfoldableArray)(r))))}}},n.getUtxoByScriptRef=function(e){return function(n){return function(r){return t.liftContractM(e+" UTxO with script reference not found")(v.head(function(e){return v.filter(function(e){return function(n){return p.eq(w.eqMaybe(a.eqScriptRef))(g.viewOn(n.value1)(l._scriptRef(y.strongForget)))(new w.Just(e))}}(e))}(n)(b.toUnfoldable(h.unfoldableArray)(r))))}}},n.extractDatumFromUTxO=function(e){return function(n){var t=g.viewOn(g.viewOn(n.value1)(l._output(y.strongForget)))(l._datum(y.strongForget));return t instanceof f.OutputDatum?i.fromData(e)(t.value0):w.Nothing.value}},n.extractValueFromUTxO=function(e){return g.viewOn(g.viewOn(e.value1)(l._output(y.strongForget)))(l._amount(y.strongForget))}}(c),function(e){"use strict";e["Shared.OwnCredentials"]=e["Shared.OwnCredentials"]||{};var n=e["Shared.OwnCredentials"],t=e["Contract.Address"],r=e["Contract.Log"],o=e["Contract.Monad"],a=e["Contract.Utxos"],u=e["Control.Applicative"],i=e["Control.Bind"],c=e["Ctl.Internal.Contract.Monad"],l=e["Ctl.Internal.Plutus.Types.Address"],s=e["Ctl.Internal.Plutus.Types.Credential"],f=e["Ctl.Internal.Plutus.Types.Value"],d=e["Ctl.Internal.Types.PubKeyHash"],v=e["Data.Array"],m=e["Data.Eq"],p=e["Data.Foldable"],g=e["Data.Functor"],y=e["Data.Map.Internal"],b=e["Data.Maybe"],w=e["Data.Show"],C=e["Data.Tuple"],h=e["Data.Unfoldable"],A=e["Effect.Class"],S=e["Effect.Exception"],I=e["Shared.Utxo"],T=i.bind(c.bindContract)(t.ownPaymentPubKeysHashes)((function(e){return i.bind(c.bindContract)(o.liftContractM("Impossible to get own PaymentPubkeyHash")(v.head(e)))((function(e){return i.discard(i.discardUnit)(c.bindContract)(r["logInfo'"](c.monadLoggerContract)("Own Payment pkh is: "+w.show(d.showPaymentPubKeyHash)(e)))((function(){return i.bind(c.bindContract)(o.liftedM("Failed to get own address")(g.map(c.functorContract)(v.head)(t.getWalletAddressesWithNetworkTag)))((function(n){return u.pure(c.applicativeContract)(new C.Tuple(e,n))}))}))}))})),D=i.bind(c.bindContract)(T)((function(e){return i.bind(c.bindContract)(g.map(c.functorContract)((n=i.join(b.bindMaybe),function(e){return n(v.head(e))}))(t.ownStakePubKeysHashes))((function(n){return i.bind(c.bindContract)(o.liftContractM("Failed to get own SKH")(n))((function(n){return i.bind(c.bindContract)(a.utxosAt(l.plutusAddressAddressWithN)(e.value1))((function(t){return i.bind(c.bindContract)(I.getNonCollateralUtxo(t))((function(r){var a=y.toUnfoldable(h.unfoldableArray)(t),l=p.foldMap(p.foldableArray)(f.monoidValue)(I.extractValueFromUTxO)(a);return i.bind(c.bindContract)(o.liftContractM("Utxo set is empty")(g.map(b.functorMaybe)(C.fst)(v.head(y.toUnfoldable(h.unfoldableArray)(r)))))((function(t){return u.pure(c.applicativeContract)({ownPkh:e.value0,ownSkh:n,ownAddressWithNetworkTag:e.value1,ownUtxos:r,ownValue:l,nonCollateralORef:t})}))}))}))}))}));var n}));n.getOwnCreds=D,n.getOwnUserInfo=function(e){return i.bind(c.bindContract)(T)((function(n){return u.pure(c.applicativeContract)({address:t.addressWithNetworkTagToBech32(n.value1),isManager:m.eq(d.eqPaymentPubKeyHash)(n.value0)(e)})}))},n.getPkhSkhFromAddress=function(e){return i.bind(c.bindContract)(o.liftContractM("Impossible to extract payment pkh from script address")(l.toPubKeyHash(e)))((function(n){return i.bind(c.bindContract)(o.liftContractM("Staking creds missed from provided address")(l.toStakingCredential(e)))((function(e){return i.bind(c.bindContract)(e instanceof s.StakingHash?o.liftContractM("Impossible to extract staking pkh")((t=e.value0)instanceof s.PubKeyCredential?new b.Just(t.value0):b.Nothing.value):A.liftEffect(c.monadEffectContract)(S.throw("Unexpected staking credentials")))((function(e){return u.pure(c.applicativeContract)(new C.Tuple(n,e))}));var t}))}))}}(c),function(e){"use strict";e["Shared.NetworkData"]=e["Shared.NetworkData"]||{};var n=e["Shared.NetworkData"],t=e["Ctl.Internal.Serialization.Address"],r=e["Data.Generic.Rep"],o=e["Data.Maybe"],a=e["Data.Show.Generic"],u=e["Data.Tuple"],i=function(){function e(){}return e.value=new e,e}(),c=function(){function e(){}return e.value=new e,e}(),l=function(){function e(){}return e.value=new e,e}(),s=function(){function e(){}return e.value=new e,e}(),f={to:function(e){if(e instanceof r.Inl)return i.value;if(e instanceof r.Inr&&e.value0 instanceof r.Inl)return c.value;if(e instanceof r.Inr&&e.value0 instanceof r.Inr&&e.value0.value0 instanceof r.Inl)return l.value;if(e instanceof r.Inr&&e.value0 instanceof r.Inr&&e.value0.value0 instanceof r.Inr)return s.value;throw new Error("Failed pattern match at Shared.NetworkData (line 17, column 1 - line 17, column 37): "+[e.constructor.name])},from:function(e){if(e instanceof i)return new r.Inl(r.NoArguments.value);if(e instanceof c)return new r.Inr(new r.Inl(r.NoArguments.value));if(e instanceof l)return new r.Inr(new r.Inr(new r.Inl(r.NoArguments.value)));if(e instanceof s)return new r.Inr(new r.Inr(new r.Inr(r.NoArguments.value)));throw new Error("Failed pattern match at Shared.NetworkData (line 17, column 1 - line 17, column 37): "+[e.constructor.name])}},d={show:a.genericShow(f)(a.genericShowSum(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Nami"}}))(a.genericShowSum(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Flint"}}))(a.genericShowSum(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Lode"}}))(a.genericShowConstructor(a.genericShowArgsNoArguments)({reflectSymbol:function(){return"Eternl"}})))))};n.Nami=i,n.Flint=c,n.Lode=l,n.Eternl=s,n.networkParamsToNetworkWallet=function(e){var n=new u.Tuple(e.wallet,e.isMainnet);return"Nami"!==n.value0||n.value1?"Flint"!==n.value0||n.value1?"Lode"!==n.value0||n.value1?"Eternl"!==n.value0||n.value1?"Nami"===n.value0&&n.value1?new o.Just({networkId:t.MainnetId.value,walletType:i.value}):"Flint"===n.value0&&n.value1?new o.Just({networkId:t.MainnetId.value,walletType:c.value}):"Lode"===n.value0&&n.value1?new o.Just({networkId:t.MainnetId.value,walletType:l.value}):"Eternl"===n.value0&&n.value1?new o.Just({networkId:t.MainnetId.value,walletType:s.value}):o.Nothing.value:new o.Just({networkId:t.TestnetId.value,walletType:s.value}):new o.Just({networkId:t.TestnetId.value,walletType:l.value}):new o.Just({networkId:t.TestnetId.value,walletType:c.value}):new o.Just({networkId:t.TestnetId.value,walletType:i.value})},n.showWalletType=d}(c),function(e){"use strict";e["Shared.TestnetConfig"]=e["Shared.TestnetConfig"]||{};var n=e["Shared.TestnetConfig"],t=e["Contract.Config"],r=e["Ctl.Internal.Contract.QueryBackend"],o=e["Ctl.Internal.Serialization.Address"],a=e["Ctl.Internal.Wallet.Spec"],u=e["Data.Log.Level"],i=e["Data.Maybe"],c=e["Data.Show"],l=e["Data.Tuple"],s=e["Data.UInt"],f=e["Effect.Class"],d=e["Effect.Class.Console"],v=e["Effect.Exception"],m=e["Shared.NetworkData"],p={port:s.fromInt(443),host:"ogmios.donat-pool.io",secure:!0,path:i.Nothing.value},g={port:s.fromInt(443),host:"kupo.donat-pool.io",secure:!0,path:i.Nothing.value},y={backendParams:r.mkCtlBackendParams({ogmiosConfig:p,kupoConfig:g}),networkId:t.testnetConfig.networkId,logLevel:u.Debug.value,walletSpec:t.testnetConfig.walletSpec,customLogger:t.testnetConfig.customLogger,suppressLogs:t.testnetConfig.suppressLogs,hooks:t.testnetConfig.hooks},b={backendParams:y.backendParams,networkId:y.networkId,logLevel:y.logLevel,walletSpec:new i.Just(a.ConnectToEternl.value),customLogger:y.customLogger,suppressLogs:y.suppressLogs,hooks:y.hooks},w={backendParams:y.backendParams,networkId:y.networkId,logLevel:y.logLevel,walletSpec:new i.Just(a.ConnectToFlint.value),customLogger:y.customLogger,suppressLogs:y.suppressLogs,hooks:y.hooks},C={backendParams:y.backendParams,networkId:y.networkId,logLevel:y.logLevel,walletSpec:new i.Just(a.ConnectToLode.value),customLogger:y.customLogger,suppressLogs:y.suppressLogs,hooks:y.hooks},h={backendParams:y.backendParams,networkId:y.networkId,logLevel:y.logLevel,walletSpec:new i.Just(a.ConnectToNami.value),customLogger:y.customLogger,suppressLogs:y.suppressLogs,hooks:y.hooks};n.mkNetworkWalletConfig=function(e){return function(){d.log(f.monadEffectEffect)("NetworkId: "+c.show(o.showNetworkId)(e.networkId))(),d.log(f.monadEffectEffect)("WalletType: "+c.show(m.showWalletType)(e.walletType))();var n=new l.Tuple(e.walletType,e.networkId);return n.value0 instanceof m.Nami&&n.value1 instanceof o.TestnetId?h:n.value0 instanceof m.Flint&&n.value1 instanceof o.TestnetId?w:n.value0 instanceof m.Lode&&n.value1 instanceof o.TestnetId?C:n.value0 instanceof m.Eternl&&n.value1 instanceof o.TestnetId?b:v.throw("Wallet/network configuration not implemented")()}}}(c),function(e){"use strict";e["Shared.RunContract"]=e["Shared.RunContract"]||{};var n=e["Shared.RunContract"],t=e["Control.Applicative"],r=e["Ctl.Internal.Contract.Monad"],o=e["Data.Either"],a=e["Data.Maybe"],u=e.Effect,i=e["Effect.Aff"],c=e["Effect.Exception"],l=e["Shared.NetworkData"],s=e["Shared.TestnetConfig"];n.runContractWithResult=function(e){return function(n){return function(f){return function(d){var v=function(t){if(t instanceof o.Right)return e(t.value0);if(t instanceof o.Left)return n(c.message(t.value0));throw new Error("Failed pattern match at Shared.RunContract (line 17, column 3 - line 17, column 43): "+[t.constructor.name])};return function(){var e=a.maybe(c.throw("Impossible to parse Wallet type"))(t.pure(u.applicativeEffect))(l.networkParamsToNetworkWallet(f))(),n=s.mkNetworkWalletConfig(e)();return i.runAff_(v)(r.runContract(n)(d))()}}}}}}(c),function(e){"use strict";e["Info.AppInfo"]=e["Info.AppInfo"]||{};var n=e["Info.AppInfo"],t=e["Contract.Address"],r=e["Contract.Log"],o=e["Contract.Monad"],a=e["Contract.Utxos"],u=e["Control.Applicative"],i=e["Control.Bind"],c=e["Ctl.Internal.Contract.Monad"],l=e["Ctl.Internal.Plutus.Types.Address"],s=e["Data.Newtype"],f=e["Data.Show"],d=e["Data.Tuple"],v=e["Protocol.Datum"],m=e["Protocol.ProtocolScript"],p=e["Protocol.UserData"],g=e["Shared.OwnCredentials"],y=e["Shared.RunContract"],b=e["Shared.Utxo"],w=function(e){return function(n){var t=s.unwrap()(e);return b.getUtxoByNFT("Protocol")(new d.Tuple(t.protocolCurrency,t.protocolTokenName))(n)}};n.runGetAppInfo=function(e){return function(n){return function(d){return function(C){return y.runContractWithResult(e)(n)(C)(function(e){return i.discard(i.discardUnit)(c.bindContract)(r["logInfo'"](c.monadLoggerContract)("Running get protocol info"))((function(){return i.bind(c.bindContract)(p.dataToProtocol(e))((function(e){return i.bind(c.bindContract)(m.getProtocolValidatorHash(e))((function(n){return i.bind(c.bindContract)(t.getNetworkId)((function(d){return i.bind(c.bindContract)(o.liftContractM("Impossible to get Protocol script address")(t.validatorHashBaseAddress(d)(n)))((function(n){return i.bind(c.bindContract)(a.utxosAt(l.plutusAddressAddress)(n))((function(n){return i.bind(c.bindContract)(w(e)(n))((function(e){return i.bind(c.bindContract)(o.liftContractM("Impossible to get Protocol Datum")(b.extractDatumFromUTxO(v.fromDataPProtocolDatum)(e)))((function(e){return i.discard(i.discardUnit)(c.bindContract)(r["logInfo'"](c.monadLoggerContract)("Current datum: "+f.show(v.showPProtocolDatum)(e)))((function(){return i.bind(c.bindContract)(g.getPkhSkhFromAddress(s.unwrap()(e).managerAddress))((function(n){return i.bind(c.bindContract)(g.getOwnUserInfo(n.value0))((function(n){var t={protocolConfig:p.getConfigFromProtocolDatum(e),userInfo:n};return u.pure(c.applicativeContract)(t)}))}))}))}))}))}))}))}))}))}))}))}(d))}}}},n.getProtocolUtxo=w}(c),function(e){"use strict";e["Protocol.ProtocolScriptInfo"]=e["Protocol.ProtocolScriptInfo"]||{};var n=e["Protocol.ProtocolScriptInfo"],t=e["Contract.Address"],r=e["Contract.Monad"],o=e["Contract.Utxos"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.Cardano.Types.ScriptRef"],c=e["Ctl.Internal.Contract.Monad"],l=e["Ctl.Internal.Plutus.Types.Address"],s=e["Ctl.Internal.Plutus.Types.TransactionUnspentOutput"],f=e["Ctl.Internal.Types.Scripts"],d=e["Ctl.Internal.Types.TxConstraints"],v=e["Data.Newtype"],m=e["Data.Tuple"],p=e["Effect.Class"],g=e["Effect.Exception"],y=e["Info.AppInfo"],b=e["MintingPolicy.VerTokenMinting"],w=e["Protocol.Datum"],C=e["Protocol.ProtocolScript"],h=e["Shared.Utxo"];n.getProtocolScriptInfo=function(e){return u.bind(c.bindContract)(C.protocolValidatorScript(e))((function(n){return u.bind(c.bindContract)(C.getProtocolValidatorHash(e))((function(C){return u.bind(c.bindContract)(t.getNetworkId)((function(A){return u.bind(c.bindContract)(r.liftContractM("Impossible to get Protocol script address")(t.validatorHashBaseAddress(A)(C)))((function(t){return u.bind(c.bindContract)(o.utxosAt(l.plutusAddressAddress)(t))((function(o){return u.bind(c.bindContract)(y.getProtocolUtxo(e)(o))((function(l){return u.bind(c.bindContract)(r.liftContractM("Impossible to get Protocol Datum")(h.extractDatumFromUTxO(w.fromDataPProtocolDatum)(l)))((function(r){var y=h.extractValueFromUTxO(l),w=new i.PlutusScriptRef(v.unwrap()(n));return u.bind(c.bindContract)(h.getUtxoByScriptRef("Protocol")(w)(o))((function(v){var w=new d.RefInput(s.mkTxUnspentOut(m.fst(v))(m.snd(v)));return u.bind(c.bindContract)(b.mintingPolicy(e))((function(e){return u.bind(c.bindContract)(e instanceof f.PlutusMintingPolicy?a.pure(c.applicativeContract)(new i.PlutusScriptRef(e.value0)):p.liftEffect(c.monadEffectContract)(g.throw("Unexpected Minting Policy script type")))((function(e){return u.bind(c.bindContract)(h.getUtxoByScriptRef("VerTokenPolicy")(e)(o))((function(e){var u=new d.RefInput(s.mkTxUnspentOut(m.fst(e))(m.snd(e))),i={pScriptRef:v,pRefScriptInput:w,verTokenRef:e,verTokenInput:u};return a.pure(c.applicativeContract)({pValidator:n,pValidatorHash:C,pAddress:t,pUtxos:o,pUtxo:l,pDatum:r,pValue:y,references:i})}))}))}))}))}))}))}))}))}))}))}))}}(c),function(e){"use strict";e["Protocol.Redeemer"]=e["Protocol.Redeemer"]||{};var n=e["Protocol.Redeemer"],t=e["Ctl.Internal.ToData"],r=e["Ctl.Internal.TypeLevel.Nat"],o=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],a=e["Data.Generic.Rep"],u=e["Protocol.Models"],i=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),c=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),l=function(){function e(){}return e.value=new e,e}(),s={to:function(e){if(e instanceof a.Inl)return new i(e.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inl)return new c(e.value0.value0);if(e instanceof a.Inr&&e.value0 instanceof a.Inr)return l.value;throw new Error("Failed pattern match at Protocol.Redeemer (line 13, column 1 - line 13, column 44): "+[e.constructor.name])},from:function(e){if(e instanceof i)return new a.Inl(e.value0);if(e instanceof c)return new a.Inr(new a.Inl(e.value0));if(e instanceof l)return new a.Inr(new a.Inr(a.NoArguments.value));throw new Error("Failed pattern match at Protocol.Redeemer (line 13, column 1 - line 13, column 44): "+[e.constructor.name])}},f={toData:t.genericToData(s)(t.toDataWithSchemaSum(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PUpdateProtocolConfig"}})(t.toDataArgsArgument(u.toDataPProtocolConfig)({reflectSymbol:function(){return"PUpdateProtocolConfig"}}))()()(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PUpdateProtocolConfig"}})(r.knownNatZ))(r.knownNatZ))(t.toDataWithSchemaSum(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PStartFundrise"}})(t.toDataArgsArgument(u.toDataPFundriseConfig)({reflectSymbol:function(){return"PStartFundrise"}}))()()(o.getIndexWithLabelConsI(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PStartFundrise"}})(r.knownNatS(r.knownNatZ)))()()({reflectSymbol:function(){return"PStartFundrise"}})(r.knownNatS(r.knownNatZ)))(r.knownNatS(r.knownNatZ)))(t.toDataWithSchemaConstruct({reflectSymbol:function(){return"PCloseProtocol"}})(t.toDataArgsNoArguments({reflectSymbol:function(){return"PCloseProtocol"}}))()()(o.getIndexWithLabelConsI(o.getIndexWithLabelConsI(o.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PCloseProtocol"}})(r.knownNatS(r.knownNatS(r.knownNatZ))))()()({reflectSymbol:function(){return"PCloseProtocol"}})(r.knownNatS(r.knownNatS(r.knownNatZ))))()()({reflectSymbol:function(){return"PCloseProtocol"}})(r.knownNatS(r.knownNatS(r.knownNatZ))))(r.knownNatS(r.knownNatS(r.knownNatZ))))))};n.PStartFundrise=c,n.toDataPProtocolRedeemer=f}(c),function(e){"use strict";e["Shared.Duration"]=e["Shared.Duration"]||{};var n=e["Shared.Duration"],t=e["Data.BigInt"],r=e["Data.Semiring"],o=t.fromInt(60),a=t.fromInt(1440);n.durationToMinutes=function(e){return r.add(t.semiringBigInt)(r.add(t.semiringBigInt)(r.mul(t.semiringBigInt)(t.fromInt(e.days))(a))(r.mul(t.semiringBigInt)(t.fromInt(e.hours))(o)))(t.fromInt(e.minutes))},n.minutesToPosixTime=function(e){return r.mul(t.semiringBigInt)(r.mul(t.semiringBigInt)(e)(t.fromInt(60)))(t.fromInt(1e3))}}(c),function(e){"use strict";e["Shared.Tx"]=e["Shared.Tx"]||{};var n=e["Shared.Tx"],t=e["Contract.Log"],r=e["Contract.ScriptLookups"],o=e["Contract.Transaction"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.BalanceTx.Constraints"],c=e["Ctl.Internal.BalanceTx.Error"],l=e["Ctl.Internal.Contract.AwaitTxConfirmed"],s=e["Ctl.Internal.Contract.Monad"],f=e["Ctl.Internal.FromData"],d=e["Ctl.Internal.IsData"],v=e["Ctl.Internal.Service.Error"],m=e["Ctl.Internal.ToData"],p=e["Ctl.Internal.Types.ScriptLookups"],g=e["Data.Either"],y=e["Data.Show"],b=e["Effect.Class"],w=e["Effect.Exception"];n.completeTx=function(e){return function(n){return function(C){var h=function(e){return function(n){return function(r){return u.discard(u.discardUnit)(s.bindContract)(t["logError'"](s.monadLoggerContract)(y.show(e)(r)))((function(){return b.liftEffect(s.monadEffectContract)(w.throw(n))}))}}};return u.bind(s.bindContract)(u.bind(s.bindContract)(r.mkUnbalancedTx()(d.isData(f.fromDataVoid)(m.toDataVoid))(d.isData(f.fromDataVoid)(m.toDataVoid))(e)(n))(g.either(h(p.showMkUnbalancedTxError)("An error occured while constructing the transaction"))(a.pure(s.applicativeContract))))((function(e){var n=i.mustSendChangeToAddress(C.ownAddressWithNetworkTag);return u.bind(s.bindContract)(u.bind(s.bindContract)(o.balanceTxWithConstraints(e)(n))(g.either(h(c.showBalanceTxError)("An error occured while balancing the transaction"))(a.pure(s.applicativeContract))))((function(e){return u.bind(s.bindContract)(o.signTransaction()(e))((function(e){return u.bind(s.bindContract)(o.submitE(e))(g.either(h(v.showClientError)("An error occured while submitting the transaction"))(l.awaitTxConfirmed))}))}))}))}}},n.toDatum=function(e){return function(n){return m.toData(e)(n)}},n.toRedeemer=function(e){return function(n){return m.toData(e)(n)}}}(c),function(e){"use strict";e["Fundraising.Create"]=e["Fundraising.Create"]||{};var n=e["Fundraising.Create"],t=e["Contract.Address"],r=e["Contract.Log"],o=e["Contract.Monad"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.Contract.Monad"],c=e["Ctl.Internal.Contract.WaitUntilSlot"],l=e["Ctl.Internal.Plutus.Types.Credential"],s=e["Ctl.Internal.Plutus.Types.Value"],f=e["Ctl.Internal.Scripts"],d=e["Ctl.Internal.ToData"],v=e["Ctl.Internal.Types.ByteArray"],m=e["Ctl.Internal.Types.ScriptLookups"],p=e["Ctl.Internal.Types.TxConstraints"],g=e["Data.BigInt"],y=e["Data.Lens.Getter"],b=e["Data.Lens.Internal.Forget"],w=e["Data.Ord"],C=e["Data.Semigroup"],h=e["Data.Semiring"],A=e["Data.Show"],S=e["Data.String.CodePoints"],I=e["Data.Tuple"],T=e["Effect.Class"],D=e["Effect.Exception"],F=e["Ext.Contract.Time"],E=e["Ext.Contract.Value"],x=e["Ext.Seriaization.Key"],M=e["Fundraising.Datum"],R=e["Fundraising.FundraisingScript"],P=e["MintingPolicy.NftMinting"],k=e["MintingPolicy.NftRedeemer"],B=e["MintingPolicy.VerTokenMinting"],N=e["MintingPolicy.VerTokenRedeemers"],L=e["Protocol.Datum"],_=e["Protocol.ProtocolScriptInfo"],U=e["Protocol.Redeemer"],H=e["Protocol.UserData"],q=e["Shared.Duration"],O=e["Shared.MinAda"],V=e["Shared.OwnCredentials"],W=e["Shared.RunContract"],K=e["Shared.Tx"];n.runCreateFundraising=function(e){return function(n){return function(z){return function(J){return function(G){return W.runContractWithResult(e)(n)(J)(function(e){return function(n){return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Running Create Fundraising contract"))((function(){return u.bind(i.bindContract)(H.dataToProtocol(e))((function(e){return u.bind(i.bindContract)(V.getOwnCreds)((function(H){return u.bind(i.bindContract)(_.getProtocolScriptInfo(e))((function(_){return u.bind(i.bindContract)(E.mkCurrencySymbol(P.mintingPolicy(H.nonCollateralORef)))((function(P){return u.bind(i.bindContract)(R.getFundraisingTokenName)((function(V){return u.bind(i.bindContract)(E.mkCurrencySymbol(B.mintingPolicy(e)))((function(W){return u.bind(i.bindContract)(B.verTokenName)((function(B){var z=f.mintingPolicyHash(W.value0),J=h.mul(g.semiringBigInt)(g.fromInt(n.amount))(g.fromInt(1e6)),G=y.view(L._minAmount(b.strongForget))(_.pDatum),j=y.view(L._maxAmount(b.strongForget))(_.pDatum);return u.discard(u.discardUnit)(i.bindContract)(a.when(i.applicativeContract)(w.lessThan(g.ordBigInt)(J)(G))(T.liftEffect(i.monadEffectContract)(D.throw("Fundraising amount too small. It must be greater than "+g.toString(G)+"."))))((function(){return u.discard(u.discardUnit)(i.bindContract)(a.when(i.applicativeContract)(w.greaterThan(g.ordBigInt)(J)(j))(T.liftEffect(i.monadEffectContract)(D.throw("Fundraising amount too big. It must be less than "+g.toString(j)+"."))))((function(){var f=y.view(L._minDuration(b.strongForget))(_.pDatum),G=y.view(L._maxDuration(b.strongForget))(_.pDatum),j=q.durationToMinutes(n.duration);return u.discard(u.discardUnit)(i.bindContract)(a.when(i.applicativeContract)(w.lessThan(g.ordBigInt)(j)(f))(T.liftEffect(i.monadEffectContract)(D.throw("Fundraising duration too short. It must be greater than "+g.toString(f)+"."))))((function(){return u.discard(u.discardUnit)(i.bindContract)(a.when(i.applicativeContract)(w.greaterThan(g.ordBigInt)(j)(G))(T.liftEffect(i.monadEffectContract)(D.throw("Fundraising duration too long. It must be less than "+g.toString(G)+"."))))((function(){return u.bind(i.bindContract)(c.currentTime)((function(c){var f=F.addTimes(c)(q.minutesToPosixTime(j));return u.bind(i.bindContract)(o.liftContractM("Impossible to serialize a title")(v.byteArrayFromAscii(S.take(M.titleLength)(n.title))))((function(v){var w={creatorPkh:H.ownPkh,tokenOrigin:H.nonCollateralORef,frTitle:v,frAmount:J,frDeadline:f,frFee:y.view(L._protocolFee(b.strongForget))(_.pDatum),managerAddress:y.view(L._managerAddress(b.strongForget))(_.pDatum)},S={protocol:e,verTokenCurrency:W.value1,verTokenName:B};return u.bind(i.bindContract)(t.getNetworkId)((function(e){return u.bind(i.bindContract)(R.getFundraisingValidatorHash(S))((function(v){return u.bind(i.bindContract)(o.liftContractM("Impossible to get Fundraising script address")(t.validatorHashBaseAddress(e)(v)))((function(e){var o={scriptAddress:e,verCurrencySymbol:W.value1,verTokenName:B,threadCurrencySymbol:P.value1,threadTokenName:V,startedAt:c},y=d.toData(U.toDataPProtocolRedeemer)(new U.PStartFundrise(o)),b=s.singleton(W.value1)(B)(h.one(g.semiringBigInt)),S=s.singleton(P.value1)(V)(h.one(g.semiringBigInt)),T=C.append(s.semigroupValue)(O.minAdaValue)(C.append(s.semigroupValue)(O.minAdaValue)(C.append(s.semigroupValue)(S)(b))),D=C.append(m.semigroupScriptLookups)(m.mintingPolicy(P.value0))(C.append(m.semigroupScriptLookups)(m.unspentOutputs(H.ownUtxos))(m.unspentOutputs(_.pUtxos))),F=C.append(p.semigroupTxConstraints)(p.mustSpendPubKeyOutput(H.nonCollateralORef))(C.append(p.semigroupTxConstraints)(p.mustMintValueWithRedeemer(d.toData(k.toDataPNftRedeemer)(new k.PMintNft(V)))(S))(C.append(p.semigroupTxConstraints)(p.mustMintCurrencyWithRedeemerUsingScriptRef(z)(d.toData(N.toDataPVerTokenRedeemer)(new N.PMintVerToken(B)))(B)(h.one(g.semiringBigInt))(_.references.verTokenInput))(C.append(p.semigroupTxConstraints)(p.mustSpendScriptOutputUsingScriptRef(I.fst(_.pUtxo))(y)(_.references.pRefScriptInput))(C.append(p.semigroupTxConstraints)(p.mustPayToScriptAddress(_.pValidatorHash)(new l.ScriptCredential(_.pValidatorHash))(d.toData(L.toDataPProtocolDatum)(_.pDatum))(p.DatumInline.value)(_.pValue))(C.append(p.semigroupTxConstraints)(p.mustPayToScriptAddress(v)(new l.ScriptCredential(v))(d.toData(M.toDataPFundraisingDatum)(w))(p.DatumInline.value)(T))(C.append(p.semigroupTxConstraints)(p.mustBeSignedBy(H.ownPkh))(C.append(p.semigroupTxConstraints)(p.mustReferenceOutput(I.fst(_.references.pScriptRef)))(p.mustReferenceOutput(I.fst(_.references.verTokenRef))))))))));return u.discard(u.discardUnit)(i.bindContract)(K.completeTx(D)(F)(H))((function(){return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Fundraising created successfully"))((function(){return u.bind(i.bindContract)(t.addressToBech32(e))((function(e){return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Current fundraising address: "+A.show(A.showString)(e)))((function(){return u.bind(i.bindContract)(x.pkhToBech32M(H.ownPkh))((function(e){return a.pure(i.applicativeContract)({creator:e,title:n.title,goal:J,raisedAmt:g.fromInt(0),deadline:f,threadTokenCurrency:E.currencySymbolToString(P.value1),threadTokenName:R.fundraisingTokenNameString,isCompleted:!1})}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}}(z)(G))}}}}}}(c),function(e){"use strict";e["Fundraising.FundraisingScriptInfo"]=e["Fundraising.FundraisingScriptInfo"]||{};var n=e["Fundraising.FundraisingScriptInfo"],t=e["Contract.Address"],r=e["Contract.Monad"],o=e["Contract.Utxos"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.Cardano.Types.ScriptRef"],c=e["Ctl.Internal.Contract.Monad"],l=e["Ctl.Internal.Plutus.Types.Address"],s=e["Ctl.Internal.Plutus.Types.TransactionUnspentOutput"],f=e["Ctl.Internal.Serialization.Address"],d=e["Ctl.Internal.Types.TxConstraints"],v=e["Data.Newtype"],m=e["Data.Tuple"],p=e["Ext.Contract.Value"],g=e["Fundraising.Datum"],y=e["Fundraising.FundraisingScript"],b=e["MintingPolicy.VerTokenMinting"],w=e["Protocol.UserData"],C=e["Shared.Utxo"];n.makeFundraising=function(e){return u.bind(c.bindContract)(w.dataToProtocol(e))((function(e){return u.bind(c.bindContract)(p.mkCurrencySymbol(b.mintingPolicy(e)))((function(n){return u.bind(c.bindContract)(b.verTokenName)((function(t){return a.pure(c.applicativeContract)({protocol:e,verTokenCurrency:n.value1,verTokenName:t})}))}))}))},n.getFundraisingScriptInfo=function(e){return function(n){return function(p){return u.bind(c.bindContract)(y.fundraisingValidatorScript(e))((function(b){return u.bind(c.bindContract)(y.getFundraisingValidatorHash(e))((function(e){return u.bind(c.bindContract)(r.liftContractM("Impossible to get Fundraising script address")(t.validatorHashBaseAddress(f.TestnetId.value)(e)))((function(t){return u.bind(c.bindContract)(o.utxosAt(l.plutusAddressAddress)(t))((function(o){return u.bind(c.bindContract)(C.getUtxoByNFT("Fundraising")(new m.Tuple(n,p))(o))((function(n){return u.bind(c.bindContract)(r.liftContractM("Impossible to get Fundraising Datum")(C.extractDatumFromUTxO(g.fromDataPFundraisingDatum)(n)))((function(r){var l=C.extractValueFromUTxO(n),f=new i.PlutusScriptRef(v.unwrap()(b));return u.bind(c.bindContract)(C.getUtxoByScriptRef("Fundraising")(f)(o))((function(u){var i=new d.RefInput(s.mkTxUnspentOut(m.fst(u))(m.snd(u)));return a.pure(c.applicativeContract)({frValidator:b,frValidatorHash:e,frAddress:t,frUtxos:o,frUtxo:n,frDatum:r,frValue:l,frScriptRef:u,frRefScriptInput:i})}))}))}))}))}))}))}))}}}}(c),function(e){"use strict";e["Fundraising.Redeemer"]=e["Fundraising.Redeemer"]||{};var n=e["Fundraising.Redeemer"],t=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],r=e["Ctl.Internal.ToData"],o=e["Ctl.Internal.TypeLevel.Nat"],a=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],u=e["Ctl.Internal.Types.TokenName"],i=e["Data.Generic.Rep"],c=function(){function e(e,n,t){this.value0=e,this.value1=n,this.value2=t}return e.create=function(n){return function(t){return function(r){return new e(n,t,r)}}},e}(),l=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),s={to:function(e){if(e instanceof i.Inl)return new c(e.value0.value0,e.value0.value1.value0,e.value0.value1.value1);if(e instanceof i.Inr)return new l(e.value0.value0,e.value0.value1);throw new Error("Failed pattern match at Fundraising.Redeemer (line 13, column 1 - line 13, column 47): "+[e.constructor.name])},from:function(e){if(e instanceof c)return new i.Inl(new i.Product(e.value0,new i.Product(e.value1,e.value2)));if(e instanceof l)return new i.Inr(new i.Product(e.value0,e.value1));throw new Error("Failed pattern match at Fundraising.Redeemer (line 13, column 1 - line 13, column 47): "+[e.constructor.name])}},f={toData:r.genericToData(s)(r.toDataWithSchemaSum(r.toDataWithSchemaConstruct({reflectSymbol:function(){return"PDonate"}})(r.toDataArgsProduct(r.toDataArgsArgument(t.toDataCurrencySymbol)({reflectSymbol:function(){return"PDonate"}}))(r.toDataArgsProduct(r.toDataArgsArgument(u.toDataTokenName)({reflectSymbol:function(){return"PDonate"}}))(r.toDataArgsArgument(r.toDataBigInt)({reflectSymbol:function(){return"PDonate"}}))))()()(a.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PDonate"}})(o.knownNatZ))(o.knownNatZ))(r.toDataWithSchemaConstruct({reflectSymbol:function(){return"PReceiveFunds"}})(r.toDataArgsProduct(r.toDataArgsArgument(t.toDataCurrencySymbol)({reflectSymbol:function(){return"PReceiveFunds"}}))(r.toDataArgsArgument(u.toDataTokenName)({reflectSymbol:function(){return"PReceiveFunds"}})))()()(a.getIndexWithLabelConsI(a.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PReceiveFunds"}})(o.knownNatS(o.knownNatZ)))()()({reflectSymbol:function(){return"PReceiveFunds"}})(o.knownNatS(o.knownNatZ)))(o.knownNatS(o.knownNatZ))))};n.PDonate=c,n.PReceiveFunds=l,n.toDataPFundraisingRedeeme=f}(c),function(e){"use strict";e["Fundraising.Donate"]=e["Fundraising.Donate"]||{};var n=e["Fundraising.Donate"],t=e["Contract.Log"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Contract.WaitUntilSlot"],i=e["Ctl.Internal.Plutus.Types.Credential"],c=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],l=e["Ctl.Internal.Plutus.Types.Value"],s=e["Ctl.Internal.ToData"],f=e["Ctl.Internal.Types.Interval"],d=e["Ctl.Internal.Types.ScriptLookups"],v=e["Ctl.Internal.Types.TokenName"],m=e["Ctl.Internal.Types.TxConstraints"],p=e["Data.BigInt"],g=e["Data.Ord"],y=e["Data.Ring"],b=e["Data.Semigroup"],w=e["Data.Semiring"],C=e["Data.Tuple"],h=e["Effect.Class"],A=e["Effect.Exception"],S=e["Ext.Contract.Value"],I=e["Fundraising.Datum"],T=e["Fundraising.FundraisingScriptInfo"],D=e["Fundraising.Redeemer"],F=e["Shared.MinAda"],E=e["Shared.OwnCredentials"],x=e["Shared.RunContract"],M=e["Shared.Tx"],R=e["Shared.Utxo"];n.runDonate=function(e){return function(n){return function(P){return function(k){return function(B){return function(N){return x.runContractWithResult(e)(n)(k)(function(e){return function(n){return function(x){return o.discard(o.discardUnit)(a.bindContract)(t["logInfo'"](a.monadLoggerContract)("Running donate"))((function(){return o.bind(a.bindContract)(S.mkCurrencySymbolFromString(n.frThreadTokenCurrency))((function(P){return o.bind(a.bindContract)(S.runMkTokenName(n.frThreadTokenName))((function(n){return o.bind(a.bindContract)(T.makeFundraising(e))((function(e){return o.bind(a.bindContract)(T.getFundraisingScriptInfo(e)(P)(n))((function(S){var T=R.checkTokenInUTxO(new C.Tuple(e.verTokenCurrency,e.verTokenName))(S.frUtxo);return o.discard(o.discardUnit)(a.bindContract)(r.unless(a.applicativeContract)(T)(h.liftEffect(a.monadEffectContract)(A.throw("verToken is not in fundraising utxo"))))((function(){return o.bind(a.bindContract)(u.currentTime)((function(e){var u=w.mul(p.semiringBigInt)(p.fromInt(x))(p.fromInt(1e6)),T=y.sub(p.ringBigInt)(y.sub(p.ringBigInt)(l["valueToCoin'"](S.frValue))(l["valueToCoin'"](F.minAdaValue)))(l["valueToCoin'"](F.minAdaValue));return o.discard(o.discardUnit)(a.bindContract)(r.when(a.applicativeContract)(g.greaterThan(f.ordPOSIXTime)(e)(S.frDatum.frDeadline))(h.liftEffect(a.monadEffectContract)(A.throw("fundraising time is over"))))((function(){return o.discard(o.discardUnit)(a.bindContract)(r.when(a.applicativeContract)(g.greaterThanOrEq(p.ordBigInt)(T)(S.frDatum.frAmount))(h.liftEffect(a.monadEffectContract)(A.throw("fundraising goal is already completed"))))((function(){return o.bind(a.bindContract)(E.getOwnCreds)((function(r){var p=s.toData(I.toDataPFundraisingDatum)(S.frDatum),g=l.singleton(c.adaSymbol)(v.adaToken)(u),y=b.append(l.semigroupValue)(S.frValue)(g),w=s.toData(D.toDataPFundraisingRedeeme)(new D.PDonate(P,n,u)),h=f.from(f.ordPOSIXTime)(e),A=b.append(m.semigroupTxConstraints)(m.mustSpendScriptOutputUsingScriptRef(C.fst(S.frUtxo))(w)(S.frRefScriptInput))(b.append(m.semigroupTxConstraints)(m.mustPayToScriptAddress(S.frValidatorHash)(new i.ScriptCredential(S.frValidatorHash))(p)(m.DatumInline.value)(y))(b.append(m.semigroupTxConstraints)(m.mustBeSignedBy(r.ownPkh))(b.append(m.semigroupTxConstraints)(m.mustValidateIn(h))(m.mustReferenceOutput(C.fst(S.frScriptRef)))))),T=d.unspentOutputs(S.frUtxos);return o.discard(o.discardUnit)(a.bindContract)(M.completeTx(T)(A)(r))((function(){return t["logInfo'"](a.monadLoggerContract)("Donate finished successfully")}))}))}))}))}))}))}))}))}))}))}))}}}(P)(B)(N))}}}}}}}(c),function(e){"use strict";e["Fundraising.ReceiveFunds"]=e["Fundraising.ReceiveFunds"]||{};var n=e["Fundraising.ReceiveFunds"],t=e["Contract.Log"],r=e["Contract.Monad"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Ctl.Internal.Contract.Monad"],i=e["Ctl.Internal.Contract.WaitUntilSlot"],c=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],l=e["Ctl.Internal.Plutus.Types.Value"],s=e["Ctl.Internal.Scripts"],f=e["Ctl.Internal.ToData"],d=e["Ctl.Internal.Types.Interval"],v=e["Ctl.Internal.Types.PubKeyHash"],m=e["Ctl.Internal.Types.Redeemer"],p=e["Ctl.Internal.Types.ScriptLookups"],g=e["Ctl.Internal.Types.TokenName"],y=e["Ctl.Internal.Types.TxConstraints"],b=e["Data.BigInt"],w=e["Data.Eq"],C=e["Data.Ord"],h=e["Data.Ring"],A=e["Data.Semigroup"],S=e["Data.Tuple"],I=e["Effect.Class"],T=e["Effect.Exception"],D=e["Ext.Contract.Value"],F=e["Fundraising.Calculations"],E=e["Fundraising.FundraisingScriptInfo"],x=e["Fundraising.Redeemer"],M=e["MintingPolicy.NftMinting"],R=e["MintingPolicy.NftRedeemer"],P=e["MintingPolicy.VerTokenMinting"],k=e["MintingPolicy.VerTokenRedeemers"],B=e["Protocol.ProtocolScriptInfo"],N=e["Protocol.UserData"],L=e["Shared.MinAda"],_=e["Shared.OwnCredentials"],U=e["Shared.RunContract"],H=e["Shared.Tx"],q=e["Shared.Utxo"];n.runReceiveFunds=function(e){return function(n){return function(O){return function(V){return function(W){return U.runContractWithResult(e)(n)(V)(function(e){return function(n){return a.discard(a.discardUnit)(u.bindContract)(t["logInfo'"](u.monadLoggerContract)("Running receive funds"))((function(){return a.bind(u.bindContract)(N.dataToProtocol(e))((function(N){return a.bind(u.bindContract)(D.mkCurrencySymbolFromString(n.frThreadTokenCurrency))((function(U){return a.bind(u.bindContract)(D.runMkTokenName(n.frThreadTokenName))((function(n){return a.bind(u.bindContract)(E.makeFundraising(e))((function(e){return a.bind(u.bindContract)(E.getFundraisingScriptInfo(e)(U)(n))((function(D){var E=q.checkTokenInUTxO(new S.Tuple(e.verTokenCurrency,e.verTokenName))(D.frUtxo);return a.discard(a.discardUnit)(u.bindContract)(o.unless(u.applicativeContract)(E)(I.liftEffect(u.monadEffectContract)(T.throw("verToken is not in fundraising utxo"))))((function(){return a.bind(u.bindContract)(_.getPkhSkhFromAddress(D.frDatum.managerAddress))((function(E){return a.bind(u.bindContract)(i.currentTime)((function(i){var q=h.sub(b.ringBigInt)(h.sub(b.ringBigInt)(l.valueOf(D.frValue)(c.adaSymbol)(g.adaToken))(L.minAda))(L.minAda);return a.discard(a.discardUnit)(u.bindContract)(o.when(u.applicativeContract)(C.lessThanOrEq(d.ordPOSIXTime)(i)(D.frDatum.frDeadline)&&C.lessThan(b.ordBigInt)(q)(D.frDatum.frAmount))(I.liftEffect(u.monadEffectContract)(T.throw("Can't receive funds while fundraising is in progress"))))((function(){return a.bind(u.bindContract)(_.getOwnCreds)((function(C){return a.discard(a.discardUnit)(u.bindContract)(o.when(u.applicativeContract)(w.notEq(v.eqPaymentPubKeyHash)(C.ownPkh)(D.frDatum.creatorPkh))(I.liftEffect(u.monadEffectContract)(T.throw("Only fundraising creator can receive funds"))))((function(){var o=m.Redeemer(f.toData(x.toDataPFundraisingRedeeme)(new x.PReceiveFunds(U,n))),v=l.singleton(U)(n)(b.fromInt(-1));return a.bind(u.bindContract)(M.mintingPolicy(D.frDatum.tokenOrigin))((function(m){return a.bind(u.bindContract)(P.mintingPolicy(N))((function(w){return a.bind(u.bindContract)(r.liftContractM("Can't create BigInt after round")(F.calcFee(D.frDatum.frFee)(q)))((function(r){var I=s.mintingPolicyHash(w),T=l.lovelaceValueOf(h.sub(b.ringBigInt)(l.valueOf(D.frValue)(c.adaSymbol)(g.adaToken))(r));return a.bind(u.bindContract)(B.getProtocolScriptInfo(N))((function(c){var s=A.append(y.semigroupTxConstraints)(y.mustSpendScriptOutputUsingScriptRef(S.fst(D.frUtxo))(o)(D.frRefScriptInput))(A.append(y.semigroupTxConstraints)(y.mustBeSignedBy(D.frDatum.creatorPkh))(A.append(y.semigroupTxConstraints)(y.mustMintValueWithRedeemer(f.toData(R.toDataPNftRedeemer)(new R.PBurnNft(n)))(v))(A.append(y.semigroupTxConstraints)(y.mustMintCurrencyWithRedeemerUsingScriptRef(I)(f.toData(k.toDataPVerTokenRedeemer)(new k.PBurnVerToken(e.verTokenName)))(e.verTokenName)(b.fromInt(-1))(c.references.verTokenInput))(A.append(y.semigroupTxConstraints)(y.mustPayToPubKeyAddress(C.ownPkh)(C.ownSkh)(T))(A.append(y.semigroupTxConstraints)(y.mustPayToPubKeyAddress(E.value0)(E.value1)(l.lovelaceValueOf(r)))(A.append(y.semigroupTxConstraints)(y.mustValidateIn(d.from(d.ordPOSIXTime)(i)))(A.append(y.semigroupTxConstraints)(y.mustReferenceOutput(S.fst(D.frScriptRef)))(y.mustReferenceOutput(S.fst(c.references.verTokenRef)))))))))),g=A.append(p.semigroupScriptLookups)(p.mintingPolicy(m))(p.unspentOutputs(D.frUtxos));return a.discard(a.discardUnit)(u.bindContract)(H.completeTx(g)(s)(C))((function(){return t["logInfo'"](u.monadLoggerContract)("Receive funds finished successfully")}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}}(O)(W))}}}}}}(c),function(e){"use strict";e["Governance.Datum"]=e["Governance.Datum"]||{};var n=e["Governance.Datum"],t=e["Ctl.Internal.FromData"],r=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.TypeLevel.Nat"],u=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],i=e["Ctl.Internal.Types.TokenName"],c={to:function(e){return e},from:function(e){return e}},l={toData:o.genericToData(c)(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"GovernanceDatum"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"GovernanceDatum"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(r.toDataCurrencySymbol)(o.toDataArgsRLHelperCons(i.toDataTokenName)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"quorum"}})({reflectSymbol:function(){return"GovernanceDatum"}})()()()()(a.knownNatZ))()()()({reflectSymbol:function(){return"govTokenName"}})({reflectSymbol:function(){return"GovernanceDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))()()()({reflectSymbol:function(){return"govCurrency"}})({reflectSymbol:function(){return"GovernanceDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatZ))))()()()({reflectSymbol:function(){return"fee"}})({reflectSymbol:function(){return"GovernanceDatum"}})()()()()(a.knownNatS(a.knownNatZ)))()()()({reflectSymbol:function(){return"duration"}})({reflectSymbol:function(){return"GovernanceDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"GovernanceDatum"}})(a.knownNatZ))(a.knownNatZ))},s={fromData:t.genericFromData(c)(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"GovernanceDatum"}})()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"GovernanceDatum"}})(a.knownNatZ))(t.fromDataArgsArgumentRecor(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(r.fromDataCurrencySymbol)(t.fromDataArgsRLCons(i.fromDataTokenName)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLNilRow)()()({reflectSymbol:function(){return"duration"}}))()()({reflectSymbol:function(){return"govTokenName"}}))()()({reflectSymbol:function(){return"govCurrency"}}))()()({reflectSymbol:function(){return"fee"}}))()()({reflectSymbol:function(){return"quorum"}}))()()())(a.knownNatZ))};n.toDataGovernanceDatum=l,n.fromDataGovernanceDatum=s}(c),function(e){let n;n=t(1001),e.governanceValidator=n}(c["Governance.GovernanceScript"]=c["Governance.GovernanceScript"]||{}),function(e){"use strict";e["Governance.GovernanceScript"]=e["Governance.GovernanceScript"]||{};var n=e["Governance.GovernanceScript"],t=e["Governance.GovernanceScript"],r=e["Contract.Monad"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Ctl.Internal.ApplyArgs"],c=e["Ctl.Internal.Cardano.TextEnvelope"],l=e["Ctl.Internal.Contract.Monad"],s=e["Ctl.Internal.Scripts"],f=e["Ctl.Internal.ToData"],d=e["Data.Array"],v=e["Data.Maybe"],m=e["Effect.Exception"],p=e["Ext.Contract.Value"],g=e["Protocol.Models"],y=function(e){return a.bind(l.bindContract)(u.liftMaybe(l.monadThrowErrorContract)(m.error("Error decoding governanceValidator"))(a.bind(v.bindMaybe)(c.decodeTextEnvelope(t.governanceValidator))((function(e){return c.plutusScriptV2FromEnvelope(e)}))))((function(n){return a.bind(l.bindContract)(r.liftContractE(i.showApplyArgsError)((t=n,function(e){var n=d.singleton(f.toData(g.toDataProtocol)(e));return i.applyArgs(t)(n)})(e)))((function(e){return o.pure(l.applicativeContract)(e)}));var t}))},b=r.liftContractM("Can't make governance thread token name")(p.mkTokenName("DonatPoolGovernance"));n.governanceValidatorScript=y,n.getGovernanceValidatorHash=function(e){return a.bind(l.bindContract)(y(e))((function(e){return o.pure(l.applicativeContract)(s.validatorHash(e))}))},n.governanceTokenName=b}(c),function(e){let n;n=t(8197),e.governancePolicy=n}(c["Shared.MintingPolicy.GovernancePolicyScript"]=c["Shared.MintingPolicy.GovernancePolicyScript"]||{}),function(e){"use strict";e["Shared.MintingPolicy.GovernancePolicyScript"]=e["Shared.MintingPolicy.GovernancePolicyScript"]||{};var n,t=e["Shared.MintingPolicy.GovernancePolicyScript"],r=e["Shared.MintingPolicy.GovernancePolicyScript"],o=e["Contract.Monad"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Ctl.Internal.ApplyArgs"],c=e["Ctl.Internal.Cardano.TextEnvelope"],l=e["Ctl.Internal.Contract.Monad"],s=e["Ctl.Internal.ToData"],f=e["Ctl.Internal.TypeLevel.Nat"],d=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],v=e["Ctl.Internal.Types.Scripts"],m=e["Ctl.Internal.Types.Transaction"],p=e["Data.Array"],g=e["Data.Functor"],y=e["Data.Generic.Rep"],b=e["Data.Maybe"],w=e["Effect.Exception"],C=e["Ext.Contract.Value"],h=function(){function e(){}return e.value=new e,e}(),A={to:function(e){return h.value},from:function(e){return y.NoArguments.value}},S={toData:s.genericToData(A)(s.toDataWithSchemaConstruct({reflectSymbol:function(){return"PMintGovernanceTokens"}})(s.toDataArgsNoArguments({reflectSymbol:function(){return"PMintGovernanceTokens"}}))()()(d.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PMintGovernanceTokens"}})(f.knownNatZ))(f.knownNatZ))},I=o.liftContractM("Cannot make token name")(C.mkTokenName("DonatPool_governance_testnet")),T=(n=g.map(l.functorContract)(v.PlutusMintingPolicy.create),function(e){return n((t=e,a.bind(l.bindContract)(u.liftMaybe(l.monadThrowErrorContract)(w.error("Error decoding nftPolicy"))(a.bind(b.bindMaybe)(c.decodeTextEnvelope(r.governancePolicy))((function(e){return c.plutusScriptV2FromEnvelope(e)}))))((function(e){return o.liftContractE(i.showApplyArgsError)((n=e,function(e){var t=p.singleton(s.toData(m.toDataTransactionInput)(e));return i.applyArgs(n)(t)})(t));var n}))));var t});t.governanceMintingPolicy=T,t.governanceTokenName=I,t.PMintGovernanceTokens=h,t.toDataGovernanceTokensRed=S}(c),function(e){"use strict";e["Governance.MintGovernanceTokens"]=e["Governance.MintGovernanceTokens"]||{};var n=e["Governance.MintGovernanceTokens"],t=e["Contract.Log"],r=e["Contract.Monad"],o=e["Control.Bind"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Plutus.Types.Value"],i=e["Ctl.Internal.Types.ScriptLookups"],c=e["Ctl.Internal.Types.TxConstraints"],l=e["Data.BigInt"],s=e["Data.Semigroup"],f=e["Data.Show"],d=e["Ext.Contract.Value"],v=e["Shared.MintingPolicy.GovernancePolicyScript"],m=e["Shared.OwnCredentials"],p=e["Shared.RunContract"],g=e["Shared.Tx"];n.runMintGovernanceTokens=function(e){return function(n){return function(y){return p.runContractWithResult(e)(n)(y)((b=l.fromInt(5e4),o.discard(o.discardUnit)(a.bindContract)(t["logInfo'"](a.monadLoggerContract)("Minting governance tokens"))((function(){return o.bind(a.bindContract)(m.getOwnCreds)((function(e){return o.bind(a.bindContract)(d.mkCurrencySymbol(v.governanceMintingPolicy(e.nonCollateralORef)))((function(n){return o.bind(a.bindContract)(v.governanceTokenName)((function(l){var m=u.singleton(n.value1)(l)(b),p=s.append(i.semigroupScriptLookups)(i.mintingPolicy(n.value0))(i.unspentOutputs(e.ownUtxos)),y=s.append(c.semigroupTxConstraints)(c.mustSpendPubKeyOutput(e.nonCollateralORef))(s.append(c.semigroupTxConstraints)(c.mustMintValueWithRedeemer(g.toRedeemer(v.toDataGovernanceTokensRed)(v.PMintGovernanceTokens.value))(m))(s.append(c.semigroupTxConstraints)(c.mustPayToPubKeyAddress(e.ownPkh)(e.ownSkh)(m))(c.mustBeSignedBy(e.ownPkh))));return o.discard(o.discardUnit)(a.bindContract)(g.completeTx(p)(y)(e))((function(){var e=d.currencySymbolToString(n.value1);return o.bind(a.bindContract)(r.liftContractM("Impossible to decode Protocol token name")(d.tokenNameToString(l)))((function(n){var r={governanceCurrency:e,governanceTokenName:n};return t["logInfo'"](a.monadLoggerContract)("Governance tokens minted successfully: "+f.show(f.showRecord()(f.showRecordFieldsCons({reflectSymbol:function(){return"governanceCurrency"}})(f.showRecordFieldsCons({reflectSymbol:function(){return"governanceTokenName"}})(f.showRecordFieldsNil)(f.showString))(f.showString)))(r))}))}))}))}))}))}))));var b}}}}(c),function(e){"use strict";e["Proposal.Model"]=e["Proposal.Model"]||{};var n=e["Proposal.Model"],t=e["Ctl.Internal.FromData"],r=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.TypeLevel.Nat"],u=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],i={toData:o.genericToData({to:function(e){return e},from:function(e){return e}})(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PProposal"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"PProposal"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(r.toDataCurrencySymbol)(o.toDataArgsRLHelperCons(r.toDataCurrencySymbol)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"verTokenCurrency"}})({reflectSymbol:function(){return"PProposal"}})()()()()(a.knownNatS(a.knownNatZ)))()()()({reflectSymbol:function(){return"protocolCurrency"}})({reflectSymbol:function(){return"PProposal"}})()()()()(a.knownNatZ)))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PProposal"}})(a.knownNatZ))(a.knownNatZ))},c={to:function(e){return e},from:function(e){return e}},l={toData:o.genericToData(c)(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PProposalParameters"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"PProposalParameters"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"protocolFee"}})({reflectSymbol:function(){return"PProposalParameters"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))()()()({reflectSymbol:function(){return"minDuration"}})({reflectSymbol:function(){return"PProposalParameters"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatZ))))()()()({reflectSymbol:function(){return"minAmount"}})({reflectSymbol:function(){return"PProposalParameters"}})()()()()(a.knownNatZ))()()()({reflectSymbol:function(){return"maxDuration"}})({reflectSymbol:function(){return"PProposalParameters"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))()()()({reflectSymbol:function(){return"maxAmount"}})({reflectSymbol:function(){return"PProposalParameters"}})()()()()(a.knownNatS(a.knownNatZ))))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PProposalParameters"}})(a.knownNatZ))(a.knownNatZ))},s={fromData:t.genericFromData(c)(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"PProposalParameters"}})()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PProposalParameters"}})(a.knownNatZ))(t.fromDataArgsArgumentRecor(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLNilRow)()()({reflectSymbol:function(){return"protocolFee"}}))()()({reflectSymbol:function(){return"maxDuration"}}))()()({reflectSymbol:function(){return"minDuration"}}))()()({reflectSymbol:function(){return"maxAmount"}}))()()({reflectSymbol:function(){return"minAmount"}}))()()())(a.knownNatZ))};n.mkProposal=function(e){return function(n){return{protocolCurrency:e.protocolCurrency,verTokenCurrency:n}}},n.toDataPProposal=i,n.toDataPProposalParameters=l,n.fromDataPProposalParamete=s}(c),function(e){"use strict";e["Governance.Redeemer"]=e["Governance.Redeemer"]||{};var n=e["Governance.Redeemer"],t=e["Ctl.Internal.Plutus.Types.Address"],r=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.TypeLevel.Nat"],u=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],i=e["Ctl.Internal.Types.Interval"],c=e["Data.Generic.Rep"],l=e["Proposal.Model"],s=function(){function e(e,n,t,r,o){this.value0=e,this.value1=n,this.value2=t,this.value3=r,this.value4=o}return e.create=function(n){return function(t){return function(r){return function(o){return function(a){return new e(n,t,r,o,a)}}}}},e}(),f={to:function(e){return new s(e.value0,e.value1.value0,e.value1.value1.value0,e.value1.value1.value1.value0,e.value1.value1.value1.value1)},from:function(e){return new c.Product(e.value0,new c.Product(e.value1,new c.Product(e.value2,new c.Product(e.value3,e.value4))))}},d={toData:o.genericToData(f)(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PCreateProposal"}})(o.toDataArgsProduct(o.toDataArgsArgument(l.toDataPProposalParameters)({reflectSymbol:function(){return"PCreateProposal"}}))(o.toDataArgsProduct(o.toDataArgsArgument(t.toDataAddress)({reflectSymbol:function(){return"PCreateProposal"}}))(o.toDataArgsProduct(o.toDataArgsArgument(r.toDataCurrencySymbol)({reflectSymbol:function(){return"PCreateProposal"}}))(o.toDataArgsProduct(o.toDataArgsArgument(r.toDataCurrencySymbol)({reflectSymbol:function(){return"PCreateProposal"}}))(o.toDataArgsArgument(i.toDataPOSIXTime)({reflectSymbol:function(){return"PCreateProposal"}}))))))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PCreateProposal"}})(a.knownNatZ))(a.knownNatZ))};n.PCreateProposal=s,n.toDataPGovernanceRedeemer=d}(c),function(e){"use strict";e["Info.UserData"]=e["Info.UserData"]||{};var n=e["Info.UserData"],t=e["Contract.Monad"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Contract.WaitUntilSlot"],i=e["Ctl.Internal.Plutus.Types.Value"],c=e["Ctl.Internal.Types.Interval"],l=e["Data.Array"],s=e["Data.BigInt"],f=e["Data.Ord"],d=e["Data.Ring"],v=e["Data.Show"],m=e["Data.TextDecoder"],p=e["Effect.Exception"],g=e["Ext.Contract.Value"],y=e["Ext.Data.Either"],b=e["Ext.Seriaization.Key"],w=e["Fundraising.Datum"],C=e["Fundraising.FundraisingScript"],h=e["Shared.MinAda"],A=e["Shared.Utxo"],S=v.showRecord()(v.showRecordFieldsCons({reflectSymbol:function(){return"creator"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"deadline"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"goal"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"isCompleted"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"raisedAmt"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"threadTokenCurrency"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"threadTokenName"}})(v.showRecordFieldsCons({reflectSymbol:function(){return"title"}})(v.showRecordFieldsNil)(v.showString))(v.showString))(v.showString))(s.showBigInt))(v.showBoolean))(s.showBigInt))(c.showPOSIXTime))(v.showString));n.mapToFundraisingInfo=function(e){return o.bind(a.bindContract)(t.liftContractM("Impossible to extract datum from UTxO")(A.extractDatumFromUTxO(w.fromDataPFundraisingDatum)(e)))((function(n){var l=A.extractValueFromUTxO(e),v=d.sub(s.ringBigInt)(d.sub(s.ringBigInt)(i["valueToCoin'"](l))(i["valueToCoin'"](h.minAdaValue)))(i["valueToCoin'"](h.minAdaValue));return o.bind(a.bindContract)(y.eitherContract(p.showError)("Title decoding failed: ")(m.decodeUtf8(n.frTitle)))((function(e){return o.bind(a.bindContract)(C.getFundraisingTokenName)((function(i){return o.bind(a.bindContract)(t.liftContractM("Impossible to get currency by token name")(g.getCurrencyByTokenName(l)(i)))((function(t){return o.bind(a.bindContract)(u.currentTime)((function(u){return o.bind(a.bindContract)(b.pkhToBech32M(n.creatorPkh))((function(o){return r.pure(a.applicativeContract)({creator:o,title:e,goal:n.frAmount,raisedAmt:v,deadline:n.frDeadline,threadTokenCurrency:g.currencySymbolToString(t),threadTokenName:C.fundraisingTokenNameString,isCompleted:f.greaterThan(c.ordPOSIXTime)(u)(n.frDeadline)||f.greaterThanOrEq(s.ordBigInt)(v)(n.frAmount)})}))}))}))}))}))}))},n.filterByPkh=function(e){return l.filter((function(n){return n.creator===e}))},n.showFundraisingInfo=S}(c),function(e){"use strict";e["Info.AllFundraisings"]=e["Info.AllFundraisings"]||{};var n=e["Info.AllFundraisings"],t=e["Contract.Address"],r=e["Contract.Log"],o=e["Contract.Monad"],a=e["Contract.Utxos"],u=e["Control.Applicative"],i=e["Control.Bind"],c=e["Ctl.Internal.Contract.Monad"],l=e["Ctl.Internal.Plutus.Types.Address"],s=e["Ctl.Internal.Serialization.Address"],f=e["Data.Map.Internal"],d=e["Data.Show"],v=e["Data.Traversable"],m=e["Data.Tuple"],p=e["Data.Unfoldable"],g=e["Ext.Contract.Value"],y=e["Fundraising.FundraisingScript"],b=e["Info.UserData"],w=e["MintingPolicy.VerTokenMinting"],C=e["Protocol.UserData"],h=e["Shared.RunContract"],A=e["Shared.Utxo"],S=function(e){return i.bind(c.bindContract)(C.dataToProtocol(e))((function(e){return i.bind(c.bindContract)(g.mkCurrencySymbol(w.mintingPolicy(e)))((function(n){return i.bind(c.bindContract)(w.verTokenName)((function(g){var w={protocol:e,verTokenCurrency:n.value1,verTokenName:g};return i.bind(c.bindContract)(y.getFundraisingValidatorHash(w))((function(e){return i.bind(c.bindContract)(o.liftContractM("Impossible to get Fundraising script address")(t.validatorHashBaseAddress(s.TestnetId.value)(e)))((function(e){return i.bind(c.bindContract)(a.utxosAt(l.plutusAddressAddress)(e))((function(e){return i.bind(c.bindContract)(v.traverse(v.traversableArray)(c.applicativeContract)(b.mapToFundraisingInfo)(A.filterByToken(new m.Tuple(n.value1,g))(f.toUnfoldable(p.unfoldableArray)(e))))((function(e){return i.discard(i.discardUnit)(c.bindContract)(r["logInfo'"](c.monadLoggerContract)("Found UTxOs"+d.show(d.showArray(b.showFundraisingInfo))(e)))((function(){return u.pure(c.applicativeContract)(e)}))}))}))}))}))}))}))}))};n.runGetAllFundraisings=function(e){return function(n){return function(t){return function(r){return h.runContractWithResult(e)(n)(r)(S(t))}}}},n.getAllFundraisings=S}(c),function(e){"use strict";e["Info.UserRelatedFundraisings"]=e["Info.UserRelatedFundraisings"]||{};var n=e["Info.UserRelatedFundraisings"],t=e["Contract.Address"],r=e["Contract.Log"],o=e["Contract.Monad"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.Contract.Monad"],c=e["Ctl.Internal.Types.PubKeyHash"],l=e["Data.Array"],s=e["Data.Show"],f=e["Ext.Seriaization.Key"],d=e["Info.AllFundraisings"],v=e["Info.UserData"],m=e["Shared.RunContract"];n.runGetUserRelatedFundraisings=function(e){return function(n){return function(p){return function(g){return m.runContractWithResult(e)(n)(g)(function(e){return u.bind(i.bindContract)(d.getAllFundraisings(e))((function(e){return u.bind(i.bindContract)(t.ownPaymentPubKeysHashes)((function(n){return u.bind(i.bindContract)(o.liftContractM("Impossible to get own PaymentPubkeyHash")(l.head(n)))((function(n){return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Own Payment pkh is: "+s.show(c.showPaymentPubKeyHash)(n)))((function(){return u.bind(i.bindContract)(f.pkhToBech32M(n))((function(n){var t=v.filterByPkh(n)(e);return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Discovered items: "+s.show(s.showArray(v.showFundraisingInfo))(t)))((function(){return a.pure(i.applicativeContract)(t)}))}))}))}))}))}))}(p))}}}}}(c),function(e){let n;n=t(1086),e.proposalPolicy=n}(c["MintingPolicy.ProposalMinting"]=c["MintingPolicy.ProposalMinting"]||{}),function(e){"use strict";e["MintingPolicy.ProposalMinting"]=e["MintingPolicy.ProposalMinting"]||{};var n,t=e["MintingPolicy.ProposalMinting"],r=e["MintingPolicy.ProposalMinting"],o=e["Contract.Monad"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Ctl.Internal.ApplyArgs"],c=e["Ctl.Internal.Cardano.TextEnvelope"],l=e["Ctl.Internal.Contract.Monad"],s=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],f=e["Ctl.Internal.ToData"],d=e["Ctl.Internal.TypeLevel.Nat"],v=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],m=e["Ctl.Internal.Types.Scripts"],p=e["Ctl.Internal.Types.TokenName"],g=e["Ctl.Internal.Types.Transaction"],y=e["Data.Array"],b=e["Data.Functor"],w=e["Data.Generic.Rep"],C=e["Data.Maybe"],h=e["Effect.Exception"],A=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),S=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),I=function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}(),T=function(){function e(e,n){this.value0=e,this.value1=n}return e.create=function(n){return function(t){return new e(n,t)}},e}(),D={to:function(e){if(e instanceof w.Inl)return new A(e.value0);if(e instanceof w.Inr&&e.value0 instanceof w.Inl)return new S(e.value0.value0);if(e instanceof w.Inr&&e.value0 instanceof w.Inr&&e.value0.value0 instanceof w.Inl)return new I(e.value0.value0.value0);if(e instanceof w.Inr&&e.value0 instanceof w.Inr&&e.value0.value0 instanceof w.Inr)return new T(e.value0.value0.value0.value0,e.value0.value0.value0.value1);throw new Error("Failed pattern match at MintingPolicy.ProposalMinting (line 52, column 1 - line 52, column 50): "+[e.constructor.name])},from:function(e){if(e instanceof A)return new w.Inl(e.value0);if(e instanceof S)return new w.Inr(new w.Inl(e.value0));if(e instanceof I)return new w.Inr(new w.Inr(new w.Inl(e.value0)));if(e instanceof T)return new w.Inr(new w.Inr(new w.Inr(new w.Product(e.value0,e.value1))));throw new Error("Failed pattern match at MintingPolicy.ProposalMinting (line 52, column 1 - line 52, column 50): "+[e.constructor.name])}},F={toData:f.genericToData(D)(f.toDataWithSchemaSum(f.toDataWithSchemaConstruct({reflectSymbol:function(){return"PMintThreadToken"}})(f.toDataArgsArgument(p.toDataTokenName)({reflectSymbol:function(){return"PMintThreadToken"}}))()()(v.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PMintThreadToken"}})(d.knownNatZ))(d.knownNatZ))(f.toDataWithSchemaSum(f.toDataWithSchemaConstruct({reflectSymbol:function(){return"PBurnThreadToken"}})(f.toDataArgsArgument(p.toDataTokenName)({reflectSymbol:function(){return"PBurnThreadToken"}}))()()(v.getIndexWithLabelConsI(v.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PBurnThreadToken"}})(d.knownNatS(d.knownNatZ)))()()({reflectSymbol:function(){return"PBurnThreadToken"}})(d.knownNatS(d.knownNatZ)))(d.knownNatS(d.knownNatZ)))(f.toDataWithSchemaSum(f.toDataWithSchemaConstruct({reflectSymbol:function(){return"PMintVoteToken"}})(f.toDataArgsArgument(s.toDataCurrencySymbol)({reflectSymbol:function(){return"PMintVoteToken"}}))()()(v.getIndexWithLabelConsI(v.getIndexWithLabelConsI(v.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PMintVoteToken"}})(d.knownNatS(d.knownNatS(d.knownNatZ))))()()({reflectSymbol:function(){return"PMintVoteToken"}})(d.knownNatS(d.knownNatS(d.knownNatZ))))()()({reflectSymbol:function(){return"PMintVoteToken"}})(d.knownNatS(d.knownNatS(d.knownNatZ))))(d.knownNatS(d.knownNatS(d.knownNatZ))))(f.toDataWithSchemaConstruct({reflectSymbol:function(){return"PBurnVoteToken"}})(f.toDataArgsProduct(f.toDataArgsArgument(p.toDataTokenName)({reflectSymbol:function(){return"PBurnVoteToken"}}))(f.toDataArgsArgument(s.toDataCurrencySymbol)({reflectSymbol:function(){return"PBurnVoteToken"}})))()()(v.getIndexWithLabelConsI(v.getIndexWithLabelConsI(v.getIndexWithLabelConsI(v.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PBurnVoteToken"}})(d.knownNatS(d.knownNatS(d.knownNatS(d.knownNatZ)))))()()({reflectSymbol:function(){return"PBurnVoteToken"}})(d.knownNatS(d.knownNatS(d.knownNatS(d.knownNatZ)))))()()({reflectSymbol:function(){return"PBurnVoteToken"}})(d.knownNatS(d.knownNatS(d.knownNatS(d.knownNatZ)))))()()({reflectSymbol:function(){return"PBurnVoteToken"}})(d.knownNatS(d.knownNatS(d.knownNatS(d.knownNatZ)))))(d.knownNatS(d.knownNatS(d.knownNatS(d.knownNatZ))))))))},E=(n=b.map(l.functorContract)(m.PlutusMintingPolicy.create),function(e){return n((t=e,a.bind(l.bindContract)(u.liftMaybe(l.monadThrowErrorContract)(h.error("Error decoding nftPolicy"))(a.bind(C.bindMaybe)(c.decodeTextEnvelope(r.proposalPolicy))((function(e){return c.plutusScriptV2FromEnvelope(e)}))))((function(e){return o.liftContractE(i.showApplyArgsError)((n=e,function(e){var t=y.singleton(f.toData(g.toDataTransactionInput)(e));return i.applyArgs(n)(t)})(t));var n}))));var t});t.proposalMintingPolicy=E,t.PMintThreadToken=A,t.PMintVoteToken=I,t.toDataPProposalPolicyRede=F}(c),function(e){"use strict";e["Proposal.Datum"]=e["Proposal.Datum"]||{};var n=e["Proposal.Datum"],t=e["Ctl.Internal.FromData"],r=e["Ctl.Internal.Plutus.Types.Address"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.TypeLevel.Nat"],u=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],i=e["Ctl.Internal.Types.Interval"],c=e["Ctl.Internal.Types.Transaction"],l=e["Proposal.Model"],s={to:function(e){return e},from:function(e){return e}},f={toData:o.genericToData(s)(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PProposalDatum"}})(o.toDataArgsArgumentRecord(o.toDataArgsRecord({reflectSymbol:function(){return"PProposalDatum"}})(o.toDataArgsRL(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(i.toDataPOSIXTime)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperCons(r.toDataAddress)(o.toDataArgsRLHelperCons(c.toDataTransactionInput)(o.toDataArgsRLHelperCons(l.toDataPProposalParameters)(o.toDataArgsRLHelperCons(o.toDataBigInt)(o.toDataArgsRLHelperNilRow)()()()({reflectSymbol:function(){return"quorum"}})({reflectSymbol:function(){return"PProposalDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))()()()({reflectSymbol:function(){return"proposal"}})({reflectSymbol:function(){return"PProposalDatum"}})()()()()(a.knownNatZ))()()()({reflectSymbol:function(){return"policyRef"}})({reflectSymbol:function(){return"PProposalDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))()()()({reflectSymbol:function(){return"initiator"}})({reflectSymbol:function(){return"PProposalDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))))()()()({reflectSymbol:function(){return"for"}})({reflectSymbol:function(){return"PProposalDatum"}})()()()()(a.knownNatS(a.knownNatZ)))()()()({reflectSymbol:function(){return"deadline"}})({reflectSymbol:function(){return"PProposalDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ))))))))()()()({reflectSymbol:function(){return"applied"}})({reflectSymbol:function(){return"PProposalDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatS(a.knownNatZ)))))))))()()()({reflectSymbol:function(){return"against"}})({reflectSymbol:function(){return"PProposalDatum"}})()()()()(a.knownNatS(a.knownNatS(a.knownNatZ)))))()))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PProposalDatum"}})(a.knownNatZ))(a.knownNatZ))},d={fromData:t.genericFromData(s)(t.fromDataWithSchemaConstru({reflectSymbol:function(){return"PProposalDatum"}})()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PProposalDatum"}})(a.knownNatZ))(t.fromDataArgsArgumentRecor(t.fromDataArgsRLCons(l.fromDataPProposalParamete)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(c.fromDataTransactionInput)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLCons(r.fromDataAddress)(t.fromDataArgsRLCons(i.fromDataPOSIXTime)(t.fromDataArgsRLCons(t.fromDataBigInt)(t.fromDataArgsRLNilRow)()()({reflectSymbol:function(){return"applied"}}))()()({reflectSymbol:function(){return"deadline"}}))()()({reflectSymbol:function(){return"initiator"}}))()()({reflectSymbol:function(){return"quorum"}}))()()({reflectSymbol:function(){return"policyRef"}}))()()({reflectSymbol:function(){return"against"}}))()()({reflectSymbol:function(){return"for"}}))()()({reflectSymbol:function(){return"proposal"}}))()()())(a.knownNatZ))};n.toDataPProposalDatum=f,n.fromDataPProposalDatum=d}(c),function(e){let n;n=t(1552),e.proposalValidator=n}(c["Proposal.ProposalScript"]=c["Proposal.ProposalScript"]||{}),function(e){"use strict";e["Proposal.ProposalScript"]=e["Proposal.ProposalScript"]||{};var n=e["Proposal.ProposalScript"],t=e["Proposal.ProposalScript"],r=e["Contract.Monad"],o=e["Control.Applicative"],a=e["Control.Bind"],u=e["Control.Monad.Error.Class"],i=e["Ctl.Internal.ApplyArgs"],c=e["Ctl.Internal.Cardano.TextEnvelope"],l=e["Ctl.Internal.Contract.Monad"],s=e["Ctl.Internal.Scripts"],f=e["Ctl.Internal.ToData"],d=e["Data.Array"],v=e["Data.Maybe"],m=e["Effect.Exception"],p=e["Ext.Contract.Value"],g=e["Proposal.Model"],y=p.runMkTokenName("ProposalVerified"),b=p.runMkTokenName("ProposalId"),w=function(e){return a.bind(l.bindContract)(u.liftMaybe(l.monadThrowErrorContract)(m.error("Error decoding proposalValidator"))(a.bind(v.bindMaybe)(c.decodeTextEnvelope(t.proposalValidator))((function(e){return c.plutusScriptV2FromEnvelope(e)}))))((function(n){return a.bind(l.bindContract)(r.liftContractE(i.showApplyArgsError)((t=n,function(e){var n=d.singleton(f.toData(g.toDataPProposal)(e));return i.applyArgs(t)(n)})(e)))((function(e){return o.pure(l.applicativeContract)(e)}));var t}))};n.proposalValidatorScript=w,n.getProposalValidatorHash=function(e){return a.bind(l.bindContract)(w(e))((function(e){return o.pure(l.applicativeContract)(s.validatorHash(e))}))},n.proposalTokenName=b,n.proposalVerTokenName=y}(c),function(e){"use strict";e["Shared.ScriptInfo"]=e["Shared.ScriptInfo"]||{};var n=e["Shared.ScriptInfo"],t=e["Contract.Address"],r=e["Contract.Monad"],o=e["Contract.Utxos"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.Cardano.Types.ScriptRef"],c=e["Ctl.Internal.Contract.Monad"],l=e["Ctl.Internal.Plutus.Types.Address"],s=e["Ctl.Internal.Plutus.Types.TransactionUnspentOutput"],f=e["Ctl.Internal.Types.TxConstraints"],d=e["Data.Newtype"],v=e["Data.Tuple"],m=e["Governance.Datum"],p=e["Governance.GovernanceScript"],g=e["Proposal.Datum"],y=e["Proposal.ProposalScript"],b=e["Shared.Utxo"],w=function(e){return function(n){return function(m){return function(p){return u.bind(c.bindContract)(t.getNetworkId)((function(g){return u.bind(c.bindContract)(n.getThreadTokenName)((function(y){return u.bind(c.bindContract)(n.getValidator)((function(w){return u.bind(c.bindContract)(n.getValidatoHash)((function(n){return u.bind(c.bindContract)(r.liftContractM("Impossible to get "+p+" script address")(t.validatorHashBaseAddress(g)(n)))((function(t){return u.bind(c.bindContract)(o.utxosAt(l.plutusAddressAddress)(t))((function(o){return u.bind(c.bindContract)(b.getUtxoByNFT(p)(new v.Tuple(m,y))(o))((function(l){return u.bind(c.bindContract)(r.liftContractM("Impossible to get "+p+" Datum")(b.extractDatumFromUTxO(e)(l)))((function(e){var r=b.extractValueFromUTxO(l),m=new i.PlutusScriptRef(d.unwrap()(w));return u.bind(c.bindContract)(b.getUtxoByScriptRef(p)(m)(o))((function(u){var i=new f.RefInput(s.mkTxUnspentOut(v.fst(u))(v.snd(u)));return a.pure(c.applicativeContract)({tokenName:y,validator:w,validatorHash:n,address:t,utxos:o,utxo:l,datum:e,value:r,refScriptUtxo:u,refScriptInput:i})}))}))}))}))}))}))}))}))}))}}}};n.getGovernanceScriptInfo=function(e){var n={getThreadTokenName:p.governanceTokenName,getValidator:p.governanceValidatorScript(e),getValidatoHash:p.getGovernanceValidatorHash(e)};return w(m.fromDataGovernanceDatum)(n)(d.unwrap()(e).protocolCurrency)("Governance")},n.getProposalScriptInfo=function(e){return function(n){var t={getThreadTokenName:y.proposalTokenName,getValidator:y.proposalValidatorScript(e),getValidatoHash:y.getProposalValidatorHash(e)};return w(g.fromDataPProposalDatum)(t)(n)("Proposal")}}}(c),function(e){"use strict";e["Shared.Tokens"]=e["Shared.Tokens"]||{};var n=e["Shared.Tokens"],t=e["Contract.Log"],r=e["Control.Applicative"],o=e["Control.Bind"],a=e["Ctl.Internal.Contract.Monad"],u=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],i=e["Ctl.Internal.Types.TokenName"],c=e["Data.Newtype"],l=e["Data.Show"],s=e["Data.Tuple"],f=e["Ext.Contract.Value"],d=e["MintingPolicy.ProposalMinting"],v=e["MintingPolicy.VerTokenMinting"],m=e["Proposal.ProposalScript"],p={proposalThread:m.proposalTokenName,proposalVer:m.proposalVerTokenName},g=function(e){return function(n){return function(c){return function(d){return o.bind(a.bindContract)(f.mkCurrencySymbol(e))((function(e){return o.bind(a.bindContract)(c)((function(c){return o.discard(o.discardUnit)(a.bindContract)(t["logInfo'"](a.monadLoggerContract)(d+" "+n+" currency: "+l.show(u.showCurrencySymbol)(e.value1)+", token name: "+l.show(i.showTokenName)(c)))((function(){return r.pure(a.applicativeContract)(new s.Tuple(e.value0,new s.Tuple(e.value1,c)))}))}))}))}}}};n.createProposalThreadToken=function(e){return g(d.proposalMintingPolicy(e))("Thread")(c.unwrap()(p).proposalThread)("Proposal")},n.createProposalVerToken=function(e){return("Proposal",function(e){return function(n){return g(v.mintingPolicy(e))("Verification")(n)("Proposal")}})(e)(c.unwrap()(p).proposalVer)},n.createProposalVoteToken=function(e){return function(n){return g(d.proposalMintingPolicy(e))("Vote")(r.pure(a.applicativeContract)(n))("Proposal")}}}(c),function(e){"use strict";e["Proposal.Create"]=e["Proposal.Create"]||{};var n=e["Proposal.Create"],t=e["Contract.Address"],r=e["Contract.Log"],o=e["Contract.Monad"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.Contract.Monad"],c=e["Ctl.Internal.Contract.WaitUntilSlot"],l=e["Ctl.Internal.Plutus.Types.Credential"],s=e["Ctl.Internal.Plutus.Types.TransactionUnspentOutput"],f=e["Ctl.Internal.Plutus.Types.Value"],d=e["Ctl.Internal.Scripts"],v=e["Ctl.Internal.Types.Datum"],m=e["Ctl.Internal.Types.ScriptLookups"],p=e["Ctl.Internal.Types.TxConstraints"],g=e["Data.BigInt"],y=e["Data.Newtype"],b=e["Data.Semigroup"],w=e["Data.Semiring"],C=e["Data.Show"],h=e["Data.Tuple"],A=e["Effect.Class"],S=e["Effect.Exception"],I=e["Ext.Contract.Time"],T=e["Ext.Contract.Value"],D=e["Ext.Data.BigInt"],F=e["Governance.Datum"],E=e["Governance.Redeemer"],x=e["MintingPolicy.ProposalMinting"],M=e["MintingPolicy.VerTokenRedeemers"],R=e["Proposal.Datum"],P=e["Proposal.Model"],k=e["Proposal.ProposalScript"],B=e["Protocol.ProtocolScriptInfo"],N=e["Protocol.UserData"],L=e["Shared.Duration"],_=e["Shared.MinAda"],U=e["Shared.OwnCredentials"],H=e["Shared.RunContract"],q=e["Shared.ScriptInfo"],O=e["Shared.Tokens"],V=e["Shared.Tx"];n.runCreateProposal=function(e){return function(n){return function(W){return function(K){return function(z){return H.runContractWithResult(e)(n)(z)(function(e){return function(n){return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Running CreateProposal endpoint"))((function(){return u.bind(i.bindContract)(N.dataToProtocol(e))((function(e){return u.bind(i.bindContract)(U.getOwnCreds)((function(N){return u.bind(i.bindContract)(B.getProtocolScriptInfo(e))((function(B){return u.bind(i.bindContract)(q.getGovernanceScriptInfo(e))((function(U){return u.bind(i.bindContract)(t.getNetworkId)((function(H){return u.bind(i.bindContract)(O.createProposalThreadToken(N.nonCollateralORef))((function(q){return u.bind(i.bindContract)(O.createProposalVerToken(e))((function(O){var W=d.mintingPolicyHash(O.value0),K=P.mkProposal(e)(O.value1.value0);return u.bind(i.bindContract)(k.getProposalValidatorHash(K))((function(e){return u.bind(i.bindContract)(o.liftContractM("Impossible to get Proposal script address")(t.validatorHashBaseAddress(H)(e)))((function(o){var d=new p.RefInput(s.mkTxUnspentOut(h.fst(U.refScriptUtxo))(h.snd(U.refScriptUtxo)));return u.discard(u.discardUnit)(i.bindContract)(function(e){return function(n){return a.when(i.applicativeContract)(D.eqBigInt(e.minAmount)(n.minAmount)&&D.eqBigInt(e.maxAmount)(n.maxAmount)&&D.eqBigInt(e.minDuration)(n.minDuration)&&D.eqBigInt(e.maxDuration)(n.maxDuration)&&D.eqBigInt(e.protocolFee)(n.protocolFee))(A.liftEffect(i.monadEffectContract)(S.throw("Proposed values are already in protocol config")))}}(n)(B.pDatum))((function(){return u.bind(i.bindContract)(c.currentTime)((function(c){var s=I.addTimes(c)(L.minutesToPosixTime(U.datum.duration)),A=f.singleton(O.value1.value0)(O.value1.value1)(w.one(g.semiringBigInt)),S=f.singleton(q.value1.value0)(q.value1.value1)(w.one(g.semiringBigInt)),D=V.toDatum(R.toDataPProposalDatum)({proposal:n,for:g.fromInt(0),against:g.fromInt(0),policyRef:N.nonCollateralORef,quorum:U.datum.quorum,initiator:y.unwrap()(N.ownAddressWithNetworkTag).address,deadline:s,applied:g.fromInt(0)}),P=f.lovelaceValueOf(U.datum.fee),k=b.append(f.semigroupValue)(_.minAdaValue)(b.append(f.semigroupValue)(S)(b.append(f.semigroupValue)(A)(P))),H=V.toRedeemer(E.toDataPGovernanceRedeemer)(new E.PCreateProposal(n,o,q.value1.value0,O.value1.value0,c)),K=b.append(m.semigroupScriptLookups)(m.mintingPolicy(q.value0))(b.append(m.semigroupScriptLookups)(m.unspentOutputs(N.ownUtxos))(b.append(m.semigroupScriptLookups)(m.unspentOutputs(U.utxos))(m.unspentOutputs(B.pUtxos)))),z=b.append(p.semigroupTxConstraints)(p.mustSpendPubKeyOutput(N.nonCollateralORef))(b.append(p.semigroupTxConstraints)(p.mustMintValueWithRedeemer(V.toRedeemer(x.toDataPProposalPolicyRede)(new x.PMintThreadToken(q.value1.value1)))(S))(b.append(p.semigroupTxConstraints)(p.mustMintCurrencyWithRedeemerUsingScriptRef(W)(V.toRedeemer(M.toDataPVerTokenRedeemer)(new M.PMintProposalVerToken(O.value1.value1)))(O.value1.value1)(w.one(g.semiringBigInt))(B.references.verTokenInput))(b.append(p.semigroupTxConstraints)(p.mustSpendScriptOutputUsingScriptRef(h.fst(U.utxo))(H)(d))(b.append(p.semigroupTxConstraints)(p.mustPayToScriptAddress(U.validatorHash)(new l.ScriptCredential(U.validatorHash))(V.toDatum(F.toDataGovernanceDatum)(U.datum))(p.DatumInline.value)(U.value))(b.append(p.semigroupTxConstraints)(p.mustPayToScriptAddress(e)(new l.ScriptCredential(e))(V.toDatum(v.toDataDatum)(D))(p.DatumInline.value)(k))(b.append(p.semigroupTxConstraints)(p.mustBeSignedBy(N.ownPkh))(b.append(p.semigroupTxConstraints)(p.mustReferenceOutput(h.fst(B.pUtxo)))(p.mustReferenceOutput(h.fst(B.references.verTokenRef))))))))));return u.discard(u.discardUnit)(i.bindContract)(V.completeTx(K)(z)(N))((function(){return u.bind(i.bindContract)(t.addressToBech32(o))((function(e){return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Current proposal address: "+C.show(C.showString)(e)))((function(){var e={threadCurrency:T.currencySymbolToString(q.value1.value0),proposalData:n,for:g.fromInt(0),against:g.fromInt(0)};return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Proposal created successfully"))((function(){return a.pure(i.applicativeContract)(e)}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}}(W)(K))}}}}}}(c),function(e){"use strict";e["Proposal.Redeemer"]=e["Proposal.Redeemer"]||{};var n=e["Proposal.Redeemer"],t=e["Ctl.Internal.Plutus.Types.Address"],r=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],o=e["Ctl.Internal.ToData"],a=e["Ctl.Internal.TypeLevel.Nat"],u=e["Ctl.Internal.TypeLevel.RowList.Unordered.Indexed"],i=e["Data.Generic.Rep"],c=function(){function e(e,n,t,r){this.value0=e,this.value1=n,this.value2=t,this.value3=r}return e.create=function(n){return function(t){return function(r){return function(o){return new e(n,t,r,o)}}}},e}(),l={to:function(e){return new c(e.value0,e.value1.value0,e.value1.value1.value0,e.value1.value1.value1)},from:function(e){return new i.Product(e.value0,new i.Product(e.value1,new i.Product(e.value2,e.value3)))}},s={toData:o.genericToData(l)(o.toDataWithSchemaConstruct({reflectSymbol:function(){return"PVote"}})(o.toDataArgsProduct(o.toDataArgsArgument(o.toDataBigInt)({reflectSymbol:function(){return"PVote"}}))(o.toDataArgsProduct(o.toDataArgsArgument(o.toDataBigInt)({reflectSymbol:function(){return"PVote"}}))(o.toDataArgsProduct(o.toDataArgsArgument(t.toDataAddress)({reflectSymbol:function(){return"PVote"}}))(o.toDataArgsArgument(r.toDataCurrencySymbol)({reflectSymbol:function(){return"PVote"}})))))()()(u.getIndexWithLabelConsI1()()({reflectSymbol:function(){return"PVote"}})(a.knownNatZ))(a.knownNatZ))};n.PVote=c,n.toDataPProposalRedeemer=s}(c),function(e){"use strict";e["Proposal.VoteTokenName"]=e["Proposal.VoteTokenName"]||{};var n=e["Proposal.VoteTokenName"],t=e["Data.BigInt"],r=e["Ext.Contract.Value"];n.mkVoteTokenName=function(e){return function(n){return r.mkTokenName("D"+t.toString(e)+"."+t.toString(n))}}}(c),function(e){"use strict";e["Shared.ScriptRef"]=e["Shared.ScriptRef"]||{};var n=e["Shared.ScriptRef"],t=e["Contract.Monad"],r=e["Ctl.Internal.Cardano.Types.ScriptRef"],o=e["Data.Array"],a=e["Data.Eq"],u=e["Data.Map.Internal"],i=e["Data.Maybe"],c=e["Data.Newtype"],l=e["Data.Unfoldable"];n.getUtxoWithRefScript=function(e){return function(n){return t.liftContractM("UTxO with expected reference script not found")(function(e){return function(n){var t=u.toUnfoldable(l.unfoldableArray)(n);return o.find(function(e){return function(n){return a.eq(i.eqMaybe(r.eqScriptRef))(c.unwrap()(n.value1).scriptRef)(new i.Just(new r.PlutusScriptRef(e)))}}(e))(t)}}(e)(n))}}}(c),function(e){"use strict";e["Proposal.Vote"]=e["Proposal.Vote"]||{};var n=e["Proposal.Vote"],t=e["Contract.Address"],r=e["Contract.Log"],o=e["Contract.Monad"],a=e["Control.Applicative"],u=e["Control.Bind"],i=e["Ctl.Internal.Contract.Monad"],c=e["Ctl.Internal.Contract.WaitUntilSlot"],l=e["Ctl.Internal.Plutus.Types.Credential"],s=e["Ctl.Internal.Plutus.Types.CurrencySymbol"],f=e["Ctl.Internal.Plutus.Types.TransactionUnspentOutput"],d=e["Ctl.Internal.Plutus.Types.Value"],v=e["Ctl.Internal.Types.Interval"],m=e["Ctl.Internal.Types.ScriptLookups"],p=e["Ctl.Internal.Types.TxConstraints"],g=e["Data.BigInt"],y=e["Data.Eq"],b=e["Data.Newtype"],w=e["Data.Ord"],C=e["Data.Semigroup"],h=e["Data.Semiring"],A=e["Data.Show"],S=e["Data.Tuple"],I=e["Effect.Class"],T=e["Effect.Exception"],D=e["Ext.Contract.Value"],F=e["Ext.Serialization.Token"],E=e["MintingPolicy.ProposalMinting"],x=e["MintingPolicy.VerTokenMinting"],M=e["Proposal.Datum"],R=e["Proposal.Model"],P=e["Proposal.ProposalScript"],k=e["Proposal.Redeemer"],B=e["Proposal.VoteTokenName"],N=e["Protocol.UserData"],L=e["Shared.MinAda"],_=e["Shared.OwnCredentials"],U=e["Shared.RunContract"],H=e["Shared.ScriptInfo"],q=e["Shared.ScriptRef"],O=e["Shared.Tokens"],V=e["Shared.Tx"],W=e["Shared.Utxo"];n.runVote=function(e){return function(n){return function(K){return function(z){return function(J){return U.runContractWithResult(e)(n)(J)(function(e){return function(n){return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Running vote endpoint"))((function(){return u.bind(i.bindContract)(N.dataToProtocol(e))((function(e){return u.bind(i.bindContract)(_.getOwnCreds)((function(N){return u.bind(i.bindContract)(t.getNetworkId)((function(_){return u.bind(i.bindContract)(H.getGovernanceScriptInfo(e))((function(U){var K=d.valueOf(N.ownValue)(U.datum.govCurrency)(U.datum.govTokenName);return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("govTokensInWallet: "+A.show(g.showBigInt)(K)))((function(){return u.discard(u.discardUnit)(i.bindContract)(a.when(i.applicativeContract)(w.lessThan(g.ordBigInt)(K)(n.amount))(I.liftEffect(i.monadEffectContract)(T.throw("Wallet doesn't have enough governance tokens"))))((function(){return u.bind(i.bindContract)(F.deserializeCurrency(n.proposalThreadCurrency))((function(F){return u.bind(i.bindContract)(P.proposalVerTokenName)((function(K){return u.bind(i.bindContract)(D.mkCurrencySymbol(x.mintingPolicy(e)))((function(D){var x=R.mkProposal(e)(D.value1);return u.bind(i.bindContract)(P.getProposalValidatorHash(x))((function(e){return u.bind(i.bindContract)(o.liftContractM("Impossible to get Proposal script address")(t.validatorHashBaseAddress(_)(e)))((function(e){return u.bind(i.bindContract)(H.getProposalScriptInfo(x)(F))((function(R){return u.discard(u.discardUnit)(i.bindContract)(a.unless(i.applicativeContract)(W.checkTokenInUTxO(new S.Tuple(D.value1,K))(R.utxo))(I.liftEffect(i.monadEffectContract)(T.throw("VerificationToken not found in Proposal"))))((function(){var _=b.unwrap()(R.datum);return u.discard(u.discardUnit)(i.bindContract)(a.when(i.applicativeContract)(y.eq(g.eqBigInt)(_.applied)(g.fromInt(1)))(I.liftEffect(i.monadEffectContract)(T.throw("Can't vote for the applied proposal"))))((function(){return u.bind(i.bindContract)(c.currentTime)((function(c){return u.discard(u.discardUnit)(i.bindContract)(a.when(i.applicativeContract)(w.greaterThan(v.ordPOSIXTime)(c)(_.deadline))(I.liftEffect(i.monadEffectContract)(T.throw("Voting time is over"))))((function(){var w=v.from(v.ordPOSIXTime)(c),H=V.toDatum(M.toDataPProposalDatum)({proposal:_.proposal,for:n.for?h.add(g.semiringBigInt)(_.for)(n.amount):_.for,against:n.for?_.against:h.add(g.semiringBigInt)(_.against)(n.amount),policyRef:_.policyRef,quorum:_.quorum,initiator:_.initiator,deadline:_.deadline,applied:_.applied}),W=n.for?g.fromInt(1):g.fromInt(0),K=b.unwrap()(N.ownAddressWithNetworkTag).address,z=V.toRedeemer(k.toDataPProposalRedeemer)(new k.PVote(W,n.amount,K,F));return u.bind(i.bindContract)(o.liftContractM("Impossible to make Vote token name")(B.mkVoteTokenName(W)(n.amount)))((function(o){return u.bind(i.bindContract)(O.createProposalVoteToken(_.policyRef)(o))((function(o){return u.discard(u.discardUnit)(i.bindContract)(a.when(i.applicativeContract)(y.notEq(s.eqCurrencySymbol)(o.value1.value0)(F))(I.liftEffect(i.monadEffectContract)(T.throw("Unexpected vote token currency"))))((function(){var a=V.toRedeemer(E.toDataPProposalPolicyRede)(new E.PMintVoteToken(D.value1)),c=d.singleton(U.datum.govCurrency)(U.datum.govTokenName)(n.amount),s=C.append(d.semigroupValue)(R.value)(C.append(d.semigroupValue)(L.minAdaValue)(c)),v=d.singleton(o.value1.value0)(o.value1.value1)(h.one(g.semiringBigInt)),y=C.append(d.semigroupValue)(L.minAdaValue)(v);return u.bind(i.bindContract)(P.proposalValidatorScript(x))((function(n){return u.bind(i.bindContract)(q.getUtxoWithRefScript(b.unwrap()(n))(R.utxos))((function(n){var c=new p.RefInput(f.mkTxUnspentOut(S.fst(n))(S.snd(n))),d=C.append(m.semigroupScriptLookups)(m.mintingPolicy(o.value0))(C.append(m.semigroupScriptLookups)(m.unspentOutputs(N.ownUtxos))(C.append(m.semigroupScriptLookups)(m.unspentOutputs(R.utxos))(m.unspentOutputs(U.utxos)))),g=C.append(p.semigroupTxConstraints)(p.mustSpendPubKeyOutput(N.nonCollateralORef))(C.append(p.semigroupTxConstraints)(p.mustMintValueWithRedeemer(a)(v))(C.append(p.semigroupTxConstraints)(p.mustSpendScriptOutputUsingScriptRef(S.fst(R.utxo))(z)(c))(C.append(p.semigroupTxConstraints)(p.mustPayToScriptAddress(R.validatorHash)(new l.ScriptCredential(R.validatorHash))(H)(p.DatumInline.value)(s))(C.append(p.semigroupTxConstraints)(p.mustPayToPubKeyAddress(N.ownPkh)(N.ownSkh)(y))(C.append(p.semigroupTxConstraints)(p.mustBeSignedBy(N.ownPkh))(C.append(p.semigroupTxConstraints)(p.mustValidateIn(w))(C.append(p.semigroupTxConstraints)(p.mustReferenceOutput(S.fst(n)))(p.mustReferenceOutput(S.fst(U.utxo))))))))));return u.discard(u.discardUnit)(i.bindContract)(V.completeTx(d)(g)(N))((function(){return u.bind(i.bindContract)(t.addressToBech32(e))((function(e){return u.discard(u.discardUnit)(i.bindContract)(r["logInfo'"](i.monadLoggerContract)("Current proposal address: "+A.show(A.showString)(e)))((function(){return r["logInfo'"](i.monadLoggerContract)("Added vote successfully")}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}))}}(K)(z))}}}}}}(c),function(e){"use strict";e["Scaffold.Main"]=e["Scaffold.Main"]||{};var n=e["Scaffold.Main"],t=e["Fundraising.Create"],r=e["Fundraising.Donate"],o=e["Fundraising.ReceiveFunds"],a=e["Governance.MintGovernanceTokens"],u=e["Info.AllFundraisings"],i=e["Info.AppInfo"],c=e["Info.UserRelatedFundraisings"],l=e["Proposal.Create"],s=e["Proposal.Vote"],f=new(function(){function e(e){this.value0=e}return e.create=function(n){return new e(n)},e}())({getAppInfo:i.runGetAppInfo,createFundraising:t.runCreateFundraising,donate:r.runDonate,receiveFunds:o.runReceiveFunds,getAllFundraisings:u.runGetAllFundraisings,getUserRelatedFundraisings:c.runGetUserRelatedFundraisings,mintGovernanceTokens:a.runMintGovernanceTokens,createProposal:l.runCreateProposal,vote:s.runVote});n.main=f}(c),e.exports=c["Scaffold.Main"]},2244:e=>{function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=()=>[],n.resolve=n,n.id=2244,e.exports=n},1761:e=>{"use strict";e.exports='{\n "cborHex": "59145b591458010000323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232322222323232323232323232323232323232323232323232533305f3370e90010010991919299983119b8733303600e375c60d401e6eb8c1a8c1a003d2002153330623370e66606c01c6eb8c1a8010dd71835183400224004264a6660c80022a6660c666e1cccc0dcdd598359823982d8069bae306b010375c60d660d2020606890010a99983199b87333037375660d6608e60b601a6eb8c1ac014dd718359834802981a240042a6660c66603c6ea4dd718358061bac306b301f305b00d1323253330653370e00200a2a6660ca66e24dd698368068030a4c2646464a6660d06607e0040022930a998388128b182118378071bad3045001306d3046305d00f153306e023163053375660d860d460b80026604403460d660d20122a660d80482c2a660d804a2c2a660d804c2c2a6660c666e1cccc0dcdd598359823982d8069bae306b010375c60d660d2020606890010a99983199b87333037375660d6608e60b601a6eb8c1ac014dd718359834802981a240042a6660c66603c6ea4dd718358061bac306b301f305b00d1323253330653370e00200a2a6660ca66e24dd698368068030a4c2646464a6660d06607e0040022930a998388128b182118378071bad3045001306d3046305d00f153306e023163053375660d860d460b80026604403460d660d20122a660d80482c2a660d804a2c2a660d804c2c60960322a660d69201033431300016153306b491033430390016323303e3374a90011982700083099ba548010184c1a4020cc88cc098c8c00488c8c8cdc0001299983399b873370c0069002240042a6660ce66e20cdc1801a4008002290010a40002a6660ce66e1ccdc1801a4008002266e180092004153330673371000266e0c00d2004148000520023370c00600466e0c008004cc88c00888c00c88c8c8c00488c8c8c8c88cc00400c008cdc100119b830040033370400266e0c0100094ccc1b4cdc380124000290000a99983699b890024800052001148008c8c8ccc1848894ccc1c4cdc3800a4000200426600600266e18008004cc0c80080054ccc1b8cdc480100088010800981e801181e0011911980080100199b820050023253330693371200290000a9983919b9649012a70747279506f7369746976653a206275696c64696e672077697468206e6f6e20706f7369746976653a20003305c223372ca6660d666e20005200014901012d001491003232533306d3370e00490000981900089919b96001303300230040023370a6078004900a19b84303b00148050004584004cdc1001801181a19b82002001303448320040d4dd6983400300099b813370201406406426464646464646464a6660ce660b804000a264a6660d066e1c004cdc00099bad3070306e00715333068337120766eb4c1c0c1b801c54ccc1a0cdc40099bad3070010153330683370e6660780286eb8c1c0054dd71838183700aa40042a6660d066e1cccc0f0020dd7183800a9bae3070306e0154800854ccc1a0cdc399981e00a1bae307000a375c60e000e90010a99983419b8733303c008375c60e00146eb8c1c001d2002132323232533306c33306c0014a094452615330754910334313500163304200200130453072011375a609000260e0609260c00242a660e292103343038001615330714910334303700161533071491033430360016153307149103343035001615330714910334303400161533071491033430330016153307149103343032001630560071533070490103343031001653330663370e900000109919299983419b87371a002901c0991919191919191919191919191919299983b99b89480000044c8c8c8c8c8c8c8c8c8c8c926533308201001149854cc2280420c0458c218040194ccc1fccdc3a4000004264646464646464646464646464932999846008008a4c2a661280211a022c61200200ca6661120266e1d20000021323232323232324994ccc240040045261533098010910116309401006533308d013370e900000109919191919191924ca666128020022930a9984e0084a808b184c0080329998488099b87480000084c8c94ccc24c04cdc39b8d001480e04c8c926533309501001149854cc274042580458c2640400c54cc270042680458dd7000984c808008a9998488099b87480080084c8c94ccc24c04cdc39b8d001480e04c8c926533309501001149854cc274042580458c2640400c54cc270042400458dd7000984c808008a9984d0084d808b184d80801184d808009baa0013095010011533308d013370e900100109919191919191919191924ca66612e020022930a9984f8084c008b184d808019bad001309b01001309801003375a002613002002612a020066eb4004c2540400454cc2580425c0458c25c04008c25c04004dd50009848808008a9998448099b87480080084c926533308a01001149854cc2480422c045854cc2480424c0458c24c04008c24c04004dd500098468080098450080329998418099b87480000084c8c94ccc21404cdc39b8d001480e04c8c926533308701001149854cc23c042200458c22c0400c54cc238042300458dd70009845808008a9998418099b87480080084c8c94ccc21404cdc39b8d001480e04c8c926533308701001149854cc23c042200458c22c0400c54cc238042080458dd70009845808008a9984600846808b1846808011846808009baa001308701001153308801089011630890100230890100137540026106020026100020066eb4004c20004004c1f400c54cc200041d458dd6800983e800983d0019bad001307a0013077003375c00260ee00260e800ca6660da66e1d200000213232533306f3370e60f60029000099299983819baf374e0de6e9cc1d80044c94ccc1c4cdc39b8d001481004c8c8c8c8c9265333076001149854cc1f81dc58c1e800cdd6800983d000983b8028a9983d03a0b1bae3078001153307907416307a001153307807416375400260ea0022a660ec0ee2c60ee00460ee0026ea8004c1c4004c1b800c54cc1c41bc58dd700098370008a998378380b183800118380009baa00132323253330653370e90010010a99837249033330320016153330653370e9002001098368008a99837249033330310016306f002306f001375460d460a060b400660ce0066eacc1a0c198c160004c114c120058c1a4008c1a4004dd500a182998318049830000982f8009823182f0009827808191919299982c99b87480080084c184c14404054cc189240103333033001630630023063001375460bc60b8609c01a6088002646eacc174c16cc134004c8c174c16cc134004cccc114c8dd6182e9826800982e1826005982500590008a9982ea4810333303500163059001304a00c53330513370e90000010991919299982a29982699b87001480004cdc3800a40702646464a6660ae66e24dc6800a40802646464646493299982e0008a4c2a660c80ba2c60c00066eb4004c180004c17400c54cc18014858dd7000982e800982d0020a9982e8280b1b8d001375c00260b20022a6660a266e1d20020021323232533305453304d3370e0029000099b87001480e04c8c8c94ccc15ccdc49b8d001481004c8c9265333059001149854cc18416858c17400c54cc18014858dd7000982e800982d0020a9982e8280b1b8d001375c00260b20022a660b40b62c60b600460b60026ea80194ccc134cdc3a400000426464a66609e66e1cdc6800a40702646464646464646464646464646464a6660bc66e252000001132323232323232323232324994ccc1a4004526153307106a16306d00653330663370e900000109919191919191919191919191924ca6660e60022930a9983d83a0b183b803299983819b87480000084c8c8c8c8c8c8c9265333077001149854cc1fc1e058c1ec0194ccc1d0cdc3a400000426464646464646493299983d8008a4c2a66106020f82c60fe00ca6660f066e1d200000213232533307a3370e6e340052038132324994ccc1f000452615330840107d163080010031533083010810116375c0026100020022a6660f066e1d200200213232533307a3370e6e340052038132324994ccc1f000452615330840107d1630800100315330830107716375c0026100020022a6610202104022c6104020046104020026ea8004c1f000454ccc1d0cdc3a400400426464646464646464646493299983f0008a4c2a6610c020fe2c6104020066eb4004c20804004c1fc00cdd6800983f800983e0019bad001307c001153307d07e16307e002307e001375400260f00022a6660e066e1d20020021324994ccc1c4004526153307907216153307907a16307a002307a001375400260e800260e200ca6660d466e1d200000213232533306c3370e6e340052038132324994ccc1b8004526153307606f163072003153307507316375c00260e40022a6660d466e1d200200213232533306c3370e6e340052038132324994ccc1b8004526153307606f163072003153307506916375c00260e40022a660e60e82c60e800460e80026ea8004c1b800454cc1bc1c058c1c0008c1c0004dd5000983500098338019bad00130670013064003153306705c16375a00260c800260c20066eb4004c184004c17800cdd7000982f000982d803299982a19b87480000084c8c94ccc158cdc39831000a4000264a6660ae66ebcdd382b1ba7305d00113253330583370e6e340052040132323232324994ccc174004526153306505e163061003375a00260c200260bc00a2a660c20b62c6eb8c17c00454cc18016c58c18400454cc17c16c58dd5000982e0008a9982e82f0b182f001182f0009baa00130580013055003153305805616375c00260aa0022a660ac0ae2c60ae00460ae0026ea800c8c0e4894ccc1240045280a99982419baf305000100314a226004609c00246096604c0029210334313200490103323033002230293302e3037001300300223237586094606060740026092607200292010334313100490103343134004901033431330022533303e33712004002200220044a66607866e1c005200010021533303c3370e002900108018a99981e19b8700148010401054ccc0f0cdc3800a400c200a2a66607866e1c005200810061533303c3370e002900508038a99981e19b8700148030402054ccc0f0cdc3800a401c20122a66607866e1c0052010100a1533303c3370e002900908058b248101300049010131004901013200490101330049010134004901013500490101360049010137004901013800490101390025333031337120029000898010008800919b81480000048c88cc00400c0092002482024bd004888cccc01000920002333300500248001d69bab00100323002375200244446604244a666062002200a2a66606066ebcc0f0c0e00040184c010c0ecc0e00044c008c0d800400488cc00c008c014c0ccc0c4c08c00488c94ccc0acc010c0ccc0c40084c8c8c94ccc0b8cdc3a4000004294054ccc0b8cdc3a400400426466e2000401cdd6981b0008a513038002303800137540022646464a66605c66e1d200000215330274a0294054ccc0b8cdc3a40040042a6604e6466e2000401cdd6981b00089919b87007001375a606c0022a6604e944528181c001181c0009baa001303200123370e60686ea8005200201e2330023374a900001299ba548008cc04800409488cc00ccdd2a4000660240046602400804a66e9520003301200133012004025223374a90001980880119808800812260103d87a8000232323253330253370e9001001098168008a998170028b181780118178009baa32302b301b001302a301a0014901033330380023026300200123025300200123024300200123023300200123022300a0012533301c001153302400216132533301d00113024002153302500416302100149103333036004901033330370023330023237586042602200260406020002646eb0c084c01cc044004c080c040004c038004888cccc02800c0048cc014c038c8c08cc04c004c088c080c04800400c54cc088018588c024894ccc064004405c4c94ccc064c0100044cc014004c00cc07c0084c00cc07c008c0800055d02492063616e27742067657420616e7920636f6e74696e75696e67206f75747075747300230193019001253330130011480004ccc048cdd7980f180d0009ba9002375a603a60346eacc074c06800520004890022330033005001002300122253330120011225001153330113002301900113222300200330190011330030023017001232300223300200200123002233002002001223300300230163006001223375e6e9cc014008dd398028009191919299980719b87480080084c05800454cc05c01458c060008c060004dd5180998089801800a49033330340023014375400246601000200429452401327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67004901387074727946726f6d2843757272656e637953796d626f6c293a206d757374206265203238206279746573206c6f6e67206f7220656d7074790049012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e67004901257074727946726f6d28504f53495854696d65293a206d75737420626520706f736974697665004bd702b9a5573e9201317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f004901257074727946726f6d2854784964293a206d757374206265203332206279746573206c6f6e670049012a7074727946726f6d2854784964293a20636f6e7374727563746f72206669656c6473206c656e203e2031004901267074727946726f6d2854784964293a20696e76616c696420636f6e7374727563746f7220696400574492012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e67005742ae7124013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72005573caae75",\n "description": "Fundraising validator",\n "type": "PlutusScriptV2"\n}'},1001:e=>{"use strict";e.exports='{\n "cborHex": "59166b59166801000032323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232322222323232323232323232323232323253330463370e66606800a6eb8c130c100049220113446f6e6174506f6f6c476f7665726e616e636500480084c8c8c8c8c8c8c8c8c94ccc13cc8ccc1400052825153301d3375e60aa01060aa0082a6603a66ebcc15401cc15400c54cc074cdd7982a803182a8010a9980e99baf3055005305500113375e60aa60a800a60aa60a80022646464646464a6660aa66e24088dd6982d8020a99982a99b87001337000446eb4c16c0104c8c94ccc15ccc0b400800454ccc15ccdc39998229bab305d30273051005375c60ba02606490010a99982b99b87333045375660ba604e60a200a6eb8c1740480e12002132323232323232323232323253330633305a30690073069021153330633375e60d200660d20262a6660c6a6606266ebcc1a4018dd424000266ebcc1a4014dd4240002a6660c666460b244a6660ce002294054cc190c00cc1b00044c008c1ac0048cdd79835182f00098350029bac3069305d3069305d02c153330633375e60d260d00026ea120001325333064332305a22533306800114a02a6660ce66ebcc1b400400c5288980118360009ba93232323253330683370e90010010a99837a490333313200161375c60dc00260e000460e00026ea8c1acc17c004c1a800cdd61835191835183518351835181a800982f0008a9998321982d9981b1835183480f98350011981b1835183480f9991191ba8337006eb4008dd68009ba83370466e080092078483403cdd69835182818348099835183480f899191919191929998351983081a8028992999835998208150008a4c2a660e4921033831330016375660e060de60c800c2a660e2920103383132001653330693370e90000010991919191919191919299983929983819b87001480004cdc3800a40702646464a6660ea66e24dc6800a40802646464646493299983d0008a4c2a66100020f62c60fa0066eb4004c1f0004c1e800c54cc1f01e058dd7000983c800983b8020a9983c83b0b1b8d001375c00260ea00260e60066eb4004c1c8004c1c000cdd680098378008a998380388b183880118388009baa001304e0013047333222333305a003001233055305e32306f3063001306e306d3062001003153306e4912063616e27742067657420616e7920636f6e74696e75696e67206f757470757473001632375860d660be00260d460bc05a646eb0c1acc144c17c004c1a8c1780b4c1700b454cc1ad240104313331350016153306b4910338303500163069305d02c153306a4901033831340016153306a491115554784f206e6f7420636f6e73756d65640016153306a491033831300016153306a491033830390016153306a4910338303800163067001306600130650013064001306300130620013056005533305b3370e900000109919191919191919191919191919191919191919191919191919191919299983c19b89480000044c8c8c8c8c926533307d001149854cc20c041f858c2000400cdd6800983f800983e8018a9983f8398b1bad001307c001307a00653330743370e900000109919191919191919191919191924ca666102020022930a9984380841008b184200803299983f19b87480000084c8c8c8c8c8c8c926533308501001149854cc22c042180458c220040194ccc20804cdc3a4000004264646464646464932999844808008a4c2a6611e02114022c61180200ca66610c0266e1d2000002132325333088013370e6e340052038132324994ccc2280400452615330900108b0116308d01003153308f010840116375c0026118020022a66610c0266e1d2002002132325333088013370e6e340052038132324994ccc2280400452615330900108b0116308d01003153308f010850116375c0026118020022a6611a0211c022c611c02004611c020026ea8004c2200400454ccc20804cdc3a4004004264646464646464646464932999846008008a4c2a661240211a022c611e020066eb4004c23804004c2300400cdd68009845808009844808019bad00130880100115330890108a0116308a01002308a0100137540026108020022a6660fc66e1d20020021324994ccc1fc00452615330850108001161533085010860116308601002308601001375400261000200260fc00ca6660f066e1d200000213232533307a3370e6e340052038132324994ccc1f000452615330820107d16307f00315330810107616375c00260fc0022a6660f066e1d200200213232533307a3370e6e340052038132324994ccc1f000452615330820107d16307f00315330810107716375c00260fc0022a660fe100022c6100020046100020026ea8004c1e800454cc1ec1f058c1f0008c1f0004dd5000983b000983a0019bad00130730013071006533306b3370e900000109919299983699b873077001480004c94ccc1b8cdd79ba705f374e60e6002264a6660de66e1cdc6800a40802646464646493299983a0008a4c2a660f40ea2c60ee0066eb4004c1d8004c1d001454cc1d815458dd7183a0008a9983a82a8b183b0008a9983a02a8b1baa001307100115330720731630730023073001375400260da00260d60066eb4004c1a8004c1a000cdd680098338009832803299982f99b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c926533306f001149854cc1d41c058c1c800cdd6800983880098378019bad001306e001306c003375a00260d600260d20066eb4004c1a0004c19800cdd680098328008a998330338b183380118338009baa001306100115330620631630630023063001375400260800102a660bc921033831370016153305e491033831360016153305e49103383037001632332302f233300237560024644460040066e9800448940048c94ccc164d5d180089128008911801001998179299982c99baf0013750900009128008911801001800800999119991818911ba63300337560046eac00488ccc0c888dd419b80375a0046eb4004008004008004ccc0c8dd7182e009018a40046660646eb8c1700440dd20025333056002100213330553375e60be60b60046ea40dcc16800800854cc171241033830360016153305c49103383034001653330550011480004ccc150cdd7982f182d0009ba9036375a60ba60b46eacc174c1680052000375660b260b0609a00860b0609803660ac00260940366460666607a608c002646eb0c15cc0f4c12c004c158c128064c15403054cc159240103383032001630530013052001305100130453051009304f001304e001304d00130410013232323232323035005533304b3370e900000109919191919191919191919191919191919191919191919191919191924ca6660ce0022930a998368340b1835003299983219b87480000084c8c94ccc198cdc39838000a4000264a6660ce66ebcdd382c1ba7306c00113253330683370e6e340052040132323232324994ccc1b4004526153307306e163070003375a00260de00260da00a2a660de09c2c6eb8c1b400454cc1b813858c1bc00454cc1b413858dd500098350008a998358360b183600118360009baa00130660013064006533305e3370e900000109919191919191919191919191924ca6660d60022930a998388360b1837003299983419b87480000084c8c8c8c8c8c8c926533306f001149854cc1d41c058c1c80194ccc1b0cdc3a40000042646464646464649329998398008a4c2a660f20e82c60ec00ca6660e066e1d20000021323253330723370e6e340052038132324994ccc1d0004526153307a075163077003153307906e16375c00260ec0022a6660e066e1d20020021323253330723370e6e340052038132324994ccc1d0004526153307a075163077003153307906f16375c00260ec0022a660ee0f02c60f000460f00026ea8004c1c800454ccc1b0cdc3a400400426464646464646464646493299983b0008a4c2a660f80ee2c60f20066eb4004c1e0004c1d800cdd6800983a80098398019bad001307200115330730741630740023074001375400260dc0022a6660d066e1d20020021324994ccc1a4004526153306f06a16153306f0701630700023070001375400260d400260d000ca6660c466e1d20000021323253330643370e6e340052038132324994ccc198004526153306c067163069003153306b06016375c00260d00022a6660c466e1d20020021323253330643370e6e340052038132324994ccc198004526153306c067163069003153306b06116375c00260d00022a660d20d42c60d400460d40026ea8004c19000454cc19419858c198008c198004dd50009830000982f0019bad001305d001305b003375a00260b400260b00066eb4004c15c004c15400cdd6800982a00098290019bad0013051001153305205316305300230530013754606200266644464a6660980022a660a4921033331300016132533304d001130520021533053490103333131001630500013303723370e6660726eacc144c140c11400401000d2002332304022533304e001103e13303f3003305300130023052001230513050304500132375860a260a0608a00260a060880026eb8c134004dd71826982600080818200090a99826a481033830310016304a00130490013048001303c00c3756608e608c607600264608e608c60760026666066646eb0c11cc0ec004c118c0e8024c0e0024800454cc11d241033330350016533303f3370e90000010991919191919191919191919191919299982729982619b87001480004cdc3800a4070264646464a6660a4a660a066e1c005200013370e002901c0991919299982a99b89480000044c8c9265333057001149854cc17416058c16800c54cc17014058dd6800982c800982b8020a9982c82b0b1b8d001375c00260aa00260a60082a660aa0a42c6e34004dd700098288009827803299982499b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c9265333056001149854cc17015c58c1640194ccc14ccdc3a400000426464646464646493299982d0008a4c2a660c00b62c60ba00ca6660ae66e1d20000021323232323232324994ccc178004526153306405f163061006533305b3370e900000109919299982e99b87371a002901c0991924ca6660be0022930a998328300b18310018a9983202c8b1bae00130610011533305b3370e900100109919299982e99b87371a002901c0991924ca6660be0022930a998328300b18310018a9983202d0b1bae001306100115330620631630630023063001375400260ba0022a6660ae66e1d20020021323232323232323232324994ccc1840045261533067062163064003375a00260c600260c20066eb4004c180004c17800cdd6800982e8008a9982f02f8b182f801182f8009baa0013059001153330533370e900100109924ca6660a80022930a9982d02a8b0a9982d02d8b182d801182d8009baa00130550013053006533304d3370e900000109919299982799b87371a002901c0991924ca6660a20022930a9982b8290b182a0018a9982b0258b1bae00130530011533304d3370e900100109919299982799b87371a002901c0991924ca6660a20022930a9982b8290b182a0018a9982b0260b1bae0013053001153305405516305500230550013754002609e0022a660a00a22c60a200460a20026ea8004c12c004c1240194ccc10ccdc3a40000042646464646464646464646464646464649329998298008a4c2a660b20a82c60ac0066eb4004c154004c14c00cdd6800982900098280019bad001304f001304d003375a002609800260940066eb4004c12400454cc12812c58c12c008c12c004dd500098228008a998230238b182380118238009baa006533303b3370e90000010991919191919191919299982229982119b87001480004cdc3800a40702646464a66608e66e24dc6800a4080264646464649329998260008a4c2a660a409a2c609e0066eb4004c138004c13000c54cc13812858dd7000982580098248020a998258240b1b8d001375c002608e002608a0066eb4004c110004c10800cdd680098208008a998210218b182180118218009baa003482024bd00488ccc0d000800400c5281181b18010009181a980e000911980199ba548008cc088008084cdd2a400466044002042446600666e95200033021002330210040203374a900019810800998108020101119ba548000cc080008cc08000407d300103d87a8000223375e6e98008dd300091198101129998170008806899199802981b981a00111981099bb0303930350030010021001300230320010012223333004003220020020012301d3002001223232233001003002222533302d00113301e0030021323232533302f3375e00400226604266ec0008cc024c0e0018c0e000cccc02088008014c0d001054ccc0bccdc81bae002375c00226604200c666601044002006606800800a26604200666660104400200c00a60680086070004606e008606400244a666056004200226666006440026060004605e00400291010a50726f706f73616c49640022253330273370e002900008038998020019980280100091198021ba9002374c00244660066ea4008dd4000911980a99bb00020010034bd6f7b63024411050726f706f73616c5665726966696564004881002533301f00115330250021613253330200011302500215330260041630230014910333303600490103333037004901257074727946726f6d2854784964293a206d757374206265203332206279746573206c6f6e670049012a7074727946726f6d2854784964293a20636f6e7374727563746f72206669656c6473206c656e203e2031004901267074727946726f6d2854784964293a20696e76616c696420636f6e7374727563746f72206964002323232533301b3370e90010010a998110028b0a99980d99b87480100084c08400454cc08801858c08c008c08c004dd5180f18021809000a490333303200490103333031002301a301a001230092253330170011007132533301730040011330090013003301c00213003301c002301c0012223333004002480008cccc014009200075a6eac00400c8c008dd480091111980491299980b80088028a99980b19baf3020301c00100613004301f301c00113002301b0010014bd702ba0223300330050010023001222533301000112250011533300f3002301500113222300200330150011330030023014001232300223300200200123002233002002001223300300230123006001223375e6e9cc014008dd398028009191919299980619b87480080084c04800454cc04c01458c050008c050004dd5180798071801800a4903333034002301037540029201257074727946726f6d28504f53495854696d65293a206d75737420626520706f7369746976650049012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e670049012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e670023300300100214a2ae6955cfa481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f004901327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67004901387074727946726f6d2843757272656e637953796d626f6c293a206d757374206265203238206279746573206c6f6e67206f7220656d707479005744ae855ce2493f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72005573caae75",\n "description": "Governance validator",\n "type": "PlutusScriptV2"\n}'},8197:e=>{"use strict";e.exports='{\n "cborHex": "59012b5901280100003232323232322223232323232533300b332323230022330020020012300223300200200122533300f00114a02a6646601e0022944c00cc0300044c008d5d1000919baf300a300b0010093758601260146012601400c2930a99806a49115554784f206e6f7420636f6e73756d656400163008300900553330093370e900000109924ca6660140022930a99805a481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016153300b4913f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f720016300b00235573a0026ea80095d0918029baa0015734aae7d5ce2ab9e1",\n "description": "Governance Minting Policy",\n "type": "PlutusScriptV2"\n}'},1946:e=>{"use strict";e.exports='{\n "cborHex": "590329590326010000323232323232323232323232323232323232322223232323232323253330153370e9000001099191919299980c99b874800000854ccc064cdc39998079bab301e30133018301e004375c603c0026eb8c078015200215333019332301322533301d00114a02a6646603a0022944c00cc0840044c008c07c0048cdd7980f980c8008079bac301e3018301e301800c149854cc07d2401115554784f206e6f7420636f6e73756d65640016153301f01616153301f01716301f002301f0013754603660320026028010264646464a66603266e1d2000002153330193370e66601e6eacc078c04cc060c078010dd7180f0009bae301e00532337029000000a40042930a9980f80b0b0a9980f80b8b180f801180f8009baa301b30190013014008301b002301b001375400ca66602266e1d2000002132325333013337126e340052040132324994ccc054004526153301a016163016003153301901716375c002602c0022a66602266e1d2002002132325333013337126e340052040132324994ccc054004526153301a016163016003153301901716375c002602c0022a6602e92013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f720016301700230170013754004444666600800490001199980280124000eb4dd5800801918011ba900122223300522533300f00110051533300e3375e602c602600200c26008602a602600226004602200200246460044660040040024600446600400400246014600400246012600400246010601000292103323034004901435061747465726e206d61746368206661696c75726520696e2027646f2720626c6f636b206174207372632f5368617265642f436865636b732e68733a33373a332d313900230093754002ae6955cfa481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0057449201327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67005742ae7155cf2ab9d1",\n "description": "NFT Minting Policy",\n "type": "PlutusScriptV2"\n}'},1552:e=>{"use strict";e.exports='{\n "cborHex": "591a1a591a170100003232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323222223232323232323232323232323232323232323232323232323232323232323232323232325333081013370e6660ba0346eb8c21404c2100405922010a50726f706f73616c4964004800854ccc20404cdc399982e80d1bae3085013084010194891050726f706f73616c566572696669656400480084c94ccc20804cc8c1cc894ccc218040045280a9998428099baf30890100100314a2260046110020026ea4004dd6184300991843009833000983b80e8a9998410099baf3086013085010103750900009919191929998430099984300800a504a22a66610c0266ebcc22804068c2280403454ccc21804cdd798450080b9845008050a9998430099baf308a01016308a0100915333086013375e61140202a6114020102a66610c0266ebcc22804050c2280401c54ccc21804cdd798450098448080a1845009844808038992999843808008a99984380a9981799b87375a61160201a66e00dd698458080d1bad308b0101d13370e6eb4c22c04030dd698458080c8991919192999845809981c00080589929998460099b87333068375661200260e461020204e6eb8c24004c23c040840052002132533308d0133303700c028001149854cc248040f458c144ccc155c019982e9bae309001308f0102100148008ccc17416c16c17054cc244040f458cc0f4dd69847808111bad308f0102115330900104f16304f333053700046609e6660a6e00004ccc16c164164168ccc168dd71846808009bae308d01308c01001375a611a0203e60ea60fa002660ba6eb8c22c0407c0ac54cc23005241033930380016153330870153302f3370e6eb4c22c04030cdc01bad308b01019375a61160203a266e1cdd69845808069bad308b0101a132323232533308b013303800100b132533308c013370e6660d06eacc24004c1c8c2040409cdd7184800984780810800a4004264a66611a0266606e0180500022930a998490081e8b182899982ab8033305d375c612002611e02042002900119982e82d82d82e0a998488081e8b1981e9bad308f01022375a611e020422a661200209e2c609e6660a6e0008cc13cccc14dc000099982d82c82c82d19982d1bae308d01001375c611a026118020026eb4c2340407cc1d4c1f4004cc174dd718458080f8158a9984600a481033930390016325333087013370e00290010a5115333087013370e00290000a50153308c014901033530310016375a61140203a2a66116029201033931350016153308b01491033931340016153308b01491033930370016153308b01491033930360016153308b01491033930350016153308b01491033930340016153308b014910339313300163232533308701323370e6120026ea80052002308b01308a010021323232533308a013370e90000010a501533308a013370e900100109919b88001008375a611c020022944c24004008c24004004dd5000899191929998450099b874800000854cc20005280a501533308a013370e90010010a99840009919b88001008375a611c0200226466e1c020004dd69847008008a9984000a5114a06120020046120020026ea8004c22804004c1e8c22404c22004c1e8004c8cc88cc88cdd2a4000660ea004660ea00210a0266e9520003307300233073069083013374a900019839800998398348418099ba54800020404cdd2a4004660e2002102026110020246eb4c8c8c94ccc21804cdc3a400400426114020022a6611602921033330380016308c01002308c0100137546461100260f2002610e0260f0002610c0260ca60ee03a2a6610e029201033931320016153308701491033930330016323232325333085013370e90010010a9984500a4810333313200161375c6112020026116020046116020026ea8c21804c1dc004c2140405854cc21805241033930320016153308601491033930310016375661080261060260ea01a61040200261020200261000200260fe00260fc00260fa00260dc00aa6660f066e1d2000002132323232323232323232323232323232323232323232323232323232325333095013371290000008991919191924ca666134020022930a9984f0084d808b184d808019bad001309a01001309801003153309a0108e0116375a002612e02002612a0200ca6661220266e1d20000021323232323232323232323232324994ccc2780400452615330a20109f0116309f01006533309b013370e900000109919191919191924ca666144020022930a9985300851808b185180803299984f8099b87480000084c8c8c8c8c8c8c92653330a601001149854cc2a80429c0458c29c040194ccc28c04cdc3a400000426464a66614a0266e1cdc6800a407026464932999853808008a4c2a6615602150022c6150020062a661540213e022c6eb8004c29c0400454ccc28c04cdc3a400400426464a66614a0266e1cdc6800a407026464932999853808008a4c2a6615602150022c6150020062a6615402140022c6eb8004c29c0400454cc2a0042a40458c2a404008c2a404004dd50009851808008a99984f8099b87480080084c8c8c8c8c8c8c8c8c8c92653330a901001149854cc2b4042a80458c2a80400cdd68009854808009853808019bad00130a60100130a401003375a0026146020022a661480214a022c614a02004614a020026ea8004c27c0400454ccc26c04cdc3a400400426493299984e008008a4c2a661400213a022c2a6614002142022c6142020046142020026ea8004c26c04004c264040194ccc25404cdc3a400000426464a66612e0266e1cdc6800a40702646493299984c808008a4c2a6613a02134022c6134020062a6613802122022c6eb8004c2640400454ccc25404cdc3a400400426464a66612e0266e1cdc6800a40702646493299984c808008a4c2a6613a02134022c6134020062a6613802124022c6eb8004c2640400454cc2680426c0458c26c04008c26c04004dd5000984a808008a9984b0084b808b184b80801184b808009baa001309101001308f01003375a002611c0200261180200ca6661100266e1d200000213232533308a013370e612402002900009929998458099baf374e10e026e9cc238040044c94ccc23004cdc39b8d001481004c8c8c8c8c926533309101001149854cc254042480458c2480400cdd68009848808009847808028a9984880844808b1bae308f010011533090010890116309101001153308f01089011637540026118020022a6611a0211c022c611c02004611c020026ea8004c22004004c2180400cdd68009842808009841808019bad001308201001308001006533307c3370e900000109919191919191919191919191919191924ca666118020022930a9984800846808b1846808019bad001308c01001308a01003375a002611202002610e020066eb4004c21804004c2100400cdd68009841808009840808019bad0013080010011533081010820116308201002308201001375400260f80022a660fa0fc2c60fc00460fc0026ea8004c170004c94ccc1d400454cc1e52401033330360016132533307600113079002153307a490103333037001630770013332223333064003001233062306832307c306d001307b307a306c001003153307b49012063616e27742067657420616e7920636f6e74696e75696e67206f757470757473001632375860f060d200260ee60d002e646eb0c1e0c184c1a4004c1dcc1a005cc19805cc1d4004c1d0004c1cc004c1c8004c1c4004c1c0004c184048c1b8004c1b4004c178038c17403cdd598359835182e0009918359835182e000999982a191bac306b305c001306a305b00a305900a2001153306b49010333303500163069305a00953330643370e900000109919191919191919191919191919192999839a9983499b87001480004cdc3800a40702646493299983a8008a4c2a660f20ec2c60ec0082a660f00d62c6e34004dd7000983a0009839003299983719b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c926533307b001149854cc1fc1f058c1f00194ccc1e0cdc3a400000426464646464646493299983f8008a4c2a6610602100022c61000200ca6660f866e1d20000021323232323232324994ccc20c0400452615330870108401163084010065333080013370e90000010991929998410099b87371a002901c0991924ca666108020022930a9984400842808b1842808018a998438083e0b1bae00130840100115333080013370e90010010991929998410099b87371a002901c0991924ca666108020022930a9984400842808b1842808018a998438083e8b1bae001308401001153308501086011630860100230860100137540026100020022a6660f866e1d20020021323232323232323232324994ccc21804004526153308a010870116308701003375a002610c020026108020066eb4004c20c04004c2040400cdd68009840008008a9984080841008b1841008011841008009baa001307c001153330783370e900100109924ca6660f20022930a9983e83d0b0a9983e83f0b183f001183f0009baa0013078001307600653330723370e900000109919299983a19b87371a002901c0991924ca6660ec0022930a9983d03b8b183b8018a9983c8370b1bae0013076001153330723370e900100109919299983a19b87371a002901c0991924ca6660ec0022930a9983d03b8b183b8018a9983c8378b1bae001307600115330770781630780023078001375400260e40022a660e60e82c60e800460e80026ea8004c1b8004c1b000cdd6800983580098348019bad0013068001153306906a16306a002306a001375400ca6660c066e1d200000213232323232323232323232323232323232323232323232323232323232533307d3371290000008991919191924ca666104020022930a9984300841808b1841808019bad00130820100130800100315330820107616375a00260fe00260fa00ca6660f266e1d20000021323232323232323232323232324994ccc21804004526153308a0108701163087010065333083013370e900000109919191919191924ca666114020022930a9984700845808b18458080329998438099b87480000084c8c8c8c8c8c8c926533308e01001149854cc2480423c0458c23c040194ccc22c04cdc3a400000426464a66611a0266e1cdc6800a407026464932999847808008a4c2a6612602120022c6120020062a661240210e022c6eb8004c23c0400454ccc22c04cdc3a400400426464a66611a0266e1cdc6800a407026464932999847808008a4c2a6612602120022c6120020062a6612402110022c6eb8004c23c0400454cc240042440458c24404008c24404004dd50009845808008a9998438099b87480080084c8c8c8c8c8c8c8c8c8c926533309101001149854cc254042480458c2480400cdd68009848808009847808019bad001308e01001308c01003375a0026116020022a661180211a022c611a02004611a020026ea8004c21c0400454ccc20c04cdc3a4004004264932999842008008a4c2a661100210a022c2a6611002112022c6112020046112020026ea8004c20c04004c204040194ccc1f4cdc3a400000426464a6660fe66e1cdc6800a407026464932999840808008a4c2a6610a02104022c6104020062a66108020f22c6eb8004c2040400454ccc1f4cdc3a400400426464a6660fe66e1cdc6800a407026464932999840808008a4c2a6610a02104022c6104020062a66108020f42c6eb8004c2040400454cc2080420c0458c20c04008c20c04004dd5000983e8008a9983f03f8b183f801183f8009baa00130790013077003375a00260ec00260e800ca6660e066e1d20000021323253330723370e60f40029000099299983999baf374e0de6e9cc1d80044c94ccc1d0cdc39b8d001481004c8c8c8c8c9265333079001149854cc1f41e858c1e800cdd6800983c800983b8028a9983c8388b1bae30770011533078071163079001153307707116375400260e80022a660ea0ec2c60ec00460ec0026ea8004c1c0004c1b800cdd6800983680098358019bad001306a001306800653330643370e900000109919191919191919191919191919191924ca6660e80022930a9983c03a8b183a8019bad00130740013072003375a00260e200260de0066eb4004c1b8004c1b000cdd6800983580098348019bad0013068001153306906a16306a002306a001375400260c80022a660ca0cc2c60cc00460cc0026ea800c88ccc16800800400c528111198021802800998038018011182311299982c8008a50153304e3003305c00113002305b0012233003375660b460b260960020044466ebcdd30011ba6001223303f3003002375860b06082609200244646464a6660ac66e1d200200214a0266e3cdd7182d000802982e001182e0009baa3230583049001305730480014910339313100490103343133002232323232325333055337126e3400520401001153305a008163371400866e2800ccdc500080119b8b48170088dcc18030019b9830050033371690440080fa490336303100303c223372ca66609c66e20005200010031004323253330503370e00490000980380089919b96001300800230040023370a6022004900a19b84301000148051241012d004901002533304a3370e002900008010a99982519b8700148008400c54ccc128cdc3800a400820082a66609466e1c005200610051533304a3370e002900408030a99982519b8700148028401c54ccc128cdc3800a401820102a66609466e1c005200e10091533304a3370e002900808050a99982519b8700148048402c592410130004901013100490101320049010133004901013400490101350049010136004901013700490101380049010139002533303f337120029000898010008800919b814800000524010339313000233002232533303e300500112250011223002003330052533303e3375e0026ea120001225001122300200300100123003233300237560024644460040066e9800448940055d1911981511299981e80088088991998029822182080111981519bb03046304200300100210013002303f001001222333004223330070050020010020012300322374c660066eac008dd580091801111ba833003375a0046eb4004888cccc01000c880080080048c090c00800488c8c88cc00400c0088894ccc0e40044cc09000c0084c8c8c94ccc0eccdd780100089981399bb0002330093042006304200333300822002005303e0041533303b337206eb8008dd7000899813803199980411000801981f002002899813801999980411000803002981f00218210011820802181e00091299981b80108008999980191000981d001181c801000a44100482024bd0048894ccc0c8cdc3800a4000200e2660080066600a00400244660086ea4008dd300091198019ba90023750002446603466ec000800400d2f5bded8c0446464646464603200aa66606066e1d20000021323232323232323232533303953302f3370e0029000099b87001480e04c8c8c94ccc0f0cdc49b8d001481004c8c8c8c8c9265333041001149854cc11410858c10800cdd68009820800981f8018a998208098b1bae001303e001303c004153303e03116371a0026eb8004c0e8004c0e000cdd6800981b800981a8019bad0013034001153303503616303600230360013754602a00266600800401a0029201327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e670022232533302d001153303100516132533302e00113031002153303200716302f0013301633006003002300a00149010333313000490103333131002223370e6660086eacc0b0c0acc07400400c00920022223333004002480008cccc014009200075a6eac00400c8c008dd480091111980b11299981480088028a99981419baf3030302c00100613004302f302c00113002302b0010012330022302730263018001323758604e604c6030002604c602e0024602244a666048002203e26601e6006604e0026004604c002910113446f6e6174506f6f6c476f7665726e616e6365004c0103d87a80002302130020012302030020012301f30020012301e30020012301d30070012323232533301c3370e90010010a998108028b0a99980e19b87480100084c08000454cc08401858c088008c088004dd5180e98031807000a49033330320049010333303100230062253330190011014132533301930040011330050013003301c00213003301c002301c00157404602e602e0024466006600a0020046002444a66602a002244a0022a666028600460300022644460040066030002266006004602e0024646004466004004002460044660040040024466006004602a600c0024466ebcdd398028011ba73005001232323253330113370e90010010980a8008a9980b0028b180b801180b8009baa3012301130030014901033330340023013375400246601600200429452401387074727946726f6d2843757272656e637953796d626f6c293a206d757374206265203238206279746573206c6f6e67206f7220656d707479004901257074727946726f6d28504f53495854696d65293a206d75737420626520706f7369746976650049012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e670049012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e67004bd70249257074727946726f6d2854784964293a206d757374206265203332206279746573206c6f6e670049012a7074727946726f6d2854784964293a20636f6e7374727563746f72206669656c6473206c656e203e2031004901267074727946726f6d2854784964293a20696e76616c696420636f6e7374727563746f72206964005734aae7d241317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f005744ae855ce2493f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72005573caae75",\n "description": "Proposal validator",\n "type": "PlutusScriptV2"\n}'},1086:e=>{"use strict";e.exports='{\n "cborHex": "5905c05905bd0100003232323232323232323232323232323232323232323232323232323232323232322223232323232323253330213370e9000001099191919299981299b874800000854ccc094cdc399980b9bab302c300f3023302c004375c60580026eb8c0b00152002153330253301623375e605a604800201e6eb0c0b0c08cc0b0c08c030526153302d4901115554784f206e6f7420636f6e73756d65640016153302d01316153302d01416302d002302d00137546052604e002603e0102a66604266e1d200200213232323253330253370e90000010a99981299b8733301737566058601e604660580086eb8c0b0004dd718160029809240042930a998168098b0a9981680a0b181680118168009baa30293027001301f008153330213370e9003001099299981119809919b8733301537566054605060420020040269001180c0048a99981119809919b8733301537566054605060420026eb8c0a8c0a000c0612002301800913232323253330263370e90000010a99981319b873330183756605a60206048605a0086eb8c0b4004dd718168031809a40042930a9981700a0b0a9981700a8b181700118170009baa302a30280013020009153302a01d16153302a01d16301d00813253330223301323370e66602a6eacc0a8c0a0c08400400804d20023018009153330223301323370e66602a6eacc0a8c0a0c084004dd7181500180c2400460300122930a9981500e8b0a9981500e8b180e804181480118148009baa006533301d3370e900000109919299980f99b89371a00290200991924ca6660440022930a998140118b18120018a998138128b1bae00130240011533301d3370e900100109919299980f99b89371a00290200991924ca6660440022930a998140118b18120018a998138128b1bae00130240011533301d3370e90020010991919299981029980f99b87001480004cdc3800a4070264649329998118008a4c2a660520482c604a0082a660500482c6e34004dd700098120008a99980e99b87480180084c8c94ccc07ccdc49b8d001481004c8c8c8c94ccc08d4cc088cdc3800a4000266e1c0052038132324994ccc098004526153302c027163028004153302b02716371a0026eb8004c09c004c09000c54cc09c09458dd700098120008a99812a493f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f720016302500230250013754004460386004002460366004002460346034002466e052000001490103323034004901435061747465726e206d61746368206661696c75726520696e2027646f2720626c6f636b206174207372632f5368617265642f436865636b732e68733a33373a332d31390048810a50726f706f73616c4964002300822533301400114a02a660226006603200226004602e002444666600800490001199980280124000eb4dd5800801918011ba90012222330082253330140011005153330123375e6038603200200c260086036603200226004602e0020029111050726f706f73616c566572696669656400233002230133011300a00132375860266014002602460120024600444a66601c002200a26600c600660260026004602200246460044660040040024600446600400400297ae057409201033230350023232323253330093370e900000109bae3010001153301100616301100230110013754002601860146006002920103333133002300c3754002466004002006ae68528aab9f4901317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f004901387074727946726f6d2843757272656e637953796d626f6c293a206d757374206265203238206279746573206c6f6e67206f7220656d7074790057449201327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67005742ae7155cf2ab9d1",\n "description": "Proposal Thread Minting Policy",\n "type": "PlutusScriptV2"\n}'},2076:e=>{"use strict";e.exports='{\n "cborHex": "591d5e591d5b0100003232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232222232323232323232323232323253330573370e900000109919299982c998191ba9001375860bc6066609c00c264646464a6660ba66ebcc188c138c148054c8c18cc13cc14c004c0bc01854ccc174cdd79831181c982900a991831981d182980098178030a99982e980f9982380a9817803099191919299983099b89030375a60cc0082a6660c266e20dd698330021bad3066003153330613371090011bad306600215333061337106eb4c198008dd698330008a999830a9981099b8948000dd698331832800899b88375a60cc60ca0029064008a9998309980d980e00b9bab30663065305600a153330613370e66607c6eacc198c194c158028dd71833182b00d1bae30663065305601a48008526153306703116153306703216153306749103313332001615330674910331333100161533067491033133300016153306749103313239001615330674910331323800163064001306300130620013052302f006153306349103313134001615330634910331313300161533063491033131320016533305c3370e900000109919191919191919191919191919191919191919191919191919191924ca6660f00022930a9983e83c8b183d003299983a99b87480000084c8c94ccc1dccdc3984000800a4000264a6660f066ebcdd38399ba7307c00113253330793370e6e340052040132323232324994ccc1f800452615330830107f16308001003375a00260fe00260fa00a2a660fe0ea2c6eb8c1f400454cc1f81d458c1fc00454cc1f41d458dd5000983d0008a9983d83e0b183e001183e0009baa00130760013074006533306f3370e900000109919191919191919191919191924ca6660f80022930a998408083e8b183f003299983c99b87480000084c8c8c8c8c8c8c926533308001001149854cc214042040458c208040194ccc1f4cdc3a4000004264646464646464932999842008008a4c2a661120210a022c610c0200ca6661020266e1d2000002132325333083013370e6e340052038132324994ccc21404004526153308a0108601163087010031533089010820116375c002610c020022a6661020266e1d2002002132325333083013370e6e340052038132324994ccc21404004526153308a0108601163087010031533089010860116375c002610c020022a6610e02110022c6110020046110020026ea8004c2080400454ccc1f4cdc3a4004004264646464646464646464932999843808008a4c2a6611802110022c6112020066eb4004c22004004c2180400cdd68009842808009841808019bad0013082010011533083010840116308401002308401001375400260fc0022a6660f266e1d20020021324994ccc1e8004526153307f07b16153307f0800116308001002308001001375400260f400260f000ca6660e666e1d20000021323253330753370e6e340052038132324994ccc1dc004526153307c078163079003153307b07416375c00260f00022a6660e666e1d20020021323253330753370e6e340052038132324994ccc1dc004526153307c078163079003153307b07816375c00260f00022a660f20f42c60f400460f40026ea8004c1d000454cc1d41d858c1d8008c1d8004dd5000983800098370019bad001306d001306b003375a00260d400260d00066eb4004c19c004c19400cdd6800983200098310019bad001306100115330620631630630023063001375460560042a660be08e2c608e60ba6092609a020605801a2a6660ae66e1d2002002132323232323232323253330603301a301b016375660ca60c860aa0122a6660c066e1cccc0f4dd598329832182a8049bae30653055019375c60ca60c860aa032900109919191929998321982700e181b0068a99983219b87333041375660d260ac60b20226eb8c1a4c15cc164030dd71834982b182c806240042646464646464646464a6660da66ebcc1c8c178c188048c1c800454ccc1b54cc0b4cdc49bad3072005375a60e4010266e24dd698390041bad30720041533306d33223232325330323303130393077002303930770011330313039307730760013039307730760023066002306500232330380010013374a90011982b801035183900399911981b99ba548008cc15c0081a8cdd2a4004660ae0020d4660706eb4c1c800c018cc0e0dd698390010030a99983699baf307230710013072307130710071533306d337126e34dd71839004a408c26464a6660de66e1cccc130008dd7183a1839983200b9bae3074306330640174800854ccc1bccdc39998260011bae307430623064017375c60e860c260c802e90010a99983799b870013370007c07c2a6660de660906ea4dd7183a183200a1bac30743049306401c149854cc1d52401033133340016153307549103313232001615330754910331323100161533075491033132300016533306f0011480004ccc1b8cdd7983b98398009ba9488100375a60ec60e66eacc1d8c1cc0052000375660e460e260c40262a660e692103313333001615330734910331323700161533073491033132360016153307349103313139001615330734910331313800163070001306f001306e001306d001305d020306c3058305c00f306a001306900130583059009153306a4901033132350016153306a49103313137001653330633370e900000109919191919191919191919191919191919191919191919191919191924ca6660fe0022930a9984200840008b184080803299983e19b87480000084c8c94ccc1f8cdc3984380800a4000264a6660fe66ebcdd383d1ba73083010011325333080013370e6e340052040132323232324994ccc21404004526153308a010860116308701003375a002610c0200261080200a2a6610c020f82c6eb8c2100400454cc214041f058c2180400454cc210041f058dd50009840808008a9984100841808b1841808011841808009baa001307d001307b00653330763370e900000109919191919191919191919191924ca666106020022930a9984400842008b18428080329998400099b87480000084c8c8c8c8c8c8c926533308701001149854cc230042200458c224040194ccc21004cdc3a4000004264646464646464932999845808008a4c2a6612002118022c611a0200ca6661100266e1d200000213232533308a013370e6e340052038132324994ccc2300400452615330910108d0116308e010031533090010890116375c002611a020022a6661100266e1d200200213232533308a013370e6e340052038132324994ccc2300400452615330910108d0116308e0100315330900108d0116375c002611a020022a6611c0211e022c611e02004611e020026ea8004c2240400454ccc21004cdc3a4004004264646464646464646464932999847008008a4c2a661260211e022c6120020066eb4004c23c04004c2340400cdd68009846008009845008019bad001308901001153308a0108b0116308b01002308b010013754002610a020022a6661000266e1d20020021324994ccc2040400452615330860108201161533086010870116308701002308701001375400261020200260fe00ca6660f466e1d200000213232533307c3370e6e340052038132324994ccc1f800452615330830107f1630800100315330820107b16375c00260fe0022a6660f466e1d200200213232533307c3370e6e340052038132324994ccc1f800452615330830107f1630800100315330820107f16375c00260fe0022a6610002102022c6102020046102020026ea8004c1ec00454cc1f01f458c1f4008c1f4004dd5000983b800983a8019bad00130740013072003375a00260e200260de0066eb4004c1b8004c1b000cdd6800983580098348019bad0013068001153306906a16306a002306a001375460640122a660cc0602c2a660cc0622ca6660be66e1d20000021323253330613370e6e340052038132323232323232323232323232323253330703371290000008991919191919191919191924ca6660f60022930a998400083e0b183e803299983c19b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c926533308501001149854cc228042180458c21c040194ccc20804cdc3a4000004264646464646464932999844808008a4c2a6611c02114022c61160200ca66610c0266e1d20000021323232323232324994ccc2340400452615330920108e0116308f01006533308a013370e90000010991929998460099b87371a002901c0991924ca66611c020022930a9984980847808b1848008018a9984900845808b1bae001308f010011533308a013370e90010010991929998460099b87371a002901c0991924ca66611c020022930a9984980847808b1848008018a9984900847808b1bae001308f01001153309001091011630910100230910100137540026116020022a66610c0266e1d20020021323232323232323232324994ccc240040045261533095010910116309201003375a002612202002611e020066eb4004c23804004c2300400cdd68009845808008a9984600846808b1846808011846808009baa00130870100115333082013370e900100109924ca666106020022930a9984400842008b0a9984400844808b1844808011844808009baa001308301001308101006533307c3370e900000109919299983f19b87371a002901c0991924ca666100020022930a9984280840808b1841008018a998420083e8b1bae0013081010011533307c3370e900100109919299983f19b87371a002901c0991924ca666100020022930a9984280840808b1841008018a9984200840808b1bae0013081010011533082010830116308301002308301001375400260fa0022a660fc0fe2c60fe00460fe0026ea8004c1e4004c1dc00cdd6800983b000983a0018a9983b0340b1bad00130730013071003375a00260e000260dc0066eb8004c1b4004c1ac0194ccc198cdc3a400000426464a6660d066e1cc1c4005200013253330693375e6e9c190dd39836800899299983519b87371a00290200991919191924ca6660de0022930a9983a0380b18388019bad0013070001306e005153307006616375c60dc0022a660de0cc2c60e00022a660dc0cc2c6ea8004c1ac00454cc1b01b458c1b4008c1b4004dd5000983380098328018a998338300b1bae0013064001153306506616306600230660013754002605a0026060660806086002646eb0c180c13cc140004c17cc13c040c178c138004c174008c0b00344c94ccc160cc0c4dd48009bac305d3032304d005132533305a001153330593370e66606c6eacc178c12cc138018dd7182f18270091bae305e305d304e012303948008526153305f03a16153330593370e66606c6eacc178c12cc138018dd7182f18270091bae305e305d304e012303948008526153305f03a16303a00e153305e046163046305c3048304c00f305e002305e0013754016646464a6660ac66e1d20020021305b304b00c153305c4901033330330016305d002305d001375460b060ae6090012a6660a466e1d20000021323232323232324994ccc164004526153305e05a16305b00653330563370e900000109919191919191919191919191919191924ca6660cc0022930a998358338b18340019bad00130670013065003375a00260c800260c40066eb4004c184004c17c00cdd6800982f000982e0019bad001305b001153305c05d16305d002305d001375400260ae0022a6660a466e1d20020021323232323232324994ccc164004526153305e05a16305b00653330563370e90000010991919191919191919299982fa9982a99b87001480004cdc3800a40702646464a6660c466e24dc6800a4080264646464a6660cca660b866e1c005200013370e002901c0991919299983499b89371a00290200991919299983619b89480000044c8c926533306e001149854cc1cc1bc58c1c000c54cc1c819058dd6800983780098368018a998378310b1bae001306c001306a004153306c06016371a0026eb8004c1a0004c19800c54cc1a016c58dd7000983280098318020a9983282c8b1b8d001375c00260c200260be00ca6660b466e1d20000021323232323232323232323232324994ccc19c004526153306c06816306900653330643370e900000109919191919191924ca6660d60022930a998380360b1836803299983419b87480000084c8c8c8c8c8c8c926533306f001149854cc1d01c058c1c40194ccc1b0cdc3a400000426464a6660dc66e1cdc6800a4070264649329998380008a4c2a660ea0e22c60e40062a660e80da2c6eb8004c1c400454ccc1b0cdc3a400400426464a6660dc66e1cdc6800a4070264649329998380008a4c2a660ea0e22c60e40062a660e80e22c6eb8004c1c400454cc1c81cc58c1cc008c1cc004dd500098368008a99983419b87480080084c8c8c8c8c8c8c8c8c8c9265333072001149854cc1dc1cc58c1d000cdd6800983980098388019bad0013070001306e003375a00260da0022a660dc0de2c60de00460de0026ea8004c1a400454ccc190cdc3a40040042649329998328008a4c2a660d40cc2c2a660d40d62c60d600460d60026ea8004c194004c18c0194ccc178cdc3a400000426464a6660c066e1cdc6800a4070264649329998310008a4c2a660ce0c62c60c80062a660cc0be2c6eb8004c18c00454ccc178cdc3a400400426464a6660c066e1cdc6800a4070264649329998310008a4c2a660ce0c62c60c80062a660cc0c62c6eb8004c18c00454cc19019458c194008c194004dd5000982f8008a998300308b183080118308009baa001305b001153305c05d16305d002305d001375400260ae0022a6660a466e1d20040021324994ccc14c00452615330580541615330580591630590023059001375400ca66609c66e1d20000021323232323232323232323232323232323232323232323232323232324994ccc1a8004526153306f06b16306c00653330673370e900000109919299983499b873072001480004c94ccc1a8cdd79ba7065374e60dc002264a6660d666e1cdc6800a4080264646464649329998380008a4c2a660ea0e22c60e40066eb4004c1c4004c1bc01454cc1c419c58dd718378008a998380338b18388008a998378338b1baa001306c001153306d06e16306e002306e001375400260d000260cc00ca6660c266e1d20000021323232323232323232323232324994ccc1b8004526153307306f163070006533306b3370e900000109919191919191924ca6660e40022930a9983b8398b183a003299983799b87480000084c8c8c8c8c8c8c9265333076001149854cc1ec1dc58c1e00194ccc1cccdc3a400000426464a6660ea66e1cdc6800a40702646493299983b8008a4c2a660f80f02c60f20062a660f60e82c6eb8004c1e000454ccc1cccdc3a400400426464a6660ea66e1cdc6800a40702646493299983b8008a4c2a660f80f02c60f20062a660f60f02c6eb8004c1e000454cc1e41e858c1e8008c1e8004dd5000983a0008a99983799b87480080084c8c8c8c8c8c8c8c8c8c9265333079001149854cc1f81e858c1ec00cdd6800983d000983c0019bad00130770013075003375a00260e80022a660ea0ec2c60ec00460ec0026ea8004c1c000454ccc1accdc3a40040042649329998360008a4c2a660e20da2c2a660e20e42c60e400460e40026ea8004c1b0004c1a80194ccc194cdc3a400000426464a6660ce66e1cdc6800a4070264649329998348008a4c2a660dc0d42c60d60062a660da0cc2c6eb8004c1a800454ccc194cdc3a400400426464a6660ce66e1cdc6800a4070264649329998348008a4c2a660dc0d42c60d60062a660da0d42c6eb8004c1a800454cc1ac1b058c1b0008c1b0004dd500098330008a998338340b183400118340009baa00130620013060003375a00260be00260ba0066eb4004c170004c16800cdd6800982c800982b8019bad00130560013054003375a00260a60022a660a80aa2c60aa00460aa0026ea800c88cdd79ba6002374c0024646eacc130c12cc0f0004c0080048c8c12cc128c0ec004ccc008004800454cc12c00c588cc0a0c8dd61825181d0009824981c8009818000a4903333035002232323232533304753303d5330070021001153300730090021300900113300a00400313300c004003300c304b304a004300b304a3049004304900230480022233304200200100314a0466607e002941289129981a9980200100089980180100091191919299982099b87480000084c8c8c94ccc110cdc3a40000042944528182580118258009baa004153330413370e90010010991919299982219b87480080084c8cdc39bad304a005001375a60920022940c12c008c12c004dd50020991919299982219b87480100085288a50304b002304b0013754008609000460900026ea800888c8c8c94ccc100cdc3a4000004294454ccc100cdc3a40040042646464a66608666e1d200000214a02a66608666e1d200400214a2266e20dd698240021bad3048001304a002304a00137540082646464a66608666e1d200400214a22940c128008c128004dd5002182380118238009baa00223370e60886ea8005200202e22330033374a9000198110011981100201a99ba548000cc088004cc0880100d488cdd2a40006604200466042002068980103d87a8000223300300137506008004446ea0cdc01bad002375a002466e08cdc1000a40f0004906807a410125e802921033131360049010331313500232323253330323370e90010010a9981c0028b0a99981919b87480100084c0dc00454cc0e001858c0e4008c0e4004dd5181a18119812000a4903333032004901033330310023002300e0012533302c001153303100216132533302d00113031002153303200416302f0014910333303600490103333037002300f22533302b00114a02a66605466ebcc0bc00400c52889801181700091815980100091815180100091814980b0009111999802001240004666600a00490003ad3756002006460046ea40048888cc030894ccc0a0004401454ccc09ccdd7981818160008030980218179816000898011815800800919b814800000524103313233002333002323758604a602a00260486028002646eb0c094c050c054004c090c050004c02c004888cccc01000c0048cc01cc028c8c09cc05c004c098c094c05800400c54cc09802c5888cc00cc01c004008c0088894ccc07c004489400454ccc078c008c08c0044c888c00800cc08c0044cc00c008c0880048c008894ccc07800440604c94ccc078c0100044cc018004c00cc0880084c00cc088008c0880048c8c0088cc0080080048c0088cc0080080055d01119801801180f18070009119baf374e601a0046e9cc03400524012063616e27742067657420616e7920636f6e74696e75696e67206f75747075747300232323253330183370e90010010980e8008a9980f0028b180f801180f8009baa301a3019300a001491033330340049010331313100232323253330153370e90010010a9980d8028b09bae301a001301c002301c0013754602e600e002921033331320023014300200123013300200123012300200123011301100123014375400246601600200429452401257074727946726f6d28504f53495854696d65293a206d75737420626520706f736974697665004901327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67004901387074727946726f6d2843757272656e637953796d626f6c293a206d757374206265203238206279746573206c6f6e67206f7220656d707479004bd70249257074727946726f6d2854784964293a206d757374206265203332206279746573206c6f6e670049012a7074727946726f6d2854784964293a20636f6e7374727563746f72206669656c6473206c656e203e2031004901267074727946726f6d2854784964293a20696e76616c696420636f6e7374727563746f722069640049012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e67005734aae7d241317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0049012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e67005744ae855ce2493f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72005573caae75",\n "description": "Protocol Validator",\n "type": "PlutusScriptV2"\n}'},615:e=>{"use strict";e.exports='{\n "cborHex": "5904b95904b60100003232323232323232323232323232323232323232323232323232323232322223232323232323253330203370e9001001099191919299981219b874800000854ccc090cdc399980c9bab3029301030233029004375c60520026eb8c0a4014c8cdc0a400000290010a4c2a660540422c2a660540442c605400460540026ea8c098c090004c07c02054ccc080cdc3a4008004264646464a66604866e1d2000002153330243370e6660326eacc0a4c040c08cc0a4010dd718148009bae30290054800854ccc090cc0588cdc399980d1bab302a30283024001375c6054604801e020900118090060a9998121980b119b8733301a37566054605060480026eb8c0a8c09003c0412002301d00c149854cc0a807c5854cc0a80805854cc0a80845854cc0a808858c0a8008c0a8004dd518131812000980f804099191919299981219b874800000854ccc090cdc399980c9bab3029301030233029004375c60520026eb8c0a40152002153330243301623370e6660346eacc0a8c0a0c090004dd7181518120079bae302a3028302400f48008c04803054ccc090cc0588cdc399980d1bab302a30283024001375c6054604801e6eb8c0a8c0a0c09003d2002301d00c149854cc0a807c5854cc0a80805854cc0a80845854cc0a808858c0a8008c0a8004dd518131812000980f804181300118130009baa006533301c3370e900000109919299980f19b89371a00290200991924ca6660400022930a998128108b18108018a998120110b1bae00130210011533301c3370e900100109919299980f19b89371a00290200991924ca6660400022930a998128108b18108018a998120110b1bae00130210011533301c3370e900200109919299980f19b89371a00290200991924ca6660400022930a998128108b18108018a998120110b1bae001302100115330224913f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001630220023022001375400491113446f6e6174506f6f6c476f7665726e616e63650023018300200123017300e001233002230193017301300132375860326026002603060240024601444a66602a002200826600a600660320026004602e00297ae057404600e44a666024002294054cc010c00cc0580044c008c0500048cc0380040085289111999802001240004666600a00490003ad3756002006460046ea40048888cc014894ccc040004401454ccc03ccdd7980b980a00080309802180b180a0008980118090008009191801119801001000918011198010010009191bac300e30033008001300d30070012300a300a001491033230360049010332303500490103323034004901435061747465726e206d61746368206661696c75726520696e2027646f2720626c6f636b206174207372632f5368617265642f436865636b732e68733a33373a332d313900230093754002ae6955cfa481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0057449201327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67005742ae7155cf2ab9d1",\n "description": "Verification token",\n "type": "PlutusScriptV2"\n}'},5174:()=>{}}]); \ No newline at end of file diff --git a/exe/Main.purs b/exe/Main.purs index e61a856..c7f85b2 100644 --- a/exe/Main.purs +++ b/exe/Main.purs @@ -8,10 +8,15 @@ import Fundraising.Create as CreateFundraising import Fundraising.Donate as Donate import Fundraising.ReceiveFunds as ReceiveFunds import Fundraising.UserData (CreateFundraisingParams, FundraisingData) +import Governance.MintGovernanceTokens as GovTokens import Info.AllFundraisings as AllFundraisings import Info.AppInfo as AppInfo import Info.UserData (AppInfo, FundraisingInfo) import Info.UserRelatedFundraisings as UserRelatedFundraisings +import Management.Proposal.UserData (ProposalInfo, VoteData) +import Proposal.Create as CreateProposal +import Proposal.Model (PProposalParameters) +import Proposal.Vote as Vote import Protocol.UserData (ProtocolData) import Shared.NetworkData (NetworkParams) @@ -22,6 +27,9 @@ data Contracts = Contracts , receiveFunds :: (Unit -> Effect Unit) -> (String -> Effect Unit) -> ProtocolData -> NetworkParams -> FundraisingData -> Effect Unit , getAllFundraisings :: (Array FundraisingInfo -> Effect Unit) -> (String -> Effect Unit) -> ProtocolData -> NetworkParams -> Effect Unit , getUserRelatedFundraisings :: (Array FundraisingInfo -> Effect Unit) -> (String -> Effect Unit) -> ProtocolData -> NetworkParams -> Effect Unit + , mintGovernanceTokens :: (Unit -> Effect Unit) -> (String -> Effect Unit) -> NetworkParams -> Effect Unit + , createProposal :: (ProposalInfo -> Effect Unit) -> (String -> Effect Unit) -> ProtocolData -> PProposalParameters -> NetworkParams -> Effect Unit + , vote :: (Unit -> Effect Unit) -> (String -> Effect Unit) -> ProtocolData -> VoteData -> NetworkParams -> Effect Unit } main :: Contracts @@ -32,4 +40,8 @@ main = Contracts , receiveFunds: ReceiveFunds.runReceiveFunds , getAllFundraisings: AllFundraisings.runGetAllFundraisings , getUserRelatedFundraisings: UserRelatedFundraisings.runGetUserRelatedFundraisings + , mintGovernanceTokens: GovTokens.runMintGovernanceTokens + , createProposal: CreateProposal.runCreateProposal + , vote: Vote.runVote } + diff --git a/scripts/governance.plutus b/scripts/governance.plutus new file mode 100644 index 0000000..bb51fdd --- /dev/null +++ b/scripts/governance.plutus @@ -0,0 +1,5 @@ +{ + "cborHex": "59166b59166801000032323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232322222323232323232323232323232323253330463370e66606800a6eb8c130c100049220113446f6e6174506f6f6c476f7665726e616e636500480084c8c8c8c8c8c8c8c8c94ccc13cc8ccc1400052825153301d3375e60aa01060aa0082a6603a66ebcc15401cc15400c54cc074cdd7982a803182a8010a9980e99baf3055005305500113375e60aa60a800a60aa60a80022646464646464a6660aa66e24088dd6982d8020a99982a99b87001337000446eb4c16c0104c8c94ccc15ccc0b400800454ccc15ccdc39998229bab305d30273051005375c60ba02606490010a99982b99b87333045375660ba604e60a200a6eb8c1740480e12002132323232323232323232323253330633305a30690073069021153330633375e60d200660d20262a6660c6a6606266ebcc1a4018dd424000266ebcc1a4014dd4240002a6660c666460b244a6660ce002294054cc190c00cc1b00044c008c1ac0048cdd79835182f00098350029bac3069305d3069305d02c153330633375e60d260d00026ea120001325333064332305a22533306800114a02a6660ce66ebcc1b400400c5288980118360009ba93232323253330683370e90010010a99837a490333313200161375c60dc00260e000460e00026ea8c1acc17c004c1a800cdd61835191835183518351835181a800982f0008a9998321982d9981b1835183480f98350011981b1835183480f9991191ba8337006eb4008dd68009ba83370466e080092078483403cdd69835182818348099835183480f899191919191929998351983081a8028992999835998208150008a4c2a660e4921033831330016375660e060de60c800c2a660e2920103383132001653330693370e90000010991919191919191919299983929983819b87001480004cdc3800a40702646464a6660ea66e24dc6800a40802646464646493299983d0008a4c2a66100020f62c60fa0066eb4004c1f0004c1e800c54cc1f01e058dd7000983c800983b8020a9983c83b0b1b8d001375c00260ea00260e60066eb4004c1c8004c1c000cdd680098378008a998380388b183880118388009baa001304e0013047333222333305a003001233055305e32306f3063001306e306d3062001003153306e4912063616e27742067657420616e7920636f6e74696e75696e67206f757470757473001632375860d660be00260d460bc05a646eb0c1acc144c17c004c1a8c1780b4c1700b454cc1ad240104313331350016153306b4910338303500163069305d02c153306a4901033831340016153306a491115554784f206e6f7420636f6e73756d65640016153306a491033831300016153306a491033830390016153306a4910338303800163067001306600130650013064001306300130620013056005533305b3370e900000109919191919191919191919191919191919191919191919191919191919299983c19b89480000044c8c8c8c8c926533307d001149854cc20c041f858c2000400cdd6800983f800983e8018a9983f8398b1bad001307c001307a00653330743370e900000109919191919191919191919191924ca666102020022930a9984380841008b184200803299983f19b87480000084c8c8c8c8c8c8c926533308501001149854cc22c042180458c220040194ccc20804cdc3a4000004264646464646464932999844808008a4c2a6611e02114022c61180200ca66610c0266e1d2000002132325333088013370e6e340052038132324994ccc2280400452615330900108b0116308d01003153308f010840116375c0026118020022a66610c0266e1d2002002132325333088013370e6e340052038132324994ccc2280400452615330900108b0116308d01003153308f010850116375c0026118020022a6611a0211c022c611c02004611c020026ea8004c2200400454ccc20804cdc3a4004004264646464646464646464932999846008008a4c2a661240211a022c611e020066eb4004c23804004c2300400cdd68009845808009844808019bad00130880100115330890108a0116308a01002308a0100137540026108020022a6660fc66e1d20020021324994ccc1fc00452615330850108001161533085010860116308601002308601001375400261000200260fc00ca6660f066e1d200000213232533307a3370e6e340052038132324994ccc1f000452615330820107d16307f00315330810107616375c00260fc0022a6660f066e1d200200213232533307a3370e6e340052038132324994ccc1f000452615330820107d16307f00315330810107716375c00260fc0022a660fe100022c6100020046100020026ea8004c1e800454cc1ec1f058c1f0008c1f0004dd5000983b000983a0019bad00130730013071006533306b3370e900000109919299983699b873077001480004c94ccc1b8cdd79ba705f374e60e6002264a6660de66e1cdc6800a40802646464646493299983a0008a4c2a660f40ea2c60ee0066eb4004c1d8004c1d001454cc1d815458dd7183a0008a9983a82a8b183b0008a9983a02a8b1baa001307100115330720731630730023073001375400260da00260d60066eb4004c1a8004c1a000cdd680098338009832803299982f99b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c926533306f001149854cc1d41c058c1c800cdd6800983880098378019bad001306e001306c003375a00260d600260d20066eb4004c1a0004c19800cdd680098328008a998330338b183380118338009baa001306100115330620631630630023063001375400260800102a660bc921033831370016153305e491033831360016153305e49103383037001632332302f233300237560024644460040066e9800448940048c94ccc164d5d180089128008911801001998179299982c99baf0013750900009128008911801001800800999119991818911ba63300337560046eac00488ccc0c888dd419b80375a0046eb4004008004008004ccc0c8dd7182e009018a40046660646eb8c1700440dd20025333056002100213330553375e60be60b60046ea40dcc16800800854cc171241033830360016153305c49103383034001653330550011480004ccc150cdd7982f182d0009ba9036375a60ba60b46eacc174c1680052000375660b260b0609a00860b0609803660ac00260940366460666607a608c002646eb0c15cc0f4c12c004c158c128064c15403054cc159240103383032001630530013052001305100130453051009304f001304e001304d00130410013232323232323035005533304b3370e900000109919191919191919191919191919191919191919191919191919191924ca6660ce0022930a998368340b1835003299983219b87480000084c8c94ccc198cdc39838000a4000264a6660ce66ebcdd382c1ba7306c00113253330683370e6e340052040132323232324994ccc1b4004526153307306e163070003375a00260de00260da00a2a660de09c2c6eb8c1b400454cc1b813858c1bc00454cc1b413858dd500098350008a998358360b183600118360009baa00130660013064006533305e3370e900000109919191919191919191919191924ca6660d60022930a998388360b1837003299983419b87480000084c8c8c8c8c8c8c926533306f001149854cc1d41c058c1c80194ccc1b0cdc3a40000042646464646464649329998398008a4c2a660f20e82c60ec00ca6660e066e1d20000021323253330723370e6e340052038132324994ccc1d0004526153307a075163077003153307906e16375c00260ec0022a6660e066e1d20020021323253330723370e6e340052038132324994ccc1d0004526153307a075163077003153307906f16375c00260ec0022a660ee0f02c60f000460f00026ea8004c1c800454ccc1b0cdc3a400400426464646464646464646493299983b0008a4c2a660f80ee2c60f20066eb4004c1e0004c1d800cdd6800983a80098398019bad001307200115330730741630740023074001375400260dc0022a6660d066e1d20020021324994ccc1a4004526153306f06a16153306f0701630700023070001375400260d400260d000ca6660c466e1d20000021323253330643370e6e340052038132324994ccc198004526153306c067163069003153306b06016375c00260d00022a6660c466e1d20020021323253330643370e6e340052038132324994ccc198004526153306c067163069003153306b06116375c00260d00022a660d20d42c60d400460d40026ea8004c19000454cc19419858c198008c198004dd50009830000982f0019bad001305d001305b003375a00260b400260b00066eb4004c15c004c15400cdd6800982a00098290019bad0013051001153305205316305300230530013754606200266644464a6660980022a660a4921033331300016132533304d001130520021533053490103333131001630500013303723370e6660726eacc144c140c11400401000d2002332304022533304e001103e13303f3003305300130023052001230513050304500132375860a260a0608a00260a060880026eb8c134004dd71826982600080818200090a99826a481033830310016304a00130490013048001303c00c3756608e608c607600264608e608c60760026666066646eb0c11cc0ec004c118c0e8024c0e0024800454cc11d241033330350016533303f3370e90000010991919191919191919191919191919299982729982619b87001480004cdc3800a4070264646464a6660a4a660a066e1c005200013370e002901c0991919299982a99b89480000044c8c9265333057001149854cc17416058c16800c54cc17014058dd6800982c800982b8020a9982c82b0b1b8d001375c00260aa00260a60082a660aa0a42c6e34004dd700098288009827803299982499b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c9265333056001149854cc17015c58c1640194ccc14ccdc3a400000426464646464646493299982d0008a4c2a660c00b62c60ba00ca6660ae66e1d20000021323232323232324994ccc178004526153306405f163061006533305b3370e900000109919299982e99b87371a002901c0991924ca6660be0022930a998328300b18310018a9983202c8b1bae00130610011533305b3370e900100109919299982e99b87371a002901c0991924ca6660be0022930a998328300b18310018a9983202d0b1bae001306100115330620631630630023063001375400260ba0022a6660ae66e1d20020021323232323232323232324994ccc1840045261533067062163064003375a00260c600260c20066eb4004c180004c17800cdd6800982e8008a9982f02f8b182f801182f8009baa0013059001153330533370e900100109924ca6660a80022930a9982d02a8b0a9982d02d8b182d801182d8009baa00130550013053006533304d3370e900000109919299982799b87371a002901c0991924ca6660a20022930a9982b8290b182a0018a9982b0258b1bae00130530011533304d3370e900100109919299982799b87371a002901c0991924ca6660a20022930a9982b8290b182a0018a9982b0260b1bae0013053001153305405516305500230550013754002609e0022a660a00a22c60a200460a20026ea8004c12c004c1240194ccc10ccdc3a40000042646464646464646464646464646464649329998298008a4c2a660b20a82c60ac0066eb4004c154004c14c00cdd6800982900098280019bad001304f001304d003375a002609800260940066eb4004c12400454cc12812c58c12c008c12c004dd500098228008a998230238b182380118238009baa006533303b3370e90000010991919191919191919299982229982119b87001480004cdc3800a40702646464a66608e66e24dc6800a4080264646464649329998260008a4c2a660a409a2c609e0066eb4004c138004c13000c54cc13812858dd7000982580098248020a998258240b1b8d001375c002608e002608a0066eb4004c110004c10800cdd680098208008a998210218b182180118218009baa003482024bd00488ccc0d000800400c5281181b18010009181a980e000911980199ba548008cc088008084cdd2a400466044002042446600666e95200033021002330210040203374a900019810800998108020101119ba548000cc080008cc08000407d300103d87a8000223375e6e98008dd300091198101129998170008806899199802981b981a00111981099bb0303930350030010021001300230320010012223333004003220020020012301d3002001223232233001003002222533302d00113301e0030021323232533302f3375e00400226604266ec0008cc024c0e0018c0e000cccc02088008014c0d001054ccc0bccdc81bae002375c00226604200c666601044002006606800800a26604200666660104400200c00a60680086070004606e008606400244a666056004200226666006440026060004605e00400291010a50726f706f73616c49640022253330273370e002900008038998020019980280100091198021ba9002374c00244660066ea4008dd4000911980a99bb00020010034bd6f7b63024411050726f706f73616c5665726966696564004881002533301f00115330250021613253330200011302500215330260041630230014910333303600490103333037004901257074727946726f6d2854784964293a206d757374206265203332206279746573206c6f6e670049012a7074727946726f6d2854784964293a20636f6e7374727563746f72206669656c6473206c656e203e2031004901267074727946726f6d2854784964293a20696e76616c696420636f6e7374727563746f72206964002323232533301b3370e90010010a998110028b0a99980d99b87480100084c08400454cc08801858c08c008c08c004dd5180f18021809000a490333303200490103333031002301a301a001230092253330170011007132533301730040011330090013003301c00213003301c002301c0012223333004002480008cccc014009200075a6eac00400c8c008dd480091111980491299980b80088028a99980b19baf3020301c00100613004301f301c00113002301b0010014bd702ba0223300330050010023001222533301000112250011533300f3002301500113222300200330150011330030023014001232300223300200200123002233002002001223300300230123006001223375e6e9cc014008dd398028009191919299980619b87480080084c04800454cc04c01458c050008c050004dd5180798071801800a4903333034002301037540029201257074727946726f6d28504f53495854696d65293a206d75737420626520706f7369746976650049012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e670049012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e670023300300100214a2ae6955cfa481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f004901327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67004901387074727946726f6d2843757272656e637953796d626f6c293a206d757374206265203238206279746573206c6f6e67206f7220656d707479005744ae855ce2493f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72005573caae75", + "description": "Governance validator", + "type": "PlutusScriptV2" +} \ No newline at end of file diff --git a/scripts/governancePolicy.plutus b/scripts/governancePolicy.plutus new file mode 100644 index 0000000..5a71d3d --- /dev/null +++ b/scripts/governancePolicy.plutus @@ -0,0 +1,5 @@ +{ + "cborHex": "59012b5901280100003232323232322223232323232533300b332323230022330020020012300223300200200122533300f00114a02a6646601e0022944c00cc0300044c008d5d1000919baf300a300b0010093758601260146012601400c2930a99806a49115554784f206e6f7420636f6e73756d656400163008300900553330093370e900000109924ca6660140022930a99805a481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016153300b4913f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f720016300b00235573a0026ea80095d0918029baa0015734aae7d5ce2ab9e1", + "description": "Governance Minting Policy", + "type": "PlutusScriptV2" +} \ No newline at end of file diff --git a/scripts/proposal.plutus b/scripts/proposal.plutus new file mode 100644 index 0000000..5626824 --- /dev/null +++ b/scripts/proposal.plutus @@ -0,0 +1,5 @@ +{ + "cborHex": "591a1a591a170100003232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323222223232323232323232323232323232323232323232323232323232323232323232323232325333081013370e6660ba0346eb8c21404c2100405922010a50726f706f73616c4964004800854ccc20404cdc399982e80d1bae3085013084010194891050726f706f73616c566572696669656400480084c94ccc20804cc8c1cc894ccc218040045280a9998428099baf30890100100314a2260046110020026ea4004dd6184300991843009833000983b80e8a9998410099baf3086013085010103750900009919191929998430099984300800a504a22a66610c0266ebcc22804068c2280403454ccc21804cdd798450080b9845008050a9998430099baf308a01016308a0100915333086013375e61140202a6114020102a66610c0266ebcc22804050c2280401c54ccc21804cdd798450098448080a1845009844808038992999843808008a99984380a9981799b87375a61160201a66e00dd698458080d1bad308b0101d13370e6eb4c22c04030dd698458080c8991919192999845809981c00080589929998460099b87333068375661200260e461020204e6eb8c24004c23c040840052002132533308d0133303700c028001149854cc248040f458c144ccc155c019982e9bae309001308f0102100148008ccc17416c16c17054cc244040f458cc0f4dd69847808111bad308f0102115330900104f16304f333053700046609e6660a6e00004ccc16c164164168ccc168dd71846808009bae308d01308c01001375a611a0203e60ea60fa002660ba6eb8c22c0407c0ac54cc23005241033930380016153330870153302f3370e6eb4c22c04030cdc01bad308b01019375a61160203a266e1cdd69845808069bad308b0101a132323232533308b013303800100b132533308c013370e6660d06eacc24004c1c8c2040409cdd7184800984780810800a4004264a66611a0266606e0180500022930a998490081e8b182899982ab8033305d375c612002611e02042002900119982e82d82d82e0a998488081e8b1981e9bad308f01022375a611e020422a661200209e2c609e6660a6e0008cc13cccc14dc000099982d82c82c82d19982d1bae308d01001375c611a026118020026eb4c2340407cc1d4c1f4004cc174dd718458080f8158a9984600a481033930390016325333087013370e00290010a5115333087013370e00290000a50153308c014901033530310016375a61140203a2a66116029201033931350016153308b01491033931340016153308b01491033930370016153308b01491033930360016153308b01491033930350016153308b01491033930340016153308b014910339313300163232533308701323370e6120026ea80052002308b01308a010021323232533308a013370e90000010a501533308a013370e900100109919b88001008375a611c020022944c24004008c24004004dd5000899191929998450099b874800000854cc20005280a501533308a013370e90010010a99840009919b88001008375a611c0200226466e1c020004dd69847008008a9984000a5114a06120020046120020026ea8004c22804004c1e8c22404c22004c1e8004c8cc88cc88cdd2a4000660ea004660ea00210a0266e9520003307300233073069083013374a900019839800998398348418099ba54800020404cdd2a4004660e2002102026110020246eb4c8c8c94ccc21804cdc3a400400426114020022a6611602921033330380016308c01002308c0100137546461100260f2002610e0260f0002610c0260ca60ee03a2a6610e029201033931320016153308701491033930330016323232325333085013370e90010010a9984500a4810333313200161375c6112020026116020046116020026ea8c21804c1dc004c2140405854cc21805241033930320016153308601491033930310016375661080261060260ea01a61040200261020200261000200260fe00260fc00260fa00260dc00aa6660f066e1d2000002132323232323232323232323232323232323232323232323232323232325333095013371290000008991919191924ca666134020022930a9984f0084d808b184d808019bad001309a01001309801003153309a0108e0116375a002612e02002612a0200ca6661220266e1d20000021323232323232323232323232324994ccc2780400452615330a20109f0116309f01006533309b013370e900000109919191919191924ca666144020022930a9985300851808b185180803299984f8099b87480000084c8c8c8c8c8c8c92653330a601001149854cc2a80429c0458c29c040194ccc28c04cdc3a400000426464a66614a0266e1cdc6800a407026464932999853808008a4c2a6615602150022c6150020062a661540213e022c6eb8004c29c0400454ccc28c04cdc3a400400426464a66614a0266e1cdc6800a407026464932999853808008a4c2a6615602150022c6150020062a6615402140022c6eb8004c29c0400454cc2a0042a40458c2a404008c2a404004dd50009851808008a99984f8099b87480080084c8c8c8c8c8c8c8c8c8c92653330a901001149854cc2b4042a80458c2a80400cdd68009854808009853808019bad00130a60100130a401003375a0026146020022a661480214a022c614a02004614a020026ea8004c27c0400454ccc26c04cdc3a400400426493299984e008008a4c2a661400213a022c2a6614002142022c6142020046142020026ea8004c26c04004c264040194ccc25404cdc3a400000426464a66612e0266e1cdc6800a40702646493299984c808008a4c2a6613a02134022c6134020062a6613802122022c6eb8004c2640400454ccc25404cdc3a400400426464a66612e0266e1cdc6800a40702646493299984c808008a4c2a6613a02134022c6134020062a6613802124022c6eb8004c2640400454cc2680426c0458c26c04008c26c04004dd5000984a808008a9984b0084b808b184b80801184b808009baa001309101001308f01003375a002611c0200261180200ca6661100266e1d200000213232533308a013370e612402002900009929998458099baf374e10e026e9cc238040044c94ccc23004cdc39b8d001481004c8c8c8c8c926533309101001149854cc254042480458c2480400cdd68009848808009847808028a9984880844808b1bae308f010011533090010890116309101001153308f01089011637540026118020022a6611a0211c022c611c02004611c020026ea8004c22004004c2180400cdd68009842808009841808019bad001308201001308001006533307c3370e900000109919191919191919191919191919191924ca666118020022930a9984800846808b1846808019bad001308c01001308a01003375a002611202002610e020066eb4004c21804004c2100400cdd68009841808009840808019bad0013080010011533081010820116308201002308201001375400260f80022a660fa0fc2c60fc00460fc0026ea8004c170004c94ccc1d400454cc1e52401033330360016132533307600113079002153307a490103333037001630770013332223333064003001233062306832307c306d001307b307a306c001003153307b49012063616e27742067657420616e7920636f6e74696e75696e67206f757470757473001632375860f060d200260ee60d002e646eb0c1e0c184c1a4004c1dcc1a005cc19805cc1d4004c1d0004c1cc004c1c8004c1c4004c1c0004c184048c1b8004c1b4004c178038c17403cdd598359835182e0009918359835182e000999982a191bac306b305c001306a305b00a305900a2001153306b49010333303500163069305a00953330643370e900000109919191919191919191919191919192999839a9983499b87001480004cdc3800a40702646493299983a8008a4c2a660f20ec2c60ec0082a660f00d62c6e34004dd7000983a0009839003299983719b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c926533307b001149854cc1fc1f058c1f00194ccc1e0cdc3a400000426464646464646493299983f8008a4c2a6610602100022c61000200ca6660f866e1d20000021323232323232324994ccc20c0400452615330870108401163084010065333080013370e90000010991929998410099b87371a002901c0991924ca666108020022930a9984400842808b1842808018a998438083e0b1bae00130840100115333080013370e90010010991929998410099b87371a002901c0991924ca666108020022930a9984400842808b1842808018a998438083e8b1bae001308401001153308501086011630860100230860100137540026100020022a6660f866e1d20020021323232323232323232324994ccc21804004526153308a010870116308701003375a002610c020026108020066eb4004c20c04004c2040400cdd68009840008008a9984080841008b1841008011841008009baa001307c001153330783370e900100109924ca6660f20022930a9983e83d0b0a9983e83f0b183f001183f0009baa0013078001307600653330723370e900000109919299983a19b87371a002901c0991924ca6660ec0022930a9983d03b8b183b8018a9983c8370b1bae0013076001153330723370e900100109919299983a19b87371a002901c0991924ca6660ec0022930a9983d03b8b183b8018a9983c8378b1bae001307600115330770781630780023078001375400260e40022a660e60e82c60e800460e80026ea8004c1b8004c1b000cdd6800983580098348019bad0013068001153306906a16306a002306a001375400ca6660c066e1d200000213232323232323232323232323232323232323232323232323232323232533307d3371290000008991919191924ca666104020022930a9984300841808b1841808019bad00130820100130800100315330820107616375a00260fe00260fa00ca6660f266e1d20000021323232323232323232323232324994ccc21804004526153308a0108701163087010065333083013370e900000109919191919191924ca666114020022930a9984700845808b18458080329998438099b87480000084c8c8c8c8c8c8c926533308e01001149854cc2480423c0458c23c040194ccc22c04cdc3a400000426464a66611a0266e1cdc6800a407026464932999847808008a4c2a6612602120022c6120020062a661240210e022c6eb8004c23c0400454ccc22c04cdc3a400400426464a66611a0266e1cdc6800a407026464932999847808008a4c2a6612602120022c6120020062a6612402110022c6eb8004c23c0400454cc240042440458c24404008c24404004dd50009845808008a9998438099b87480080084c8c8c8c8c8c8c8c8c8c926533309101001149854cc254042480458c2480400cdd68009848808009847808019bad001308e01001308c01003375a0026116020022a661180211a022c611a02004611a020026ea8004c21c0400454ccc20c04cdc3a4004004264932999842008008a4c2a661100210a022c2a6611002112022c6112020046112020026ea8004c20c04004c204040194ccc1f4cdc3a400000426464a6660fe66e1cdc6800a407026464932999840808008a4c2a6610a02104022c6104020062a66108020f22c6eb8004c2040400454ccc1f4cdc3a400400426464a6660fe66e1cdc6800a407026464932999840808008a4c2a6610a02104022c6104020062a66108020f42c6eb8004c2040400454cc2080420c0458c20c04008c20c04004dd5000983e8008a9983f03f8b183f801183f8009baa00130790013077003375a00260ec00260e800ca6660e066e1d20000021323253330723370e60f40029000099299983999baf374e0de6e9cc1d80044c94ccc1d0cdc39b8d001481004c8c8c8c8c9265333079001149854cc1f41e858c1e800cdd6800983c800983b8028a9983c8388b1bae30770011533078071163079001153307707116375400260e80022a660ea0ec2c60ec00460ec0026ea8004c1c0004c1b800cdd6800983680098358019bad001306a001306800653330643370e900000109919191919191919191919191919191924ca6660e80022930a9983c03a8b183a8019bad00130740013072003375a00260e200260de0066eb4004c1b8004c1b000cdd6800983580098348019bad0013068001153306906a16306a002306a001375400260c80022a660ca0cc2c60cc00460cc0026ea800c88ccc16800800400c528111198021802800998038018011182311299982c8008a50153304e3003305c00113002305b0012233003375660b460b260960020044466ebcdd30011ba6001223303f3003002375860b06082609200244646464a6660ac66e1d200200214a0266e3cdd7182d000802982e001182e0009baa3230583049001305730480014910339313100490103343133002232323232325333055337126e3400520401001153305a008163371400866e2800ccdc500080119b8b48170088dcc18030019b9830050033371690440080fa490336303100303c223372ca66609c66e20005200010031004323253330503370e00490000980380089919b96001300800230040023370a6022004900a19b84301000148051241012d004901002533304a3370e002900008010a99982519b8700148008400c54ccc128cdc3800a400820082a66609466e1c005200610051533304a3370e002900408030a99982519b8700148028401c54ccc128cdc3800a401820102a66609466e1c005200e10091533304a3370e002900808050a99982519b8700148048402c592410130004901013100490101320049010133004901013400490101350049010136004901013700490101380049010139002533303f337120029000898010008800919b814800000524010339313000233002232533303e300500112250011223002003330052533303e3375e0026ea120001225001122300200300100123003233300237560024644460040066e9800448940055d1911981511299981e80088088991998029822182080111981519bb03046304200300100210013002303f001001222333004223330070050020010020012300322374c660066eac008dd580091801111ba833003375a0046eb4004888cccc01000c880080080048c090c00800488c8c88cc00400c0088894ccc0e40044cc09000c0084c8c8c94ccc0eccdd780100089981399bb0002330093042006304200333300822002005303e0041533303b337206eb8008dd7000899813803199980411000801981f002002899813801999980411000803002981f00218210011820802181e00091299981b80108008999980191000981d001181c801000a44100482024bd0048894ccc0c8cdc3800a4000200e2660080066600a00400244660086ea4008dd300091198019ba90023750002446603466ec000800400d2f5bded8c0446464646464603200aa66606066e1d20000021323232323232323232533303953302f3370e0029000099b87001480e04c8c8c94ccc0f0cdc49b8d001481004c8c8c8c8c9265333041001149854cc11410858c10800cdd68009820800981f8018a998208098b1bae001303e001303c004153303e03116371a0026eb8004c0e8004c0e000cdd6800981b800981a8019bad0013034001153303503616303600230360013754602a00266600800401a0029201327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e670022232533302d001153303100516132533302e00113031002153303200716302f0013301633006003002300a00149010333313000490103333131002223370e6660086eacc0b0c0acc07400400c00920022223333004002480008cccc014009200075a6eac00400c8c008dd480091111980b11299981480088028a99981419baf3030302c00100613004302f302c00113002302b0010012330022302730263018001323758604e604c6030002604c602e0024602244a666048002203e26601e6006604e0026004604c002910113446f6e6174506f6f6c476f7665726e616e6365004c0103d87a80002302130020012302030020012301f30020012301e30020012301d30070012323232533301c3370e90010010a998108028b0a99980e19b87480100084c08000454cc08401858c088008c088004dd5180e98031807000a49033330320049010333303100230062253330190011014132533301930040011330050013003301c00213003301c002301c00157404602e602e0024466006600a0020046002444a66602a002244a0022a666028600460300022644460040066030002266006004602e0024646004466004004002460044660040040024466006004602a600c0024466ebcdd398028011ba73005001232323253330113370e90010010980a8008a9980b0028b180b801180b8009baa3012301130030014901033330340023013375400246601600200429452401387074727946726f6d2843757272656e637953796d626f6c293a206d757374206265203238206279746573206c6f6e67206f7220656d707479004901257074727946726f6d28504f53495854696d65293a206d75737420626520706f7369746976650049012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e670049012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e67004bd70249257074727946726f6d2854784964293a206d757374206265203332206279746573206c6f6e670049012a7074727946726f6d2854784964293a20636f6e7374727563746f72206669656c6473206c656e203e2031004901267074727946726f6d2854784964293a20696e76616c696420636f6e7374727563746f72206964005734aae7d241317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f005744ae855ce2493f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72005573caae75", + "description": "Proposal validator", + "type": "PlutusScriptV2" +} \ No newline at end of file diff --git a/scripts/proposalPolicy.plutus b/scripts/proposalPolicy.plutus new file mode 100644 index 0000000..5f6cf1e --- /dev/null +++ b/scripts/proposalPolicy.plutus @@ -0,0 +1,5 @@ +{ + "cborHex": "5905c05905bd0100003232323232323232323232323232323232323232323232323232323232323232322223232323232323253330213370e9000001099191919299981299b874800000854ccc094cdc399980b9bab302c300f3023302c004375c60580026eb8c0b00152002153330253301623375e605a604800201e6eb0c0b0c08cc0b0c08c030526153302d4901115554784f206e6f7420636f6e73756d65640016153302d01316153302d01416302d002302d00137546052604e002603e0102a66604266e1d200200213232323253330253370e90000010a99981299b8733301737566058601e604660580086eb8c0b0004dd718160029809240042930a998168098b0a9981680a0b181680118168009baa30293027001301f008153330213370e9003001099299981119809919b8733301537566054605060420020040269001180c0048a99981119809919b8733301537566054605060420026eb8c0a8c0a000c0612002301800913232323253330263370e90000010a99981319b873330183756605a60206048605a0086eb8c0b4004dd718168031809a40042930a9981700a0b0a9981700a8b181700118170009baa302a30280013020009153302a01d16153302a01d16301d00813253330223301323370e66602a6eacc0a8c0a0c08400400804d20023018009153330223301323370e66602a6eacc0a8c0a0c084004dd7181500180c2400460300122930a9981500e8b0a9981500e8b180e804181480118148009baa006533301d3370e900000109919299980f99b89371a00290200991924ca6660440022930a998140118b18120018a998138128b1bae00130240011533301d3370e900100109919299980f99b89371a00290200991924ca6660440022930a998140118b18120018a998138128b1bae00130240011533301d3370e90020010991919299981029980f99b87001480004cdc3800a4070264649329998118008a4c2a660520482c604a0082a660500482c6e34004dd700098120008a99980e99b87480180084c8c94ccc07ccdc49b8d001481004c8c8c8c94ccc08d4cc088cdc3800a4000266e1c0052038132324994ccc098004526153302c027163028004153302b02716371a0026eb8004c09c004c09000c54cc09c09458dd700098120008a99812a493f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f720016302500230250013754004460386004002460366004002460346034002466e052000001490103323034004901435061747465726e206d61746368206661696c75726520696e2027646f2720626c6f636b206174207372632f5368617265642f436865636b732e68733a33373a332d31390048810a50726f706f73616c4964002300822533301400114a02a660226006603200226004602e002444666600800490001199980280124000eb4dd5800801918011ba90012222330082253330140011005153330123375e6038603200200c260086036603200226004602e0020029111050726f706f73616c566572696669656400233002230133011300a00132375860266014002602460120024600444a66601c002200a26600c600660260026004602200246460044660040040024600446600400400297ae057409201033230350023232323253330093370e900000109bae3010001153301100616301100230110013754002601860146006002920103333133002300c3754002466004002006ae68528aab9f4901317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f004901387074727946726f6d2843757272656e637953796d626f6c293a206d757374206265203238206279746573206c6f6e67206f7220656d7074790057449201327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67005742ae7155cf2ab9d1", + "description": "Proposal Thread Minting Policy", + "type": "PlutusScriptV2" +} \ No newline at end of file diff --git a/scripts/verTokenPolicy.plutus b/scripts/verTokenPolicy.plutus index 0e44ac7..1e12feb 100644 --- a/scripts/verTokenPolicy.plutus +++ b/scripts/verTokenPolicy.plutus @@ -1,5 +1,5 @@ { - "cborHex": "5903a35903a0010000323232323232323232323232323232323232323232322223232323232323253330183370e9001001099191919299980e19b874800000854ccc070cdc399980a1bab3021300f301b3021004375c60420026eb8c084014c8cdc0a400000290010a4c2a660440322c2a660440342c604400460440026ea8c078c070004c05c0204c8c8c8c94ccc070cdc3a40000042a66603866e1cccc050dd598109807980d98108021bae3021001375c604200a90010a99980e19808919b8733301537566044604060380026eb8c088c07003cdd718111810180e007a4004664603044a666040002297ae0133574060066048002600460440024604460406038002646eb0c088c070004c084c06c03054ccc070cc0448cdc399980a9bab30223020301c001375c6044603801e6eb8c088c080c07003d2002323758604460326038002604260360182930a9981124810332303600161533022491033230350016153302201916153302201a16302200230220013754603c6038002602e010603c004603c0026ea80194ccc050cdc3a400000426464a66602c66e24dc6800a40802646493299980c0008a4c2a6603a0322c60320062a660380342c6eb8004c06400454ccc050cdc3a400400426464a66602c66e24dc6800a40802646493299980c0008a4c2a6603a0322c60320062a660380342c6eb8004c06400454cc0692413f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f720016301a002301a00137540044602260040024602060120024600e44a66601e002294054cc010c00cc04c0044c008c0440048cc02c0040085289111999802001240004666600a00490003ad3756002006460046ea40048888cc014894ccc034004401454ccc030cdd7980a18088008030980218099808800898011807800800919180111980100100091801119801001000918041804000a4903323034004901435061747465726e206d61746368206661696c75726520696e2027646f2720626c6f636b206174207372632f5368617265642f436865636b732e68733a33373a332d313900230093754002ae6955cfa481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0057449201327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67005742ae7155cf2ab9d1", + "cborHex": "5904b95904b60100003232323232323232323232323232323232323232323232323232323232322223232323232323253330203370e9001001099191919299981219b874800000854ccc090cdc399980c9bab3029301030233029004375c60520026eb8c0a4014c8cdc0a400000290010a4c2a660540422c2a660540442c605400460540026ea8c098c090004c07c02054ccc080cdc3a4008004264646464a66604866e1d2000002153330243370e6660326eacc0a4c040c08cc0a4010dd718148009bae30290054800854ccc090cc0588cdc399980d1bab302a30283024001375c6054604801e020900118090060a9998121980b119b8733301a37566054605060480026eb8c0a8c09003c0412002301d00c149854cc0a807c5854cc0a80805854cc0a80845854cc0a808858c0a8008c0a8004dd518131812000980f804099191919299981219b874800000854ccc090cdc399980c9bab3029301030233029004375c60520026eb8c0a40152002153330243301623370e6660346eacc0a8c0a0c090004dd7181518120079bae302a3028302400f48008c04803054ccc090cc0588cdc399980d1bab302a30283024001375c6054604801e6eb8c0a8c0a0c09003d2002301d00c149854cc0a807c5854cc0a80805854cc0a80845854cc0a808858c0a8008c0a8004dd518131812000980f804181300118130009baa006533301c3370e900000109919299980f19b89371a00290200991924ca6660400022930a998128108b18108018a998120110b1bae00130210011533301c3370e900100109919299980f19b89371a00290200991924ca6660400022930a998128108b18108018a998120110b1bae00130210011533301c3370e900200109919299980f19b89371a00290200991924ca6660400022930a998128108b18108018a998120110b1bae001302100115330224913f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001630220023022001375400491113446f6e6174506f6f6c476f7665726e616e63650023018300200123017300e001233002230193017301300132375860326026002603060240024601444a66602a002200826600a600660320026004602e00297ae057404600e44a666024002294054cc010c00cc0580044c008c0500048cc0380040085289111999802001240004666600a00490003ad3756002006460046ea40048888cc014894ccc040004401454ccc03ccdd7980b980a00080309802180b180a0008980118090008009191801119801001000918011198010010009191bac300e30033008001300d30070012300a300a001491033230360049010332303500490103323034004901435061747465726e206d61746368206661696c75726520696e2027646f2720626c6f636b206174207372632f5368617265642f436865636b732e68733a33373a332d313900230093754002ae6955cfa481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0057449201327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e67005742ae7155cf2ab9d1", "description": "Verification token", "type": "PlutusScriptV2" } \ No newline at end of file diff --git a/src/Ext/Data/BigInt.purs b/src/Ext/Data/BigInt.purs new file mode 100644 index 0000000..d068fe3 --- /dev/null +++ b/src/Ext/Data/BigInt.purs @@ -0,0 +1,8 @@ +module Ext.Data.BigInt where + +import Prelude +import Data.BigInt (BigInt, toString) + +-- Eq for BigInt and Number doesn't work :( +eqBigInt :: BigInt -> BigInt -> Boolean +eqBigInt n1 n2 = toString n1 == toString n2 diff --git a/src/Ext/Data/Maybe.purs b/src/Ext/Data/Maybe.purs index b16b676..92bee92 100644 --- a/src/Ext/Data/Maybe.purs +++ b/src/Ext/Data/Maybe.purs @@ -1,9 +1,15 @@ module Ext.Data.Maybe where import Prelude + +import Contract.Monad (Contract) import Data.Maybe (maybe, Maybe) -import Effect.Exception (throw) import Effect (Effect) +import Effect.Class (liftEffect) +import Effect.Exception (throw) maybeM :: forall a. String -> Maybe a -> Effect a -maybeM errMsg = maybe (throw errMsg) pure \ No newline at end of file +maybeM errMsg = maybe (throw errMsg) pure + +maybeC :: forall a. String -> Maybe a -> Contract a +maybeC errMsg = maybe (liftEffect $ throw errMsg) pure diff --git a/src/Ext/Seriaization/Key.purs b/src/Ext/Serialization/Key.purs similarity index 100% rename from src/Ext/Seriaization/Key.purs rename to src/Ext/Serialization/Key.purs diff --git a/src/Ext/Serialization/Token.purs b/src/Ext/Serialization/Token.purs new file mode 100644 index 0000000..3db86bc --- /dev/null +++ b/src/Ext/Serialization/Token.purs @@ -0,0 +1,17 @@ +module Ext.Serialization.Token where + +import Contract.Prelude +import Contract.Monad (Contract, liftContractM) +import Contract.Value as Value +import Ctl.Internal.Plutus.Types.CurrencySymbol (CurrencySymbol, mkCurrencySymbol) +import Ctl.Internal.Types.ByteArray (byteArrayFromAscii, hexToByteArray) + +deserializeCurrency ∷ String → Contract CurrencySymbol +deserializeCurrency currencyString = + liftContractM "Impossible to get protocol currency symbol" $ + (hexToByteArray currencyString >>= mkCurrencySymbol) + +deserializeTokenName :: String -> Contract Value.TokenName +deserializeTokenName tokenName = + liftContractM "Impossible to get protocol token name" $ + (byteArrayFromAscii tokenName >>= Value.mkTokenName) \ No newline at end of file diff --git a/src/Governance/Config.purs b/src/Governance/Config.purs new file mode 100644 index 0000000..2ecec44 --- /dev/null +++ b/src/Governance/Config.purs @@ -0,0 +1,32 @@ +module Governance.Config where + +import Contract.Prelude + +import Contract.Monad (Contract) +import Contract.Value (TokenName) +import Contract.Value as Value +import Data.Argonaut.Decode (decodeJson, parseJson) +import Effect (Effect) +import Ext.Data.Either (eitherM) +import Ext.Serialization.Token (deserializeCurrency, deserializeTokenName) +import Node.Encoding (Encoding(..)) +import Node.FS.Sync (readTextFile) + +type GovernanceConfig = + { governanceCurrency :: String + , governanceTokenName :: String + } + +readGovernanceConfig :: Effect GovernanceConfig +readGovernanceConfig = do + content <- readTextFile UTF8 "conf/governance.conf" + jsonContent <- liftEffect $ eitherM "Can't parse governance config file: " $ parseJson content + (governanceConfig :: GovernanceConfig) <- liftEffect $ eitherM "Can't decode GovernanceConfig: " $ (decodeJson jsonContent) + pure governanceConfig + +getGovTokenFromConfig ∷ Contract (Value.CurrencySymbol /\ TokenName) +getGovTokenFromConfig = do + conf <- liftEffect $ readGovernanceConfig + cs <- deserializeCurrency conf.governanceCurrency + tn <- deserializeTokenName conf.governanceTokenName + pure (cs /\ tn) diff --git a/src/Governance/Datum.purs b/src/Governance/Datum.purs new file mode 100644 index 0000000..7828651 --- /dev/null +++ b/src/Governance/Datum.purs @@ -0,0 +1,53 @@ +module Governance.Datum where + +import Contract.Prelude + +import Contract.PlutusData (class HasPlutusSchema, type (:+), type (:=), type (@@), I, PNil, Z, genericToData) +import Ctl.Internal.FromData (class FromData, genericFromData) +import Ctl.Internal.ToData (class ToData) +import Data.BigInt (BigInt) +import Data.Newtype (class Newtype) +import Prelude (class Eq, class Ord) +import Ctl.Internal.Plutus.Types.CurrencySymbol (CurrencySymbol) +import Ctl.Internal.Types.TokenName (TokenName) + +newtype GovernanceDatum = GovernanceDatum + { quorum :: BigInt + , fee :: BigInt + , govCurrency :: CurrencySymbol + , govTokenName :: TokenName + , duration :: BigInt + } + +derive newtype instance Show GovernanceDatum +derive instance Generic GovernanceDatum _ +derive instance Newtype GovernanceDatum _ + +instance + HasPlutusSchema + GovernanceDatum + ( "GovernanceDatum" + := + ( "quorum" := I BigInt + :+ "fee" + := I BigInt + :+ "govCurrency" + := I CurrencySymbol + :+ "govTokenName" + := I TokenName + :+ "duration" + := I BigInt + :+ PNil + ) + @@ Z + :+ PNil + ) + +derive newtype instance Eq GovernanceDatum +derive newtype instance Ord GovernanceDatum + +instance ToData GovernanceDatum where + toData = genericToData + +instance FromData GovernanceDatum where + fromData = genericFromData diff --git a/src/Governance/GovernanceScript.js b/src/Governance/GovernanceScript.js new file mode 100644 index 0000000..879a983 --- /dev/null +++ b/src/Governance/GovernanceScript.js @@ -0,0 +1,13 @@ +let script; +if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) { + script = require("Scripts/governance.plutus"); +} else { + const fs = require("fs"); + const path = require("path"); + script = fs.readFileSync( + path.resolve(__dirname, "../../scripts/governance.plutus"), + "utf8" + ); +} + +exports.governanceValidator = script; diff --git a/src/Governance/GovernanceScript.purs b/src/Governance/GovernanceScript.purs new file mode 100644 index 0000000..17e2589 --- /dev/null +++ b/src/Governance/GovernanceScript.purs @@ -0,0 +1,43 @@ +module Governance.GovernanceScript where + +import Contract.Prelude +import Ext.Contract.Value (mkTokenName) + +import Contract.Monad (Contract, liftContractE, liftContractM) +import Contract.PlutusData (PlutusData, toData) +import Contract.Scripts (Validator(..), PlutusScript, ApplyArgsError, applyArgs, validatorHash, ValidatorHash) +import Contract.TextEnvelope (decodeTextEnvelope, plutusScriptV2FromEnvelope) +import Contract.Value as Value +import Control.Monad.Error.Class (liftMaybe) +import Data.Array (singleton) as Array +import Effect.Exception (error) +import Protocol.Models (Protocol) + +foreign import governanceValidator :: String + +governanceValidatorScript :: Protocol -> Contract Validator +governanceValidatorScript protocol = do + script <- liftMaybe (error "Error decoding governanceValidator") do + envelope <- decodeTextEnvelope governanceValidator + plutusScriptV2FromEnvelope envelope + res <- liftContractE $ mkGovernanceValidatorScript script protocol + pure $ Validator res + +mkGovernanceValidatorScript + :: PlutusScript + -> Protocol + -> Either ApplyArgsError PlutusScript +mkGovernanceValidatorScript unappliedValidator protocol = + let + validatorArgs :: Array PlutusData + validatorArgs = Array.singleton (toData protocol) + in + applyArgs unappliedValidator validatorArgs + +getGovernanceValidatorHash :: Protocol -> Contract ValidatorHash +getGovernanceValidatorHash protocol = do + validator <- governanceValidatorScript protocol + pure $ validatorHash validator + +governanceTokenName :: Contract Value.TokenName +governanceTokenName = liftContractM "Can't make governance thread token name" $ mkTokenName "DonatPoolGovernance" diff --git a/src/Governance/MintGovernanceTokens.purs b/src/Governance/MintGovernanceTokens.purs new file mode 100644 index 0000000..ef7e591 --- /dev/null +++ b/src/Governance/MintGovernanceTokens.purs @@ -0,0 +1,55 @@ +module Governance.MintGovernanceTokens where + +import Contract.Prelude + +import Contract.Log (logInfo') +import Contract.Monad (Contract, liftContractM) +import Contract.ScriptLookups as Lookups +import Contract.TxConstraints as Constraints +import Contract.Value as Value +import Data.BigInt (BigInt, fromInt) +import Ext.Contract.Value (currencySymbolToString, mkCurrencySymbol, tokenNameToString) +import Shared.MintingPolicy.GovernancePolicyScript (GovernanceTokensRedeemer(..), governanceMintingPolicy, governanceTokenName) +import Shared.NetworkData (NetworkParams) +import Shared.OwnCredentials (OwnCredentials(..), getOwnCreds) +import Shared.RunContract (runContractWithResult) +import Shared.Tx (completeTx, toRedeemer) + +-- NOTE: Dont' forget to copy governance token currency from logs to conf/governance.conf manually +runMintGovernanceTokens :: (Unit -> Effect Unit) -> (String -> Effect Unit) -> NetworkParams -> Effect Unit +runMintGovernanceTokens onComplete onError networkParams = do + runContractWithResult onComplete onError networkParams (mintGovernanceTokens $ fromInt 50000) + +mintGovernanceTokens :: BigInt -> Contract Unit +mintGovernanceTokens amount = do + logInfo' "Minting governance tokens" + + ownCreds'@(OwnCredentials ownCreds) <- getOwnCreds + governanceMp /\ governanceCs <- mkCurrencySymbol (governanceMintingPolicy ownCreds.nonCollateralORef) + governanceTn <- governanceTokenName + let governanceNft = Value.singleton governanceCs governanceTn amount + let + constraints :: Constraints.TxConstraints Void Void + constraints = + Constraints.mustSpendPubKeyOutput ownCreds.nonCollateralORef + <> Constraints.mustMintValueWithRedeemer (toRedeemer $ PMintGovernanceTokens) governanceNft + <> Constraints.mustPayToPubKeyAddress ownCreds.ownPkh ownCreds.ownSkh governanceNft + <> Constraints.mustBeSignedBy ownCreds.ownPkh + + lookups :: Lookups.ScriptLookups Void + lookups = + Lookups.mintingPolicy governanceMp + <> Lookups.unspentOutputs ownCreds.ownUtxos + + completeTx lookups constraints ownCreds' + + let governanceCurrencyString = currencySymbolToString governanceCs + governanceTnString <- liftContractM "Impossible to decode Protocol token name" $ tokenNameToString governanceTn + + let + governanceConfig = + { governanceCurrency: governanceCurrencyString + , governanceTokenName: governanceTnString + } + + logInfo' $ "Governance tokens minted successfully: " <> show governanceConfig diff --git a/src/Governance/Redeemer.purs b/src/Governance/Redeemer.purs new file mode 100644 index 0000000..6d4a0ff --- /dev/null +++ b/src/Governance/Redeemer.purs @@ -0,0 +1,30 @@ +module Governance.Redeemer where + +import Contract.Prelude + +import Contract.PlutusData (class HasPlutusSchema, class ToData, type (:+), type (:=), type (@@), PNil, Z, genericToData) +import Contract.Value as Value +import Ctl.Internal.Plutus.Types.Address (Address) +import Ctl.Internal.Types.Interval (POSIXTime) +import Proposal.Model (PProposalParameters) + +type PProposalAddress = Address +type PProposalThreadCurrency = Value.CurrencySymbol +type PProposalVerCurrency = Value.CurrencySymbol +type PProposalStartedAt = POSIXTime + +data PGovernanceRedeemer = PCreateProposal PProposalParameters PProposalAddress PProposalThreadCurrency PProposalVerCurrency PProposalStartedAt + +derive instance Generic PGovernanceRedeemer _ + +instance + HasPlutusSchema + PGovernanceRedeemer + ( "PCreateProposal" + := PNil + @@ Z + :+ PNil + ) + +instance ToData PGovernanceRedeemer where + toData = genericToData diff --git a/src/Governance/UserData.purs b/src/Governance/UserData.purs new file mode 100644 index 0000000..caa4116 --- /dev/null +++ b/src/Governance/UserData.purs @@ -0,0 +1,14 @@ +module Governance.UserData where + +import Contract.Prelude + +import Data.BigInt (BigInt) + +newtype StartGovernanceData = StartGovernanceData + { quorum :: BigInt + , fee :: BigInt + , duration :: BigInt + } + +derive newtype instance Show StartGovernanceData +derive newtype instance Eq StartGovernanceData diff --git a/src/MintingPolicy/GovernancePolicyScript.js b/src/MintingPolicy/GovernancePolicyScript.js new file mode 100644 index 0000000..6cc288c --- /dev/null +++ b/src/MintingPolicy/GovernancePolicyScript.js @@ -0,0 +1,13 @@ +let script; +if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) { + script = require("Scripts/governancePolicy.plutus"); +} else { + const fs = require("fs"); + const path = require("path"); + script = fs.readFileSync( + path.resolve("scripts/governancePolicy.plutus"), + "utf8" + ); +} + +exports.governancePolicy = script; \ No newline at end of file diff --git a/src/MintingPolicy/GovernancePolicyScript.purs b/src/MintingPolicy/GovernancePolicyScript.purs new file mode 100644 index 0000000..48ea0ed --- /dev/null +++ b/src/MintingPolicy/GovernancePolicyScript.purs @@ -0,0 +1,55 @@ +module Shared.MintingPolicy.GovernancePolicyScript where + +import Contract.Prelude + +import Contract.Monad (Contract, liftContractE, liftContractM) +import Contract.PlutusData (class HasPlutusSchema, class ToData, type (:+), type (:=), type (@@), PNil, PlutusData, Z, genericToData, toData) +import Contract.Scripts (MintingPolicy(PlutusMintingPolicy), PlutusScript, ApplyArgsError, applyArgs) +import Contract.TextEnvelope (decodeTextEnvelope, plutusScriptV2FromEnvelope) +import Contract.Transaction (TransactionInput) +import Contract.Value as Value +import Control.Monad.Error.Class (liftMaybe) +import Data.Array (singleton) as Array +import Effect.Exception (error) +import Ext.Contract.Value (mkTokenName) + +foreign import governancePolicy :: String + +governanceMintingPolicy :: TransactionInput -> Contract MintingPolicy +governanceMintingPolicy = + map PlutusMintingPolicy <<< mintGovernancePolicyScript + +mintGovernancePolicyScript :: TransactionInput -> Contract PlutusScript +mintGovernancePolicyScript param = do + script <- liftMaybe (error "Error decoding nftPolicy") do + envelope <- decodeTextEnvelope governancePolicy + plutusScriptV2FromEnvelope envelope + liftContractE $ mkMintGovernancePolicy script param + +mkMintGovernancePolicy + :: PlutusScript + -> TransactionInput + -> Either ApplyArgsError PlutusScript +mkMintGovernancePolicy unappliedMintingPolicy param = + let + mintingPolicyArgs :: Array PlutusData + mintingPolicyArgs = Array.singleton (toData param) + in + applyArgs unappliedMintingPolicy mintingPolicyArgs + +governanceTokenName :: Contract Value.TokenName +governanceTokenName = liftContractM "Cannot make token name" <<< mkTokenName $ "DonatPool_governance_testnet" + +data GovernanceTokensRedeemer = PMintGovernanceTokens + +derive instance Generic GovernanceTokensRedeemer _ + +instance + HasPlutusSchema + GovernanceTokensRedeemer + ( "PMintGovernanceTokens" := PNil @@ Z + :+ PNil + ) + +instance ToData GovernanceTokensRedeemer where + toData = genericToData \ No newline at end of file diff --git a/src/MintingPolicy/ProposalMinting.js b/src/MintingPolicy/ProposalMinting.js new file mode 100644 index 0000000..c659f11 --- /dev/null +++ b/src/MintingPolicy/ProposalMinting.js @@ -0,0 +1,13 @@ +let script; +if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) { + script = require("Scripts/proposalPolicy.plutus"); +} else { + const fs = require("fs"); + const path = require("path"); + script = fs.readFileSync( + path.resolve("scripts/proposalPolicy.plutus"), + "utf8" + ); +} + +exports.proposalPolicy = script; diff --git a/src/MintingPolicy/ProposalMinting.purs b/src/MintingPolicy/ProposalMinting.purs new file mode 100644 index 0000000..0eaf2e5 --- /dev/null +++ b/src/MintingPolicy/ProposalMinting.purs @@ -0,0 +1,71 @@ +module MintingPolicy.ProposalMinting where + +import Contract.Prelude + +import Contract.Monad (Contract, liftContractE) +import Contract.PlutusData (class HasPlutusSchema, class ToData, type (:+), type (:=), type (@@), PNil, PlutusData, S, Z, genericToData, toData) +import Contract.Scripts (MintingPolicy(PlutusMintingPolicy), PlutusScript, ApplyArgsError, applyArgs) +import Contract.TextEnvelope (decodeTextEnvelope, plutusScriptV2FromEnvelope) +import Contract.Transaction (TransactionInput) +import Contract.Value as Value +import Control.Monad.Error.Class (liftMaybe) +import Data.Array (singleton) as Array +import Data.BigInt (BigInt) +import Effect.Exception (error) + +foreign import proposalPolicy :: String + +proposalMintingPolicy :: TransactionInput -> Contract MintingPolicy +proposalMintingPolicy = + map PlutusMintingPolicy <<< mintProposalPolicyScript + +mintProposalPolicyScript :: TransactionInput -> Contract PlutusScript +mintProposalPolicyScript param = do + script <- liftMaybe (error "Error decoding nftPolicy") do + envelope <- decodeTextEnvelope proposalPolicy + plutusScriptV2FromEnvelope envelope + liftContractE $ mkMintProposalPolicy script param + +mkMintProposalPolicy + :: PlutusScript + -> TransactionInput + -> Either ApplyArgsError PlutusScript +mkMintProposalPolicy unappliedMintingPolicy param = + let + mintingPolicyArgs :: Array PlutusData + mintingPolicyArgs = Array.singleton (toData param) + in + applyArgs unappliedMintingPolicy mintingPolicyArgs + +type PThreadTokenName = Value.TokenName +type PVoteTokenName = Value.TokenName +type PVerCs = Value.CurrencySymbol +type PVote = BigInt -- 1 - for, 0 - against +type PAmount = BigInt + +data PProposalPolicyRedeemer + = PMintThreadToken PThreadTokenName + | PBurnThreadToken PThreadTokenName + | PMintVoteToken PVerCs + | PBurnVoteToken PVoteTokenName PVerCs + +derive instance Generic PProposalPolicyRedeemer _ + +instance + HasPlutusSchema + PProposalPolicyRedeemer + ( "PMintThreadToken" := PNil @@ Z + :+ "PBurnThreadToken" + := PNil + @@ (S Z) + :+ "PMintVoteToken" + := PNil + @@ (S (S Z)) + :+ "PBurnVoteToken" + := PNil + @@ (S (S (S Z))) + :+ PNil + ) + +instance ToData PProposalPolicyRedeemer where + toData = genericToData diff --git a/src/MintingPolicy/VerTokenRedeemers.purs b/src/MintingPolicy/VerTokenRedeemers.purs index 0fabd98..4b47f67 100644 --- a/src/MintingPolicy/VerTokenRedeemers.purs +++ b/src/MintingPolicy/VerTokenRedeemers.purs @@ -16,7 +16,10 @@ import Contract.PlutusData import Contract.Value as Value -data PVerTokenRedeemer = PMintVerToken Value.TokenName | PBurnVerToken Value.TokenName +data PVerTokenRedeemer + = PMintVerToken Value.TokenName + | PBurnVerToken Value.TokenName + | PMintProposalVerToken Value.TokenName derive instance Generic PVerTokenRedeemer _ @@ -27,6 +30,9 @@ instance :+ "PBurnVerToken" := PNil @@ (S Z) + :+ "PMintProposalVerToken" + := PNil + @@ (S (S Z)) :+ PNil ) diff --git a/src/Proposal/Create.purs b/src/Proposal/Create.purs new file mode 100644 index 0000000..738dc67 --- /dev/null +++ b/src/Proposal/Create.purs @@ -0,0 +1,154 @@ +module Proposal.Create where + +import Contract.Prelude + +import Contract.Address (addressToBech32, getNetworkId, validatorHashBaseAddress) +import Contract.Chain (currentTime) +import Contract.Credential (Credential(ScriptCredential)) +import Contract.Log (logInfo') +import Contract.Monad (Contract, liftContractM) +import Contract.ScriptLookups as Lookups +import Contract.TxConstraints as Constraints +import Contract.Value as Value +import Ctl.Internal.Plutus.Types.TransactionUnspentOutput (mkTxUnspentOut) +import Ctl.Internal.Scripts (mintingPolicyHash) +import Data.BigInt (fromInt) +import Effect.Exception (throw) +import Ext.Contract.Time (addTimes) +import Ext.Contract.Value (currencySymbolToString) +import Ext.Data.BigInt (eqBigInt) +import Governance.Datum (GovernanceDatum(..)) +import Governance.Redeemer (PGovernanceRedeemer(..)) +import Management.Proposal.UserData (ProposalInfo(..)) +import MintingPolicy.ProposalMinting as Proposal +import MintingPolicy.VerTokenRedeemers as VerToken +import Proposal.Datum (PProposalDatum(..)) +import Proposal.Model (PProposalParameters(..), mkProposal) +import Proposal.ProposalScript (getProposalValidatorHash) +import Protocol.Datum (PProtocolDatum(..)) +import Protocol.ProtocolScriptInfo (ProtocolScriptInfo(..), getProtocolScriptInfo) +import Protocol.UserData (ProtocolData, dataToProtocol) +import Shared.Duration (minutesToPosixTime) +import Shared.MinAda (minAdaValue) +import Shared.NetworkData (NetworkParams) +import Shared.OwnCredentials (OwnCredentials(..), getOwnCreds) +import Shared.RunContract (runContractWithResult) +import Shared.Tokens (createProposalThreadToken, createProposalVerToken) +import Shared.Tx (completeTx, toDatum, toRedeemer) +import Shared.ScriptInfo (ScriptInfo(..), getGovernanceScriptInfo) + +runCreateProposal :: (ProposalInfo -> Effect Unit) -> (String -> Effect Unit) -> ProtocolData -> PProposalParameters -> NetworkParams -> Effect Unit +runCreateProposal onComplete onError protocolData proposalParams networkParams = runContractWithResult onComplete onError networkParams $ contract protocolData proposalParams + +contract :: ProtocolData -> PProposalParameters -> Contract ProposalInfo +contract protocolData proposalParams = do + logInfo' "Running CreateProposal endpoint" + protocol <- dataToProtocol protocolData + ownCreds'@(OwnCredentials ownCreds) <- getOwnCreds + + (ProtocolScriptInfo protocolInfo) <- getProtocolScriptInfo protocol + ScriptInfo govScriptInfo <- getGovernanceScriptInfo protocol + let (GovernanceDatum govDatum) = govScriptInfo.datum + + networkId <- getNetworkId + let policyRef = ownCreds.nonCollateralORef + threadMp /\ threadCs /\ threadTn <- createProposalThreadToken policyRef + verMp /\ verCs /\ verTn <- createProposalVerToken protocol + let verTokenPolicyHash = mintingPolicyHash verMp + + let proposal = mkProposal protocol verCs + proposalValidatorHash <- getProposalValidatorHash proposal + proposalAddress <- liftContractM "Impossible to get Proposal script address" $ validatorHashBaseAddress networkId proposalValidatorHash + let govRefScriptInput = Constraints.RefInput $ mkTxUnspentOut (fst govScriptInfo.refScriptUtxo) (snd govScriptInfo.refScriptUtxo) + checkProposedValues proposalParams protocolInfo.pDatum + now <- currentTime + let deadline = addTimes now (minutesToPosixTime govDatum.duration) + let + proposalDatum = toDatum $ PProposalDatum + { proposal: proposalParams + , for: fromInt 0 + , against: fromInt 0 + , policyRef: policyRef + , quorum: govDatum.quorum + , initiator: (unwrap ownCreds.ownAddressWithNetworkTag).address + , deadline: deadline + , applied: fromInt 0 + } + + createProposalRedeemer = toRedeemer $ PCreateProposal proposalParams proposalAddress threadCs verCs now + threadValue = Value.singleton threadCs threadTn one + verValue = Value.singleton verCs verTn one + proposalCost = Value.lovelaceValueOf govDatum.fee + paymentToProposal = + minAdaValue + <> threadValue + <> verValue + <> proposalCost + + let + constraints :: Constraints.TxConstraints Void Void + constraints = + Constraints.mustSpendPubKeyOutput ownCreds.nonCollateralORef + <> Constraints.mustMintValueWithRedeemer + (toRedeemer $ Proposal.PMintThreadToken threadTn) + threadValue + <> Constraints.mustMintCurrencyWithRedeemerUsingScriptRef + verTokenPolicyHash + (toRedeemer $ VerToken.PMintProposalVerToken verTn) + verTn + one + protocolInfo.references.verTokenInput + + <> Constraints.mustSpendScriptOutputUsingScriptRef + (fst govScriptInfo.utxo) + createProposalRedeemer + govRefScriptInput + <> Constraints.mustPayToScriptAddress + govScriptInfo.validatorHash + (ScriptCredential govScriptInfo.validatorHash) + (toDatum govScriptInfo.datum) + Constraints.DatumInline + govScriptInfo.value + <> Constraints.mustPayToScriptAddress + proposalValidatorHash + (ScriptCredential proposalValidatorHash) + (toDatum proposalDatum) + Constraints.DatumInline + paymentToProposal + <> Constraints.mustBeSignedBy ownCreds.ownPkh + <> Constraints.mustReferenceOutput (fst protocolInfo.pUtxo) + <> Constraints.mustReferenceOutput (fst protocolInfo.references.verTokenRef) + + lookups :: Lookups.ScriptLookups Void + lookups = + Lookups.mintingPolicy threadMp + <> Lookups.unspentOutputs ownCreds.ownUtxos + <> Lookups.unspentOutputs govScriptInfo.utxos + <> Lookups.unspentOutputs protocolInfo.pUtxos + + completeTx lookups constraints ownCreds' + bech32Address <- addressToBech32 proposalAddress + logInfo' $ "Current proposal address: " <> show bech32Address + + let + proposalInfo = ProposalInfo + { threadCurrency: currencySymbolToString threadCs + , proposalData: proposalParams + , for: fromInt 0 + , against: fromInt 0 + } + logInfo' "Proposal created successfully" + pure proposalInfo + +checkProposedValues :: PProposalParameters -> PProtocolDatum -> Contract Unit +checkProposedValues (PProposalParameters propParams) (PProtocolDatum protocolDatum) = do + when + ( propParams.minAmount `eqBigInt` protocolDatum.minAmount + && propParams.maxAmount `eqBigInt` protocolDatum.maxAmount + && propParams.minDuration `eqBigInt` protocolDatum.minDuration + && propParams.maxDuration `eqBigInt` protocolDatum.maxDuration + && + propParams.protocolFee `eqBigInt` protocolDatum.protocolFee + ) + $ liftEffect + $ throw "Proposed values are already in protocol config" diff --git a/src/Proposal/Datum.purs b/src/Proposal/Datum.purs new file mode 100644 index 0000000..c0a5e52 --- /dev/null +++ b/src/Proposal/Datum.purs @@ -0,0 +1,59 @@ +module Proposal.Datum where + +import Contract.Prelude + +import Contract.Address (Address) +import Contract.PlutusData (class HasPlutusSchema, type (:+), type (:=), type (@@), I, PNil, Z, genericToData) +import Ctl.Internal.FromData (class FromData, genericFromData) +import Ctl.Internal.ToData (class ToData) +import Ctl.Internal.Types.Interval (POSIXTime) +import Ctl.Internal.Types.Transaction (TransactionInput) +import Data.BigInt (BigInt) +import Data.Newtype (class Newtype) +import Proposal.Model (PProposalParameters) + +newtype PProposalDatum = PProposalDatum + { proposal :: PProposalParameters + , for :: BigInt + , against :: BigInt + , policyRef :: TransactionInput + , quorum :: BigInt + , initiator :: Address + , deadline :: POSIXTime + , applied :: BigInt -- 0 or 1 + } + +derive instance Generic PProposalDatum _ +derive instance Newtype PProposalDatum _ + +instance + HasPlutusSchema + PProposalDatum + ( "PProposalDatum" + := + ( "proposal" := I PProposalParameters + :+ "for" + := I BigInt + :+ "against" + := I BigInt + :+ "policyRef" + := I TransactionInput + :+ "quorum" + := I BigInt + :+ "initiator" + := I Address + :+ "deadline" + := I POSIXTime + :+ "applied" + := I BigInt + :+ PNil + ) + @@ Z + :+ PNil + ) + +instance ToData PProposalDatum where + toData = genericToData + +instance FromData PProposalDatum where + fromData = genericFromData diff --git a/src/Proposal/Model.purs b/src/Proposal/Model.purs new file mode 100644 index 0000000..a57bc53 --- /dev/null +++ b/src/Proposal/Model.purs @@ -0,0 +1,90 @@ +module Proposal.Model where + +import Contract.Prelude + +import Contract.PlutusData (class HasPlutusSchema, type (:+), type (:=), type (@@), I, PNil, Z, genericToData) +import Contract.Value as Value +import Ctl.Internal.FromData (class FromData, genericFromData) +import Ctl.Internal.ToData (class ToData) +import Data.BigInt (BigInt) +import Protocol.Models (Protocol(..)) + +newtype PProposal = PProposal + { protocolCurrency :: Value.CurrencySymbol + , verTokenCurrency :: Value.CurrencySymbol + } + +derive newtype instance Show PProposal +derive instance Generic PProposal _ +derive instance Newtype PProposal _ + +instance + HasPlutusSchema + PProposal + ( "PProposal" + := + ( "protocolCurrency" := I Value.CurrencySymbol + :+ "verTokenCurrency" + := I Value.CurrencySymbol + :+ PNil + ) + @@ Z + :+ PNil + ) + +derive newtype instance Eq PProposal +derive newtype instance Ord PProposal + +instance ToData PProposal where + toData = genericToData + +instance FromData PProposal where + fromData = genericFromData + +newtype PProposalParameters = PProposalParameters + { minAmount :: BigInt + , maxAmount :: BigInt + , minDuration :: BigInt + , maxDuration :: BigInt + , protocolFee :: BigInt + } + +derive newtype instance Show PProposalParameters +derive instance Generic PProposalParameters _ +derive instance Newtype PProposalParameters _ + +instance + HasPlutusSchema + PProposalParameters + ( "PProposalParameters" + := + ( "minAmount" := I BigInt + :+ "maxAmount" + := I BigInt + :+ "minDuration" + := I BigInt + :+ "maxDuration" + := I BigInt + :+ "protocolFee" + := I BigInt + :+ PNil + ) + @@ Z + :+ PNil + ) + +derive newtype instance Eq PProposalParameters +derive newtype instance Ord PProposalParameters + +instance ToData PProposalParameters where + toData = genericToData + +instance FromData PProposalParameters where + fromData = genericFromData + +mkProposal :: Protocol -> Value.CurrencySymbol -> PProposal +mkProposal (Protocol protocol) verCurrency = do + PProposal + { protocolCurrency: protocol.protocolCurrency + , verTokenCurrency: verCurrency + } diff --git a/src/Proposal/ProposalScript.js b/src/Proposal/ProposalScript.js new file mode 100644 index 0000000..82ff24a --- /dev/null +++ b/src/Proposal/ProposalScript.js @@ -0,0 +1,13 @@ +let script; +if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) { + script = require("Scripts/proposal.plutus"); +} else { + const fs = require("fs"); + const path = require("path"); + script = fs.readFileSync( + path.resolve("scripts/proposal.plutus"), + "utf8" + ); +} + +exports.proposalValidator = script; diff --git a/src/Proposal/ProposalScript.purs b/src/Proposal/ProposalScript.purs new file mode 100644 index 0000000..80e9fef --- /dev/null +++ b/src/Proposal/ProposalScript.purs @@ -0,0 +1,46 @@ +module Proposal.ProposalScript where + +import Contract.Prelude + +import Contract.Monad (Contract, liftContractE) +import Contract.PlutusData (PlutusData, toData) +import Contract.Scripts (Validator(..), PlutusScript, ApplyArgsError, applyArgs, validatorHash, ValidatorHash) +import Contract.TextEnvelope (decodeTextEnvelope, plutusScriptV2FromEnvelope) +import Contract.Value as Value +import Control.Monad.Error.Class (liftMaybe) +import Data.Array (singleton) as Array +import Effect.Exception (error) +import Ext.Contract.Value (runMkTokenName) +import Proposal.Model (PProposal) + +foreign import proposalValidator :: String + +proposalValidatorScript :: PProposal -> Contract Validator +proposalValidatorScript proposal = do + script <- liftMaybe (error "Error decoding proposalValidator") do + envelope <- decodeTextEnvelope proposalValidator + plutusScriptV2FromEnvelope envelope + res <- liftContractE $ mkProposalValidatorScript script proposal + pure $ Validator res + +mkProposalValidatorScript + :: PlutusScript + -> PProposal + -> Either ApplyArgsError PlutusScript +mkProposalValidatorScript unappliedValidator proposal = + let + validatorArgs :: Array PlutusData + validatorArgs = Array.singleton (toData proposal) + in + applyArgs unappliedValidator validatorArgs + +getProposalValidatorHash :: PProposal -> Contract ValidatorHash +getProposalValidatorHash proposal = do + validator <- proposalValidatorScript proposal + pure $ validatorHash validator + +proposalTokenName :: Contract Value.TokenName +proposalTokenName = runMkTokenName "ProposalId" + +proposalVerTokenName :: Contract Value.TokenName +proposalVerTokenName = runMkTokenName "ProposalVerified" diff --git a/src/Proposal/Redeemer.purs b/src/Proposal/Redeemer.purs new file mode 100644 index 0000000..6e6c7cb --- /dev/null +++ b/src/Proposal/Redeemer.purs @@ -0,0 +1,30 @@ +module Proposal.Redeemer where + +import Contract.Prelude + +import Contract.PlutusData (class HasPlutusSchema, class ToData, type (:+), type (:=), type (@@), PNil, Z, genericToData) +import Ctl.Internal.Plutus.Types.CurrencySymbol (CurrencySymbol) +import Ctl.Internal.Plutus.Types.Address (Address) +import Data.BigInt (BigInt) + +type IsVoteFor = BigInt -- "against" = 0, "for" = 1 +type PAmount = BigInt +type Voter = Address +type ProposalThreadCs = CurrencySymbol + +data PProposalRedeemer = + PVote IsVoteFor PAmount Voter ProposalThreadCs + +derive instance Generic PProposalRedeemer _ + +instance + HasPlutusSchema + PProposalRedeemer + ( "PVote" + := PNil + @@ Z + :+ PNil + ) + +instance ToData PProposalRedeemer where + toData = genericToData diff --git a/src/Proposal/UserData.purs b/src/Proposal/UserData.purs new file mode 100644 index 0000000..4b00434 --- /dev/null +++ b/src/Proposal/UserData.purs @@ -0,0 +1,24 @@ +module Management.Proposal.UserData where + +import Contract.Prelude + +import Data.BigInt (BigInt) +import Proposal.Model (PProposalParameters) + +newtype VoteData = VoteData + { proposalThreadCurrency :: String + , amount :: BigInt + , for :: Boolean + } + +derive newtype instance Show VoteData +derive newtype instance Eq VoteData + +newtype ProposalInfo = ProposalInfo + { threadCurrency :: String + , proposalData :: PProposalParameters + , for :: BigInt + , against :: BigInt + } + +derive newtype instance Show ProposalInfo diff --git a/src/Proposal/Vote.purs b/src/Proposal/Vote.purs new file mode 100644 index 0000000..9ade80e --- /dev/null +++ b/src/Proposal/Vote.purs @@ -0,0 +1,136 @@ +module Proposal.Vote where + +import Contract.Prelude + +import Contract.Address (addressToBech32, getNetworkId, validatorHashBaseAddress) +import Contract.Chain (currentTime) +import Contract.Credential (Credential(ScriptCredential)) +import Contract.Log (logInfo') +import Contract.Monad (Contract, liftContractM) +import Contract.ScriptLookups as Lookups +import Contract.TxConstraints as Constraints +import Contract.Value as Value +import Ctl.Internal.Plutus.Types.TransactionUnspentOutput (mkTxUnspentOut) +import Ctl.Internal.Types.Interval (from) +import Data.BigInt (fromInt) +import Effect.Exception (throw) +import Ext.Contract.Value (mkCurrencySymbol) +import Ext.Serialization.Token (deserializeCurrency) +import Governance.Datum (GovernanceDatum(..)) +import Management.Proposal.UserData (VoteData(..)) +import MintingPolicy.ProposalMinting (PProposalPolicyRedeemer(..)) +import MintingPolicy.VerTokenMinting (mintingPolicy) as VerToken +import Proposal.Datum (PProposalDatum(..)) +import Proposal.Model (mkProposal) +import Proposal.ProposalScript (getProposalValidatorHash, proposalValidatorScript, proposalVerTokenName) +import Proposal.Redeemer (PProposalRedeemer(..)) +import Proposal.VoteTokenName (mkVoteTokenName) +import Protocol.UserData (ProtocolData, dataToProtocol) +import Shared.MinAda (minAdaValue) +import Shared.NetworkData (NetworkParams) +import Shared.OwnCredentials (OwnCredentials(..), getOwnCreds) +import Shared.RunContract (runContractWithResult) +import Shared.ScriptInfo (ScriptInfo(..), getGovernanceScriptInfo, getProposalScriptInfo) +import Shared.ScriptRef (getUtxoWithRefScript) +import Shared.Tokens (createProposalVoteToken) +import Shared.Tx (completeTx, toDatum, toRedeemer) +import Shared.Utxo (checkTokenInUTxO) + +runVote :: (Unit -> Effect Unit) -> (String -> Effect Unit) -> ProtocolData -> VoteData -> NetworkParams -> Effect Unit +runVote onComplete onError protocolData voteData networkParams = runContractWithResult onComplete onError networkParams $ contract protocolData voteData + +contract :: ProtocolData -> VoteData -> Contract Unit +contract protocolData (VoteData voteData) = do + logInfo' "Running vote endpoint" + protocol <- dataToProtocol protocolData + ownCreds'@(OwnCredentials ownCreds) <- getOwnCreds + + networkId <- getNetworkId + ScriptInfo govScriptInfo <- getGovernanceScriptInfo protocol + let GovernanceDatum govDatum = govScriptInfo.datum + + let govTokensInWallet = Value.valueOf ownCreds.ownValue govDatum.govCurrency govDatum.govTokenName + logInfo' $ "govTokensInWallet: " <> show govTokensInWallet + when (govTokensInWallet < voteData.amount) $ liftEffect $ throw "Wallet doesn't have enough governance tokens" + + proposalCs <- deserializeCurrency voteData.proposalThreadCurrency + proposalVerTn <- proposalVerTokenName + _ /\ proposalVerTokenCs <- mkCurrencySymbol (VerToken.mintingPolicy protocol) + let proposal = mkProposal protocol proposalVerTokenCs + + proposalValidatorHash <- getProposalValidatorHash proposal + proposalAddress <- liftContractM "Impossible to get Proposal script address" $ validatorHashBaseAddress networkId proposalValidatorHash + ScriptInfo proposalScriptInfo <- getProposalScriptInfo proposal proposalCs + + unless (checkTokenInUTxO (Tuple proposalVerTokenCs proposalVerTn) proposalScriptInfo.utxo) $ liftEffect $ throw "VerificationToken not found in Proposal" + let proposalDatum = unwrap proposalScriptInfo.datum + when (proposalDatum.applied == fromInt 1) $ throw >>> liftEffect $ "Can't vote for the applied proposal" + now <- currentTime + when (now > proposalDatum.deadline) $ throw >>> liftEffect $ "Voting time is over" + let votingTimeRange = from now + + let + newProposalDatum = toDatum $ PProposalDatum + { proposal: proposalDatum.proposal + , for: if voteData.for then (proposalDatum.for + voteData.amount) else proposalDatum.for + , against: if voteData.for then proposalDatum.against else (proposalDatum.against + voteData.amount) + , policyRef: proposalDatum.policyRef + , quorum: proposalDatum.quorum + , initiator: proposalDatum.initiator + , deadline: proposalDatum.deadline + , applied: proposalDatum.applied + } + let isVoteFor = if voteData.for then (fromInt 1) else (fromInt 0) + let voter = (unwrap ownCreds.ownAddressWithNetworkTag).address + let voteRedeemer = toRedeemer $ PVote isVoteFor voteData.amount voter proposalCs + + voteTokenName <- liftContractM "Impossible to make Vote token name" $ mkVoteTokenName isVoteFor voteData.amount + voteMp /\ voteCs /\ voteTn <- createProposalVoteToken proposalDatum.policyRef voteTokenName + when (voteCs /= proposalCs) $ liftEffect $ throw "Unexpected vote token currency" + let voteTokenRedeemer = toRedeemer $ PMintVoteToken proposalVerTokenCs + + let govTokensValue = Value.singleton govDatum.govCurrency govDatum.govTokenName voteData.amount + let paymentToProposal = proposalScriptInfo.value <> minAdaValue <> govTokensValue + + let voteTokensValue = Value.singleton voteCs voteTn one + let paymentToVoter = minAdaValue <> voteTokensValue + + proposalValidator <- proposalValidatorScript proposal + proposalRefScriptUtxo <- getUtxoWithRefScript (unwrap proposalValidator) proposalScriptInfo.utxos + let proposalRefScriptInput = Constraints.RefInput $ mkTxUnspentOut (fst proposalRefScriptUtxo) (snd proposalRefScriptUtxo) + + let + constraints :: Constraints.TxConstraints Void Void + constraints = + Constraints.mustSpendPubKeyOutput ownCreds.nonCollateralORef + <> Constraints.mustMintValueWithRedeemer + voteTokenRedeemer + voteTokensValue + + <> Constraints.mustSpendScriptOutputUsingScriptRef + (fst proposalScriptInfo.utxo) + voteRedeemer + proposalRefScriptInput + <> Constraints.mustPayToScriptAddress + proposalScriptInfo.validatorHash + (ScriptCredential proposalScriptInfo.validatorHash) + newProposalDatum + Constraints.DatumInline + paymentToProposal + <> Constraints.mustPayToPubKeyAddress ownCreds.ownPkh ownCreds.ownSkh paymentToVoter + <> Constraints.mustBeSignedBy ownCreds.ownPkh + <> Constraints.mustValidateIn votingTimeRange + <> Constraints.mustReferenceOutput (fst proposalRefScriptUtxo) + <> Constraints.mustReferenceOutput (fst govScriptInfo.utxo) + + lookups :: Lookups.ScriptLookups Void + lookups = + Lookups.mintingPolicy voteMp + <> Lookups.unspentOutputs ownCreds.ownUtxos + <> Lookups.unspentOutputs proposalScriptInfo.utxos + <> Lookups.unspentOutputs govScriptInfo.utxos + + completeTx lookups constraints ownCreds' + bech32Address <- addressToBech32 proposalAddress + logInfo' $ "Current proposal address: " <> show bech32Address + logInfo' "Added vote successfully" diff --git a/src/Proposal/VoteTokenName.purs b/src/Proposal/VoteTokenName.purs new file mode 100644 index 0000000..eddedea --- /dev/null +++ b/src/Proposal/VoteTokenName.purs @@ -0,0 +1,10 @@ +module Proposal.VoteTokenName where + +import Contract.Prelude + +import Contract.Value as Value +import Data.BigInt (BigInt, toString) +import Ext.Contract.Value (mkTokenName) + +mkVoteTokenName :: BigInt -> BigInt -> Maybe Value.TokenName +mkVoteTokenName vote amount = mkTokenName $ "D" <> toString vote <> "." <> toString amount diff --git a/src/Protocol/StartProtocol.purs b/src/Protocol/StartProtocol.purs index 419cf2b..9c855e6 100644 --- a/src/Protocol/StartProtocol.purs +++ b/src/Protocol/StartProtocol.purs @@ -1,7 +1,15 @@ -module Protocol.StartProtocol where +module Protocol.StartProtocol + ( getGovernanceConstraints + , initialGovernanceConf + , initialProtocolConfigParams + , runStartSystem + , startSystem + , startProtocol + ) where import Contract.Prelude - +import Governance.UserData (StartGovernanceData(..)) +import Shared.OwnCredentials (OwnCredentials(..), getOwnCreds) import Config.Protocol (mapFromProtocolData, writeProtocolConfig) import Contract.Address (addressToBech32, getNetworkId, validatorHashBaseAddress) import Contract.Credential (Credential(..)) @@ -14,16 +22,18 @@ import Contract.Value as Value import Data.BigInt (fromInt) import Effect.Aff (launchAff_) import Ext.Contract.Value (mkCurrencySymbol) +import Governance.Config (getGovTokenFromConfig) +import Governance.Datum (GovernanceDatum(..)) +import Governance.GovernanceScript (getGovernanceValidatorHash, governanceTokenName, governanceValidatorScript) import MintingPolicy.NftMinting as NFT import MintingPolicy.NftRedeemer (PNftRedeemer(..)) import Protocol.Datum (PProtocolDatum(..)) import Protocol.Models (Protocol(..)) import Protocol.ProtocolScript (getProtocolValidatorHash, protocolTokenName, protocolValidatorScript) -import Protocol.UserData (ProtocolConfigParams(..), ProtocolData, protocolToData) +import Protocol.UserData (ProtocolConfigParams(..), ProtocolData, dataToProtocol, protocolToData) import Shared.Config (mapFromProtocolConfigParams, writeDonatPoolConfig) import Shared.KeyWalletConfig (testnetKeyWalletConfig) -import Shared.OwnCredentials (OwnCredentials(..), getOwnCreds) -import Shared.ScriptRef (mkFundraisingRefScript, mkProtocolRefScript, mkVerTokenPolicyRef) +import Shared.ScriptRef (mkFundraisingRefScript, mkGovernanceRefScript, mkProposalRefScript, mkProtocolRefScript, mkVerTokenPolicyRef) import Shared.Tx (completeTx) initialProtocolConfigParams ∷ ProtocolConfigParams @@ -35,6 +45,13 @@ initialProtocolConfigParams = ProtocolConfigParams , protocolFeeParam: fromInt 10 } +initialGovernanceConf :: StartGovernanceData +initialGovernanceConf = StartGovernanceData + { quorum: fromInt 60 + , fee: fromInt 10_000_000 + , duration: fromInt 60 + } + runStartSystem :: Effect Unit runStartSystem = launchAff_ $ do runContract testnetKeyWalletConfig (startSystem initialProtocolConfigParams) @@ -44,55 +61,62 @@ startSystem params = do protocolData <- startProtocol params mkProtocolRefScript protocolData mkFundraisingRefScript protocolData + protocol <- dataToProtocol protocolData + mkGovernanceRefScript protocol + mkProposalRefScript protocol mkVerTokenPolicyRef protocolData pure protocolData startProtocol :: ProtocolConfigParams -> Contract ProtocolData -startProtocol params@(ProtocolConfigParams { minAmountParam, maxAmountParam, minDurationParam, maxDurationParam, protocolFeeParam }) = do +startProtocol params@(ProtocolConfigParams confParams) = do logInfo' "Running startDonatPool protocol contract" ownCreds@(OwnCredentials creds) <- getOwnCreds mp /\ cs <- mkCurrencySymbol (NFT.mintingPolicy creds.nonCollateralORef) - tn <- protocolTokenName + protocolTn <- protocolTokenName let protocol = Protocol { protocolCurrency: cs - , protocolTokenName: tn + , protocolTokenName: protocolTn } protocolValidatorHash <- getProtocolValidatorHash protocol protocolValidator <- protocolValidatorScript protocol let initialProtocolDatum = PProtocolDatum - { minAmount: minAmountParam - , maxAmount: maxAmountParam - , minDuration: minDurationParam - , maxDuration: maxDurationParam - , protocolFee: protocolFeeParam + { minAmount: confParams.minAmountParam + , maxAmount: confParams.maxAmountParam + , minDuration: confParams.minDurationParam + , maxDuration: confParams.maxDurationParam + , protocolFee: confParams.protocolFeeParam , managerAddress: (unwrap creds.ownAddressWithNetworkTag).address , tokenOriginRef: creds.nonCollateralORef } - nftValue = Value.singleton cs tn one - paymentToProtocol = Value.lovelaceValueOf (fromInt 2000000) <> nftValue + protocolNftValue = Value.singleton cs protocolTn one + paymentToProtocol = Value.lovelaceValueOf (fromInt 2000000) <> protocolNftValue + + (govConstraints /\ govLookups) <- getGovernanceConstraints protocol let constraints :: Constraints.TxConstraints Void Void constraints = Constraints.mustSpendPubKeyOutput creds.nonCollateralORef <> Constraints.mustMintValueWithRedeemer - (Redeemer $ toData $ PMintNft tn) - nftValue + (Redeemer $ toData $ PMintNft protocolTn) + protocolNftValue <> Constraints.mustPayToScriptAddress protocolValidatorHash (ScriptCredential protocolValidatorHash) (Datum $ toData initialProtocolDatum) Constraints.DatumInline paymentToProtocol + <> govConstraints lookups :: Lookups.ScriptLookups Void lookups = Lookups.mintingPolicy mp <> Lookups.unspentOutputs creds.ownUtxos <> Lookups.validator protocolValidator + <> govLookups completeTx lookups constraints ownCreds @@ -113,3 +137,48 @@ startProtocol params@(ProtocolConfigParams { minAmountParam, maxAmountParam, min liftEffect $ writeDonatPoolConfig donatPoolConfig pure protocolData + +getGovernanceConstraints :: Protocol -> Contract (Constraints.TxConstraints Void Void /\ Lookups.ScriptLookups Void) +getGovernanceConstraints protocol'@(Protocol protocol) = do + let StartGovernanceData govData = initialGovernanceConf + (govCurrency /\ govTokenName) <- getGovTokenFromConfig + tn <- governanceTokenName + + govValidatorHash <- getGovernanceValidatorHash protocol' + govValidator <- governanceValidatorScript protocol' + + let + initialGovernanceDatum = GovernanceDatum + { quorum: govData.quorum + , fee: govData.fee + , govCurrency: govCurrency + , govTokenName: govTokenName + , duration: govData.duration + } + nftValue = Value.singleton protocol.protocolCurrency tn one + paymentToGov = Value.lovelaceValueOf (fromInt 2000000) <> nftValue + + let + constraints :: Constraints.TxConstraints Void Void + constraints = + Constraints.mustMintValueWithRedeemer + (Redeemer $ toData $ PMintNft tn) + nftValue + <> Constraints.mustPayToScriptAddress + govValidatorHash + (ScriptCredential govValidatorHash) + (Datum $ toData initialGovernanceDatum) + Constraints.DatumInline + paymentToGov + + lookups :: Lookups.ScriptLookups Void + lookups = + Lookups.validator govValidator + + networkId <- getNetworkId + governanceAddress <- + liftContractM "Impossible to get governance script address" $ validatorHashBaseAddress networkId govValidatorHash + bech32Address <- addressToBech32 governanceAddress + logInfo' $ "Current governance address: " <> show bech32Address + + pure (constraints /\ lookups) diff --git a/src/Shared/OwnCredentials.purs b/src/Shared/OwnCredentials.purs index 0d796fa..4902e5a 100644 --- a/src/Shared/OwnCredentials.purs +++ b/src/Shared/OwnCredentials.purs @@ -2,35 +2,27 @@ module Shared.OwnCredentials where import Contract.Prelude -import Contract.Address - ( Address - , AddressWithNetworkTag - , PaymentPubKeyHash(..) - , PubKeyHash - , StakePubKeyHash(..) - , addressWithNetworkTagToBech32 - , getWalletAddressesWithNetworkTag - , ownPaymentPubKeysHashes - , ownStakePubKeysHashes - , toPubKeyHash - , toStakingCredential - ) +import Contract.Address (Address, AddressWithNetworkTag, PaymentPubKeyHash(..), PubKeyHash, StakePubKeyHash(..), addressWithNetworkTagToBech32, getWalletAddressesWithNetworkTag, ownPaymentPubKeysHashes, ownStakePubKeysHashes, toPubKeyHash, toStakingCredential) import Contract.Credential (Credential(..), StakingCredential(..)) import Contract.Log (logInfo') import Contract.Monad (Contract, liftContractM, liftedM) import Contract.Transaction (TransactionInput, TransactionOutputWithRefScript) import Contract.Utxos (utxosAt) +import Contract.Value as Value import Data.Array as Array +import Data.BigInt (BigInt, toString) import Data.Map as Map import Effect.Exception (throw) +import Ext.Contract.Value (currencySymbolToString, tokenNameToString) import Info.UserData (UserInfo(..)) -import Shared.Utxo (UtxoTuple, getNonCollateralUtxo) +import Shared.Utxo (UtxoTuple, extractValueFromUTxO, getNonCollateralUtxo) newtype OwnCredentials = OwnCredentials { ownPkh :: PaymentPubKeyHash , ownSkh :: StakePubKeyHash , ownAddressWithNetworkTag :: AddressWithNetworkTag , ownUtxos :: (Map.Map TransactionInput TransactionOutputWithRefScript) + , ownValue :: Value.Value , nonCollateralORef :: TransactionInput } @@ -39,15 +31,21 @@ getOwnCreds = do (ownPkh /\ ownAddressWithNetworkTag) <- getOwnPkhAndAddress mbOwnSkh <- join <<< Array.head <$> ownStakePubKeysHashes ownSkh <- liftContractM "Failed to get own SKH" mbOwnSkh - utxos <- utxosAt ownAddressWithNetworkTag >>= getNonCollateralUtxo + allUtxos <- utxosAt ownAddressWithNetworkTag + nonCollateralUtxos <- getNonCollateralUtxo allUtxos + + let (utxosArray :: Array UtxoTuple) = Map.toUnfoldable allUtxos + let ownValue = foldMap extractValueFromUTxO utxosArray + oref <- liftContractM "Utxo set is empty" - (fst <$> Array.head (Map.toUnfoldable utxos :: Array UtxoTuple)) + (fst <$> Array.head (Map.toUnfoldable nonCollateralUtxos :: Array UtxoTuple)) pure $ OwnCredentials { ownPkh: ownPkh , ownSkh: ownSkh , ownAddressWithNetworkTag: ownAddressWithNetworkTag - , ownUtxos: utxos + , ownUtxos: nonCollateralUtxos + , ownValue: ownValue , nonCollateralORef: oref } @@ -80,3 +78,16 @@ getPkhSkhFromAddress address = do pkhFromCreds creds = case creds of PubKeyCredential pkh -> Just pkh _ -> Nothing + +logAllAssets :: Value.Value -> Contract Unit +logAllAssets val = do + let tokens = Value.flattenNonAdaAssets val + tokensStr <- foldMap assetToString tokens + logInfo' tokensStr + +assetToString :: (Value.CurrencySymbol /\ Value.TokenName /\ BigInt) -> Contract String +assetToString (cs /\ tn /\ quantity) = do + + let csString = currencySymbolToString cs + tnStr <- liftContractM "Impossible to encode Token name" $ tokenNameToString tn + pure $ "\nCurrency: " <> csString <> ", tokenName: " <> tnStr <> ", quantity: " <> toString quantity diff --git a/src/Shared/ScriptInfo.purs b/src/Shared/ScriptInfo.purs new file mode 100644 index 0000000..b115475 --- /dev/null +++ b/src/Shared/ScriptInfo.purs @@ -0,0 +1,97 @@ +module Shared.ScriptInfo where + +import Contract.Prelude + +import Contract.Address (getNetworkId, validatorHashBaseAddress) +import Contract.Monad (Contract, liftContractM) +import Contract.PlutusData (class FromData) +import Contract.Transaction (ScriptRef(..), TransactionInput, TransactionOutputWithRefScript, mkTxUnspentOut) +import Contract.TxConstraints (InputWithScriptRef) +import Contract.TxConstraints as Constraints +import Contract.Utxos (utxosAt) +import Contract.Value (CurrencySymbol) +import Contract.Value as Value +import Ctl.Internal.Plutus.Types.Address (Address) +import Ctl.Internal.Types.Scripts (Validator, ValidatorHash) +import Ctl.Internal.Types.TokenName (TokenName) +import Data.Map (Map) +import Governance.Datum (GovernanceDatum) +import Governance.GovernanceScript (getGovernanceValidatorHash, governanceTokenName, governanceValidatorScript) +import Proposal.Datum (PProposalDatum) +import Proposal.Model (PProposal) +import Proposal.ProposalScript (getProposalValidatorHash, proposalTokenName, proposalValidatorScript) +import Protocol.Models (Protocol) +import Shared.Utxo (extractDatumFromUTxO, extractValueFromUTxO, getUtxoByNFT, getUtxoByScriptRef) + +newtype GetScriptData = GetScriptData + { getThreadTokenName :: Contract TokenName + , getValidator :: Contract Validator + , getValidatoHash :: Contract ValidatorHash + } + +getGovernanceScriptInfo ∷ Protocol → Contract (ScriptInfo GovernanceDatum) +getGovernanceScriptInfo protocol = do + let + getScriptData = GetScriptData + { getThreadTokenName: governanceTokenName + , getValidator: governanceValidatorScript protocol + , getValidatoHash: getGovernanceValidatorHash protocol + } + getScriptInfo getScriptData (unwrap protocol).protocolCurrency "Governance" + +getProposalScriptInfo :: PProposal -> CurrencySymbol -> Contract (ScriptInfo PProposalDatum) +getProposalScriptInfo proposal threadCs = do + let + getScriptData = GetScriptData + { getThreadTokenName: proposalTokenName + , getValidator: proposalValidatorScript proposal + , getValidatoHash: getProposalValidatorHash proposal + } + getScriptInfo getScriptData threadCs "Proposal" + +newtype ScriptInfo datum = ScriptInfo + { tokenName :: TokenName + , validator :: Validator + , validatorHash :: ValidatorHash + , address :: Address + , utxos :: Map TransactionInput TransactionOutputWithRefScript + , utxo :: Tuple TransactionInput TransactionOutputWithRefScript + , datum :: datum + , value :: Value.Value + , refScriptUtxo :: Tuple TransactionInput TransactionOutputWithRefScript + , refScriptInput :: InputWithScriptRef + } + +getScriptInfo + :: forall (datum :: Type) + . FromData datum + => GetScriptData + -> CurrencySymbol + -> String + -> Contract (ScriptInfo datum) +getScriptInfo (GetScriptData getScriptData) cs scriptName = do + networkId <- getNetworkId + tn <- getScriptData.getThreadTokenName + validator <- getScriptData.getValidator + validatorHash <- getScriptData.getValidatoHash + address <- + liftContractM ("Impossible to get " <> scriptName <> " script address") $ validatorHashBaseAddress networkId validatorHash + utxos <- utxosAt address + utxo <- getUtxoByNFT scriptName (cs /\ tn) utxos + datum <- liftContractM ("Impossible to get " <> scriptName <> " Datum") $ extractDatumFromUTxO utxo + let value = extractValueFromUTxO utxo + let scriptRef = PlutusScriptRef (unwrap validator) + refScriptUtxo <- getUtxoByScriptRef scriptName scriptRef utxos + let refScriptInput = Constraints.RefInput $ mkTxUnspentOut (fst refScriptUtxo) (snd refScriptUtxo) + pure $ ScriptInfo + { tokenName: tn + , validator: validator + , validatorHash: validatorHash + , address: address + , utxos: utxos + , utxo: utxo + , datum: datum + , value: value + , refScriptUtxo: refScriptUtxo + , refScriptInput: refScriptInput + } \ No newline at end of file diff --git a/src/Shared/ScriptRef.purs b/src/Shared/ScriptRef.purs index dcc123e..1f6ffef 100644 --- a/src/Shared/ScriptRef.purs +++ b/src/Shared/ScriptRef.purs @@ -4,20 +4,30 @@ import Contract.Prelude import Contract.Credential (Credential(..)) import Contract.Log (logInfo') -import Contract.Monad (Contract) +import Contract.Monad (Contract, liftContractM) import Contract.PlutusData (unitDatum) import Contract.ScriptLookups as Lookups -import Contract.Scripts (MintingPolicy(..), ValidatorHash) +import Contract.Scripts (MintingPolicy(..), PlutusScript) import Contract.Transaction (ScriptRef(..)) import Contract.TxConstraints as Constraints +import Ctl.Internal.Plutus.Types.Transaction (UtxoMap) +import Ctl.Internal.Types.Scripts (ValidatorHash) +import Data.Array as Array +import Data.Map as Map import Effect.Exception (throw) +import Ext.Contract.Value (mkCurrencySymbol) import Fundraising.FundraisingScript (fundraisingValidatorScript, getFundraisingValidatorHash) import Fundraising.FundraisingScriptInfo (makeFundraising) +import Governance.GovernanceScript (getGovernanceValidatorHash, governanceValidatorScript) import MintingPolicy.VerTokenMinting as VerToken +import Proposal.Model (mkProposal) +import Proposal.ProposalScript (getProposalValidatorHash, proposalValidatorScript) +import Protocol.Models (Protocol) import Protocol.ProtocolScript (getProtocolValidatorHash, protocolValidatorScript) import Protocol.UserData (ProtocolData, dataToProtocol) import Shared.MinAda (sevenMinAdaValue) import Shared.OwnCredentials (getOwnCreds) +import Shared.Utxo (UtxoTuple) import Shared.Tx (completeTx) createRefScriptUtxo ∷ String -> ScriptRef -> ValidatorHash → Contract Unit @@ -58,6 +68,22 @@ mkFundraisingRefScript protocolData = do let scriptRef = PlutusScriptRef (unwrap frValidator) createRefScriptUtxo "Fundraising" scriptRef frValidatorHash +mkProposalRefScript :: Protocol -> Contract Unit +mkProposalRefScript protocol = do + _ /\ proposalVerTokenCs <- mkCurrencySymbol (VerToken.mintingPolicy protocol) + let proposal = mkProposal protocol proposalVerTokenCs + proposalValidatorHash <- getProposalValidatorHash proposal + proposalValidator <- proposalValidatorScript proposal + let scriptRef = PlutusScriptRef (unwrap proposalValidator) + createRefScriptUtxo "Proposal" scriptRef proposalValidatorHash + +mkGovernanceRefScript :: Protocol -> Contract Unit +mkGovernanceRefScript protocol = do + governanceValidatorHash <- getGovernanceValidatorHash protocol + governanceValidator <- governanceValidatorScript protocol + let scriptRef = PlutusScriptRef (unwrap governanceValidator) + createRefScriptUtxo "Governance" scriptRef governanceValidatorHash + createPolicyRefUtxo :: String -> MintingPolicy → ValidatorHash → Contract Unit createPolicyRefUtxo _ (NativeMintingPolicy _) _ = liftEffect $ throw "Unexpected minting policy type" createPolicyRefUtxo mpName (PlutusMintingPolicy policy) validatorHash = do @@ -72,3 +98,18 @@ mkVerTokenPolicyRef protocolData = do protocolValidatorHash <- getProtocolValidatorHash protocol policy <- VerToken.mintingPolicy protocol createPolicyRefUtxo "VerToken" policy protocolValidatorHash + +hasExpectedRefScript :: PlutusScript -> UtxoTuple -> Boolean +hasExpectedRefScript plutusScript (_ /\ txOutput) = + (unwrap txOutput).scriptRef == Just (PlutusScriptRef plutusScript) + +findUtxoWithRefScript :: PlutusScript -> UtxoMap -> Maybe UtxoTuple +findUtxoWithRefScript plutusScript utxoMap = + let + (utxoArray :: Array UtxoTuple) = Map.toUnfoldable utxoMap + in + Array.find (hasExpectedRefScript plutusScript) utxoArray + +getUtxoWithRefScript :: PlutusScript -> UtxoMap -> Contract UtxoTuple +getUtxoWithRefScript plutusScript utxoMap = + liftContractM "UTxO with expected reference script not found" $ findUtxoWithRefScript plutusScript utxoMap diff --git a/src/Shared/Tokens.purs b/src/Shared/Tokens.purs new file mode 100644 index 0000000..f1564c1 --- /dev/null +++ b/src/Shared/Tokens.purs @@ -0,0 +1,59 @@ +module Shared.Tokens where + +import Contract.Prelude + +import Contract.Log (logInfo') +import Contract.Monad (Contract) +import Ctl.Internal.Plutus.Types.CurrencySymbol (CurrencySymbol) +import Ctl.Internal.Types.Scripts (MintingPolicy) +import Ctl.Internal.Types.TokenName (TokenName) +import Ctl.Internal.Types.Transaction (TransactionInput) +import MintingPolicy.NftMinting (mintingPolicy) as NFT +import MintingPolicy.ProposalMinting as Proposal +import MintingPolicy.VerTokenMinting (mintingPolicy) as VerToken +import Proposal.ProposalScript (proposalTokenName, proposalVerTokenName) +import Protocol.Models (Protocol) +import Ext.Contract.Value (mkCurrencySymbol) + +-- TODO: refactoring: add all tokens +newtype GetTokenNames = GetTokenNames + { proposalThread :: Contract TokenName + , proposalVer :: Contract TokenName + } + +derive instance Generic GetTokenNames _ +derive instance Newtype GetTokenNames _ + +getTokenNames :: GetTokenNames +getTokenNames = GetTokenNames + { proposalThread: proposalTokenName + , proposalVer: proposalVerTokenName + } + +type TokenInfo = (MintingPolicy /\ CurrencySymbol /\ TokenName) + +createProposalThreadToken :: TransactionInput -> Contract TokenInfo +createProposalThreadToken policyRef = + createToken (Proposal.proposalMintingPolicy policyRef) "Thread" (unwrap getTokenNames).proposalThread "Proposal" + +createProposalVerToken :: Protocol -> Contract TokenInfo +createProposalVerToken protocol = createVerToken "Proposal" protocol (unwrap getTokenNames).proposalVer + +createProposalVoteToken :: TransactionInput -> TokenName -> Contract TokenInfo +createProposalVoteToken policyRef tokenName = + createToken (Proposal.proposalMintingPolicy policyRef) "Vote" (pure tokenName) "Proposal" + +createThreadToken :: String -> TransactionInput -> Contract TokenName -> Contract TokenInfo +createThreadToken scriptName policyRef getTokenName = + createToken (NFT.mintingPolicy policyRef) "Thread" getTokenName scriptName + +createVerToken :: String -> Protocol -> Contract TokenName -> Contract TokenInfo +createVerToken scriptName protocol getTokenName = do + createToken (VerToken.mintingPolicy protocol) "Verification" getTokenName scriptName + +createToken :: Contract MintingPolicy -> String -> Contract TokenName -> String -> Contract TokenInfo +createToken makePolicy tokenType getTokenName scriptName = do + nftMp /\ nftCs <- mkCurrencySymbol makePolicy + nftTn <- getTokenName + logInfo' $ scriptName <> " " <> tokenType <> " currency: " <> show nftCs <> ", token name: " <> show nftTn + pure $ nftMp /\ nftCs /\ nftTn diff --git a/ui/index.tsx b/ui/index.tsx index 3aa080e..4709fda 100644 --- a/ui/index.tsx +++ b/ui/index.tsx @@ -9,7 +9,7 @@ const root = ReactDOM.createRoot(document.getElementById('root')!); const App = () => { const protocolData = { - protocolCurrency: "620d42a0fd0a9454d82fa273bd09bbad8900f81be47efd359423b1f3", + protocolCurrency: "3b9cd2a49b3d715052857b736d2d570bfaa86b1ac33c51a615d9d418", protocolTokenName: "DonatPoolProtocol" } @@ -35,6 +35,14 @@ const App = () => { isMainnet: false }; + const proposalParams = { + minAmount: 50000000 + , maxAmount: 1000000000 + , minDuration: 5 + , maxDuration: 86400 + , protocolFee: 5 + } + const onCreateFundraisingComplete = createdFundraisingResponse => { const frData = { frThreadTokenCurrency: createdFundraisingResponse.threadTokenCurrency, @@ -71,6 +79,31 @@ const App = () => { a.main.value0.getAppInfo(console.log)(console.log)(protocolData)(testnetNami)(); }; + // uncomment if need to mint governance tokens + // const onMintGovernanceClick = () => { + // a.main.value0.mintGovernanceTokens(console.log)(console.log)(testnetNami)(); + // }; + + const [proposalCurrency, setProposalCurrency] = useState<{any;}>(); + + const onCreateProposalComplete = createdProposalResponse => { + setProposalCurrency(createdProposalResponse.threadCurrency); + }; + + const onCreateProposal = () => { + a.main.value0.createProposal(onCreateProposalComplete)(console.log)(protocolData)(proposalParams)(testnetNami)(); + }; + + const onVoteForChangeProtocol = () => { + const voteData = { + proposalThreadCurrency: proposalCurrency, + amount: 2, + for: true + } + + a.main.value0.vote(console.log)(console.log)(protocolData)(voteData)(testnetNami)(); + }; + return (

Offchain integration

@@ -80,6 +113,9 @@ const App = () => { + {/* */} + +
); };