Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.179/page_editor/app/services/FragmentService",["module","exports","require","../config/index","./serviceFetch"],(function(e,t,n){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n("../config/index"),a=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n("./serviceFetch"));var d={addComment({body:e,fragmentEntryLinkId:t,onNetworkStatus:n,parentCommentId:d}){const o={body:e,fragmentEntryLinkId:t};return d&&(o.parentCommentId=d),(0,a.default)(r.config.addFragmentEntryLinkCommentURL,{body:o},n)},addFragmentComposition:({description:e,fragmentCollectionId:t,itemId:n,name:d,onNetworkStatus:o,previewImageURL:i,saveInlineContent:g,saveMappingConfiguration:s,segmentsExperienceId:m})=>(0,a.default)(r.config.addFragmentCompositionURL,{body:{description:e,fragmentCollectionId:t,itemId:n,name:d,previewImageURL:i,saveInlineContent:g,saveMappingConfiguration:s,segmentsExperienceId:m}},o,{requestGenerateDraft:!0}),addFragmentEntryLink:({fragmentEntryKey:e,groupId:t,onNetworkStatus:n,parentItemId:d,position:o,segmentsExperienceId:i})=>(0,a.default)(r.config.addFragmentEntryLinkURL,{body:{fragmentEntryKey:e,groupId:t,parentItemId:d,position:o,segmentsExperienceId:i}},n,{requestGenerateDraft:!0}),addFragmentEntryLinks:({fragmentEntryKey:e,groupId:t,onNetworkStatus:n,parentItemId:d,position:o,segmentsExperienceId:i})=>(0,a.default)(r.config.addFragmentEntryLinksURL,{body:{fragmentEntryKey:e,groupId:t,parentItemId:d,position:o,segmentsExperienceId:i}},n,{requestGenerateDraft:!0}),deleteComment:({commentId:e,onNetworkStatus:t})=>(0,a.default)(r.config.deleteFragmentEntryLinkCommentURL,{body:{commentId:e}},t),duplicateItem:({itemId:e,onNetworkStatus:t,segmentsExperienceId:n})=>(0,a.default)(r.config.duplicateItemURL,{body:{itemId:e,segmentsExperienceId:n}},t,{requestGenerateDraft:!0}),editComment:({body:e,commentId:t,onNetworkStatus:n,resolved:d})=>(0,a.default)(r.config.editFragmentEntryLinkCommentURL,{body:{body:e,commentId:t,resolved:d}},n),renderFragmentEntryLinkContent({fragmentEntryLinkId:e,itemClassName:t,itemClassPK:n,itemExternalReferenceCode:d,languageId:o,onNetworkStatus:i,segmentsExperienceId:g}){const s={fragmentEntryLinkId:e,itemClassName:t,languageId:o,segmentsExperienceId:g};return n&&(s.itemClassPK=n),d&&(s.itemExternalReferenceCode=d),(0,a.default)(r.config.renderFragmentEntryURL,{body:s},i)},toggleFragmentHighlighted:({fragmentEntryKey:e,groupId:t="0",highlighted:n,onNetworkStatus:d})=>(0,a.default)(r.config.updateFragmentsHighlightedConfigurationURL,{body:{fragmentEntryKey:e,groupId:t,highlighted:n}},d,{requestGenerateDraft:!0}),updateConfigurationValues:({editableValues:e,fragmentEntryLinkId:t,languageId:n,onNetworkStatus:d,segmentsExperienceId:o})=>(0,a.default)(r.config.updateConfigurationValuesURL,{body:{editableValues:JSON.stringify(e),fragmentEntryLinkId:t,languageId:n,segmentsExperienceId:o}},d,{requestGenerateDraft:!0}),updateEditableValues:({editableValues:e,fragmentEntryLinkId:t,languageId:n,onNetworkStatus:d,segmentsExperienceId:o})=>(0,a.default)(r.config.editFragmentEntryLinkURL,{body:{editableValues:JSON.stringify(e),fragmentEntryLinkId:t,languageId:n,segmentsExperienceId:o}},d,{requestGenerateDraft:!0}),updateSetsOrder:({fragmentCollectionKeys:e,onNetworkStatus:t,portletCategoryKeys:n})=>(0,a.default)(r.config.updateFragmentPortletSetsSortURL,{body:{fragmentCollectionKeys:JSON.stringify(e)||null,portletCategoryKeys:JSON.stringify(n)||null}},t,{requestGenerateDraft:!0})};t.default=d}));
//# sourceMappingURL=FragmentService.js.map