"use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,u){function c(e){try{i(n.next(e))}catch(e){u(e)}}function o(e){try{i(n.throw(e))}catch(e){u(e)}}function i(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(c,o)}i((n=n.apply(e,t||[])).next())}))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.useExternalExample=void 0;const react_1=require("react"),models_1=require("../../models");function useExternalExample(e,t){const[,r]=(0,react_1.useState)(!0),n=(0,react_1.useRef)(void 0),a=(0,react_1.useRef)(void 0);return a.current!==e&&(n.current=void 0),a.current=e,(0,react_1.useEffect)((()=>{(()=>{__awaiter(this,void 0,void 0,(function*(){r(!0);try{n.current=yield(0,models_1.getExternalExampleValue)(t,e.externalValueUrl)}catch(e){n.current=e}r(!1)}))})()}),[e,t]),n.current}exports.useExternalExample=useExternalExample;
//# sourceMappingURL=useExternalExample.js.map