"use strict";var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),n=require("react"),u=require("../clients/jsonApi/index.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=s(e),i=s(t),o=s(r);function l(e){return c.apply(this,arguments)}function c(){return(c=i.default(o.default.mark((function e(t){var r,n,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u.getAsset(t,{fields:["asset.custom_properties"]});case 3:return s=e.sent,e.abrupt("return",(null===(r=s.data.attributes)||void 0===r||null===(n=r.custom_properties)||void 0===n?void 0:n.is_asset_viewer)||!1);case 7:return e.prev=7,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}module.exports=function(e){var t=e.well,r=e.wells,u=n.useState(null),s=a.default(u,2),c=s[0],p=s[1];return n.useEffect((function(){function e(){return e=i.default(o.default.mark((function e(){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=p,!t){e.next=7;break}return e.next=4,l(t.asset_id);case 4:e.t1=e.sent,e.next=8;break;case 7:e.t1=null!==(n=null==r?void 0:r.some((function(e){var t;return null===(t=e.custom_properties)||void 0===t?void 0:t.is_asset_viewer})))&&void 0!==n&&n;case 8:e.t2=e.t1,(0,e.t0)(e.t2);case 10:case"end":return e.stop()}}),e)}))),e.apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[t,r]),c};
//# sourceMappingURL=useIsAssetViewer.js.map
