/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
function e(e,t,_,a=!1){const n=new Map;for(let s=0;s<e.get_results_count();s++){const r=e.get_result_at(s);if(2!==r.get_fetch_result_case().value||0!==r.error().error_code){const e=r.get_key().key_string;_.has(e)&&t.delete(e);continue}const g=r.get_value(),c=r.get_key().key_string,o=_.get(c);let u;if(2===g.get_data_case().value&&o)u=o.value;else{if(1!==g.get_data_case().value)continue;{u=g.get_data().client_data_string;const e=r.get_value().get_v_tag().v_tag;a||t.set(c,{key:c,version:e,value:u})}}n.set(c,u)}return n}function t(e){const t=e.get_keys(),_=new Array;for(let a=0;a<t.get_keys_count();a++){const e=t.get_key_at(a);1===e.get_client_data_key_type().value&&_.push(e.key_string)}return _}export{t as wasmClientDataAllKeysResponseToClientDataKeys,e as wasmClientDataFetchResponseToClientData};
