const e=require(`./constant.cjs`),t=require(`../../data-structures/http/HttpClient.cjs`);require(`../../data-structures/http/index.cjs`);const n=require(`../utils/encryptInputForEnclave.cjs`),r=require(`./getZKFiles.cjs`);var i=e=>{if(e.startsWith(`http`)){let t=e.split(`/`).at(-1);if(!t)throw Error(`invalid verifierName`);return t}return e},a=async(a,o,s)=>{let c=i(r.getWASMFile(o,a)),l=i(r.getZKeyFile(o,a)),{keyCiphertext:u,inputCiphertext:d}=await n.makeEnclaveHandshakeAndEncryptInput(s),f={circuit_wasm:c,circuit_zkey:l,input:d,key:u},{public_signals:p,zk_calldata:m}=await t.httpClient.post(`${e.ENCLAVE_URL}/generate`,f);return{zkCallData:m,publicSignals:p}};exports.generateZkProofEnclave=a;