/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import r from"../../../../../core/Error.js";import e from"../../../../../core/Logger.js";import{parseWhereClause as t}from"../../../../../core/sql.js";const n=()=>e.getLogger("esri.views.2d.layers.FeatureLayerView2D"),o={getAttribute:(r,e)=>r.readAttribute(e)};async function a(e,a){try{const s=await t(e,a);return s.isStandardized||n().error(new r("sql-parse-error","expression is not standardized",{where:e})),(t,a)=>{const i=t.readArcadeFeature();try{return s.testFeatureCompiled(i,o,a.currentUser)}catch(u){return n().warn(new r("sql-runtime-error","Encountered an error when evaluating where clause",{where:e,error:u})),!0}}}catch(s){return n().warn(new r("sql-runtime-error","Encountered an error when evaluating where clause",{where:e,error:s})),r=>!0}}export{a as createWhereClause};
