Liferay.Loader.define("document-library-video@1.0.47/js/DLVideoExternalShortcutURLItemSelectorView",["module","exports","require","@frontend-taglib-clay$clayui/button","frontend-js-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","./components/DLVideoExternalShortcutInput","./components/DLVideoExternalShortcutPreview","./utils/hooks"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=f(r("@frontend-taglib-clay$clayui/button")),o=r("frontend-js-web"),a=(f(r("liferay!frontend-js-react-web$prop-types")),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"))),l=f(r("./components/DLVideoExternalShortcutInput")),i=f(r("./components/DLVideoExternalShortcutPreview")),u=r("./utils/hooks");function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function f(e){return e&&e.__esModule?e:{default:e}}var c=({eventName:e,getDLVideoExternalShortcutFieldsURL:t,namespace:r,returnType:d})=>{const[f,c]=(0,a.useState)(""),{error:s,fields:p,loading:y}=(0,u.useDLVideoExternalShortcutFields)({getDLVideoExternalShortcutFieldsURL:t,namespace:r,url:f}),L=!p||y;return a.default.createElement("form",{onSubmit:()=>{L||(0,o.getOpener)().Liferay.fire(e,{data:{returnType:d,value:{html:p.HTML,title:p.TITLE||p.URL}}})}},a.default.createElement(l.default,{labelTooltip:Liferay.Language.get("internal-video-tooltip"),onChange:c,url:f}),a.default.createElement(n.default,{disabled:L,type:"submit"},Liferay.Language.get("add")),a.default.createElement(i.default,{error:s,loading:y,videoHTML:p&&p.HTML}))};t.default=c}}));
//# sourceMappingURL=DLVideoExternalShortcutURLItemSelectorView.js.map