Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.151/page_editor/common/components/MappingFieldSelector",["module","exports","require","@frontend-taglib-clay$clayui/form","liferay!frontend-js-react-web$classnames","frontend-js-web","liferay!frontend-js-react-web$react","../../app/config/constants/editableTypes","../../app/utils/getSelectedField","../hooks/useId"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function MappingFieldSelector({fieldType:t,fields:a,onValueSelect:f,value:d}){const p=(0,c.useId)(),s=a&&!a.length,g=(0,o.default)({fields:a,value:d});return u.default.createElement(l.default.Group,{className:(0,r.default)("mb-2 mt-3",{"has-warning":s}),small:!0},u.default.createElement("label",{htmlFor:p},Liferay.Language.get("field")),u.default.createElement(l.ClaySelect,{disabled:!(a&&a.length),id:p,onChange:f,value:null==g?void 0:g.key},a&&!!a.length&&u.default.createElement(u.default.Fragment,null,u.default.createElement(l.ClaySelect.Option,{label:e.label,value:e.value}),a.map(((e,t)=>{const a="".concat(e.label||"").concat(t);return u.default.createElement((t=>{let{children:r}=t,n=function _objectWithoutProperties(e,t){if(null==e)return{};var a,l,r=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var a,l,r={},n=Object.keys(e);for(l=0;l<n.length;l++)a=n[l],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(l=0;l<n.length;l++)a=n[l],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(t,["children"]);return e.label?u.default.createElement(l.ClaySelect.OptGroup,n,r):u.default.createElement(u.default.Fragment,{key:a},r)}),{key:a,label:e.label},e.fields.map((e=>u.default.createElement(l.ClaySelect.Option,{key:e.key,label:e.label,value:e.key}))))})))),s&&u.default.createElement(l.default.FeedbackGroup,null,u.default.createElement(l.default.FeedbackItem,null,(0,n.sub)(Liferay.Language.get("no-fields-are-available-for-x-editable"),[i.EDITABLE_TYPES.backgroundImage,i.EDITABLE_TYPES.image].includes(t)?Liferay.Language.get("image"):Liferay.Language.get("text")))))};var l=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=l?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(a,r,n):a[r]=e[r]}a.default=e,t&&t.set(e,a);return a}(a("@frontend-taglib-clay$clayui/form")),r=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),n=a("frontend-js-web"),u=_interopRequireDefault(a("liferay!frontend-js-react-web$react")),i=a("../../app/config/constants/editableTypes"),o=_interopRequireDefault(a("../../app/utils/getSelectedField")),c=a("../hooks/useId");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}const e={label:"-- ".concat(Liferay.Language.get("unmapped")," --"),value:"unmapped"}}}));
//# sourceMappingURL=MappingFieldSelector.js.map