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,GAAkCvkB,EAAAA,EAAAA,IAAU,CACrDC,YAAa,+BACbC,UAAWC,EAAAA,EACXC,UAAYC,IAAO,CACfmkB,gCAAiCnkB,EAAQE,MAGvC,CACEA,MAAOA,IACH,mEAMZgkB,EADWE,uC,qmCCVR,MAAMC,GAAe1kB,EAAAA,EAAAA,IAAU,CAClCC,YAAa,eACbC,UAAWC,EAAAA,EACXC,UAAYC,IAAO,CACfskB,aAActkB,EAAQE,MAGpB,CACEA,MAAQjI,GAOI,GANQ9D,EAAAA,GAAW,GAAK,2CACX,IAAI8T,gBACrBvH,OAAO6jB,QAAQtsB,GACVuJ,QAAOpF,GAAwB,MAAxBgT,EAAAhT,EAAA,GAAS,KAChB4H,KAAIoF,IAAA,IAAA5K,EAAA4Q,EAAAhG,EAAA,GAAY,MAAM,CAAb5K,EAAA,GAAOA,EAAA,GAAkBgmB,WAAW,KAEMA,mBAMpCH,EAAzBI,oB,+ECvBR,MAAMC,EAAkCA,IAC3CC,IAAAA,IACSC,EAAAA,EAAUC,8BACdC,MAAKC,EAAAA,EAAAA,OACLD,MAAK1oB,IAAe,CACjB4oB,kBADS5oB,EAAJjG,KACmB8uB,mBACnBjhB,KAAKkhB,IAAO,CACTC,gBAAiBD,EAAQC,gBAAgBC,cACzCC,eAAgBH,EAAQG,mBAE3B7jB,OAAO8jB,EAAAA,QAEfC,OAAMC,EAAAA,EAAAA,OACND,MAAME,EAAAA,E,iCCnBR,IAQK/G,EAAW,SAAXA,GAAW,OAAXA,EAAW,0CAAXA,EAAW,kDAAXA,EAAW,kDAAXA,EAAW,kCAAXA,EAAW,0CAAXA,EAAW,0CAAXA,EAAW,sDAAXA,EAAW,gEAAXA,EAAW,sFAAXA,EAAW,sEAAXA,EAAW,kEAAXA,EAAW,8FAAXA,EAAW,wFAAXA,EAAW,sCAAXA,EAAW,kCAAXA,EAAW,kBAAXA,CAAW,K","sources":["webpack://touchweb/./src/apps/syi/containers/short-description.tsx","webpack://touchweb/./src/apps/syi/services/draft-service.ts","webpack://touchweb/./src/apps/syi/services/user-data.ts","webpack://touchweb/./src/apps/syi/state/actions/attributes-actions.ts","webpack://touchweb/./src/apps/syi/state/actions/campaign-code-actions.ts","webpack://touchweb/./src/apps/syi/state/actions/draft-actions.js","webpack://touchweb/./src/apps/syi/state/actions/fees-actions.js","webpack://touchweb/./src/apps/syi/state/actions/long-description-actions.ts","webpack://touchweb/./src/apps/syi/state/actions/predictions-actions.ts","webpack://touchweb/./src/apps/syi/state/actions/price-actions.ts","webpack://touchweb/./src/apps/syi/state/actions/shipping-api.ts","webpack://touchweb/./src/apps/syi/state/constants.ts","webpack://touchweb/./src/apps/syi/state/drafts-api.ts","webpack://touchweb/./src/apps/syi/state/reducers/attributes.ts","webpack://touchweb/./src/apps/syi/state/reducers/buyer-region.ts","webpack://touchweb/./src/apps/syi/state/reducers/category.ts","webpack://touchweb/./src/apps/syi/state/reducers/charity.ts","webpack://touchweb/./src/apps/syi/state/reducers/draft.ts","webpack://touchweb/./src/apps/syi/state/reducers/edit.ts","webpack://touchweb/./src/apps/syi/state/reducers/images.ts","webpack://touchweb/./src/apps/syi/state/reducers/item-duration.ts","webpack://touchweb/./src/apps/syi/state/reducers/long-description.ts","webpack://touchweb/./src/apps/syi/state/reducers/member-consent.ts","webpack://touchweb/./src/apps/syi/state/reducers/predictions-reducer.ts","webpack://touchweb/./src/apps/syi/state/reducers/price.ts","webpack://touchweb/./src/apps/syi/state/reducers/shipping-reducer.ts","webpack://touchweb/./src/apps/syi/state/reducers/short-description.ts","webpack://touchweb/./src/apps/syi/state/reducers/syi.ts","webpack://touchweb/./src/apps/syi/state/reducers/template.ts","webpack://touchweb/./src/apps/syi/state/selectors/draft-selectors.ts","webpack://touchweb/./src/apps/syi/state/selectors/image-selectors.ts","webpack://touchweb/./src/apps/syi/state/selectors/predictions-selectors.ts","webpack://touchweb/./src/apps/syi/state/selectors/price-selectors.ts","webpack://touchweb/./src/apps/syi/state/selectors/syi.ts","webpack://touchweb/./src/apps/syi/state/templates-api.ts","webpack://touchweb/./src/apps/tradera/components/vip/bidding/bid-details.tsx","webpack://touchweb/./src/components/atoms/space/space.tsx","webpack://touchweb/./src/components/form-controls/use-controllable-state.ts","webpack://touchweb/./src/legacy/static/packages/analytics.ts","webpack://touchweb/./src/state/language/actions.js","webpack://touchweb/./src/state/services/fees-api.js","webpack://touchweb/./src/state/services/member-latest-published-listing-api.ts","webpack://touchweb/./src/state/services/valuation-api.ts","webpack://touchweb/./src/state/shipping-region/api.js","webpack://touchweb/./src/state/views/view-item/constants.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { shortDescriptionActions } from 'tradera/apps/syi/state/actions/short-description-actions';\nimport { getSyiSlice } from 'tradera/apps/syi/state/selectors/syi';\nimport { useTranslator } from 'tradera/lang/translate';\nimport { EditorSubSection } from '../pages/draft-page/editor-sub-section';\nimport { TextInput } from 'tradera/components/form-controls/text-input/text-input';\nimport { useAppDispatch, useAppSelector } from 'tradera/state/hooks';\nimport { showErrorToast } from 'tradera/services/toasts';\nimport { trackSyiForm } from 'tradera/apps/syi/services/syi-ga4-service';\nimport { selectDraftId } from 'tradera/apps/syi/state/selectors/draft-selectors';\nimport { Button } from 'tradera/components/atoms/button/button';\nimport { ClearTextModal } from 'tradera/apps/syi/components/clear-text-modal/clear-text-modal';\nimport CloseIcon from 'tradera/blueprint/theme/icons2/close.svg?jsx';\n\nexport const MAX_SHORT_DESCRIPTION_LENGTH = 80;\n\nexport const ShortDescription = () => {\n const { t } = useTranslator();\n const dispatch = useAppDispatch();\n const [toasterShown, setToasterShown] = useState(false);\n const [showClearButton, setShowClearButton] = useState(false);\n const [showClearTextModal, setShowClearTextModal] = useState(false);\n\n const setShortDescription = (shortDescription: string) =>\n dispatch(shortDescriptionActions.setShortDescription(shortDescription));\n\n const text = useAppSelector(\n (state) => getSyiSlice(state).shortDescription.shortDescription\n );\n const validationError = useAppSelector(\n (state) => getSyiSlice(state).shortDescription.validationError\n );\n const showError = useAppSelector(\n (state) => getSyiSlice(state).syi.allErrorsVisible\n );\n const draftId = useAppSelector(selectDraftId);\n\n const characterCount = text ? text.length : 0;\n\n useEffect(() => {\n if (characterCount > MAX_SHORT_DESCRIPTION_LENGTH && !toasterShown) {\n showErrorToast('syi_shortdescription_error_count_toast');\n setToasterShown(true);\n } else if (\n characterCount <= MAX_SHORT_DESCRIPTION_LENGTH &&\n toasterShown\n ) {\n setToasterShown(false);\n }\n }, [text, toasterShown, t, characterCount]);\n\n const handleClearTextModalConfirm = () => {\n setShortDescription('');\n setShowClearTextModal(false);\n setShowClearButton(false);\n };\n\n return (\n \n
\n setShortDescription(e.target.value)}\n error={showError && !!validationError && t(validationError)}\n collapsed\n onFocus={() => {\n setShowClearButton(true);\n trackSyiForm({\n eventName: 'syi_title_input',\n parameters: { draft_id: draftId }\n });\n }}\n onBlur={(e) => {\n if (e.relatedTarget?.id === 'clear-button') {\n return;\n }\n setShowClearButton(false);\n }}\n suffix={\n showClearButton &&\n text && (\n setShowClearTextModal(true)}>\n \n \n )\n }\n />\n {showClearTextModal && (\n setShowClearTextModal(false)}\n />\n )}\n
\n
\n );\n};\n","import { touchWebClient, webApiClient } from 'tradera/utils/http';\nimport featureToggles from 'tradera/apps/my-tradera/app/utils/feature-toggles';\nimport { isServer } from 'tradera/utils/nextjs';\nimport type {\n SaveDraftApiResponse,\n ItemDraft,\n CreateDraftFromTemplateApiResponse,\n CreateDraftFromTemplateApiRequest,\n GetDraftApiResponse,\n SaveDraftApiRequest,\n ItemDraftResponse\n} from 'tradera/state/services/types/webapi-selling-generated';\nimport type { SyiState } from 'tradera/apps/syi/state/reducer';\nimport { isNullOrUndefined } from 'tradera/utils/condition-check';\nimport qs from 'qs';\n\nconst defaultDrafts = isServer ? {} : window.sellingGlobalData?.defaultDrafts;\n\nconst resetUnwantedProperties = (draft: ItemDraft | null | undefined) => {\n return { ...draft, itemId: 0 };\n};\n\nconst getType = (draft: ItemDraft) => {\n const hasOpeningPrice = !isNullOrUndefined(draft.openingBid);\n const hasFixedPrice = !isNullOrUndefined(draft.fixedPrice);\n if (hasOpeningPrice && !hasFixedPrice) {\n return 'Auction';\n }\n\n if (hasOpeningPrice && hasFixedPrice) {\n return 'AuctionBin';\n }\n\n if (!hasOpeningPrice && hasFixedPrice) {\n return 'PureBin';\n }\n\n return 'Unknown';\n};\n\nconst ensureApplicationId = (draft: ItemDraft) => {\n return {\n ...draft,\n metadata: { ...draft.metadata, applicationId: 'SYI-Riot' }\n };\n};\n\nconst isPureBin = (draft: ItemDraft) => draft && getType(draft) === 'PureBin';\n\nconst isAuctionBin = (draft: ItemDraft) =>\n draft && getType(draft) === 'AuctionBin';\n\nconst getDefaultTemplateValue = (propertyName: K) =>\n defaultDrafts?.newTemplate?.[propertyName];\n\nexport const loadDraft = async (\n draftId: string,\n languageCodeIso2: string,\n countryCodeIso2: string\n) => {\n if (!draftId) {\n throw 'missing draftId';\n }\n\n const response = await webApiClient.get(\n `/selling/web/drafts/${draftId}?${qs.stringify({\n languageCodeIso2,\n countryCodeIso2\n })}`\n );\n\n return response.data.draft;\n};\n\nconst loadDefaultDraft = () => ({\n ...defaultDrafts.newItem,\n allowedBuyerRegion: undefined\n});\n\nconst loadDefaultTemplateDraft = () => ({\n ...defaultDrafts.newTemplate,\n allowedBuyerRegion: undefined\n});\n\nconst loadDraftFromTemplate = async (templateId: string) => {\n try {\n const response = await touchWebClient.post<\n CreateDraftFromTemplateApiResponse,\n CreateDraftFromTemplateApiRequest\n >('/selling/api/drafts/from-template', {\n templateId\n });\n const draft = response.data.draft;\n const draftWithoutItemId = resetUnwantedProperties(draft);\n return { ...draftWithoutItemId, draftReason: 'Template' };\n } catch {\n throw 'Could not load the draft from the template';\n }\n};\n\nconst saveDraft = async (draft: ItemDraft) => {\n if (draft.draftReason === 'Template') {\n // Drafts for Templates cannot be saved\n throw new Error('Cannot save a Template as a draft');\n }\n\n const ensuredDraft = ensureApplicationId(draft);\n\n return await webApiClient.post(\n '/selling/web/drafts',\n { draft: ensuredDraft }\n );\n};\n\nconst resolveImages = (syiSlice: SyiState) => {\n const images = syiSlice.images.images\n .map((image) => {\n if (image.isListingImage) {\n return {\n draftImage: null,\n listingImage: {\n imageId: image.imageId,\n rotationDegrees: image.rotationDegrees,\n filename: image.filename,\n imageGroupId: image.imageGroupId,\n isUploadedBySystem: image.isUploadedBySystem\n },\n imageUrl: image.imageUrl\n };\n } else {\n return {\n draftImage: {\n imageId: image.imageId,\n rotationDegrees: image.rotationDegrees,\n isUploadedBySystem: image.isUploadedBySystem\n },\n listingImage: null,\n imageUrl: image.imageUrl\n };\n }\n })\n .filter(Boolean);\n return images;\n};\n\nexport const buildDraftFromState = (syiSlice: SyiState) => {\n const draft: ItemDraftResponse = {\n itemFeaturesNotOfferedToMember: false,\n draftId: syiSlice.draft.draftId,\n draftReason: syiSlice.draft.draftReason,\n memberId: syiSlice.draft.memberId || 0,\n itemId: syiSlice.draft.itemId || 0,\n restart: syiSlice.draft.restart || false,\n publishedPromoted: syiSlice.draft.publishedPromoted || false,\n publishedHighlighted: syiSlice.draft.publishedHighlighted || false,\n createdDate: syiSlice.draft.createdDate || '',\n lastModifiedDate: syiSlice.draft.lastModifiedDate || '',\n reference: syiSlice.draft.reference,\n additionalDescriptions: syiSlice.draft.additionalDescriptions, //TODO\n metadata: syiSlice.draft.metadata,\n templateId: syiSlice.draft.templateId\n ? syiSlice.draft.templateId\n : undefined,\n templateName: syiSlice.draft.templateName\n ? syiSlice.draft.templateName\n : undefined,\n shortDescription: syiSlice.shortDescription.shortDescription,\n longDescription: syiSlice.longDescription.longDescription,\n descriptionLanguageCodeIso2:\n syiSlice.shortDescription.descriptionLanguageCodeIso2,\n currency: syiSlice.draft.currency,\n resellPartner: syiSlice.draft.resellPartner,\n categoryId: syiSlice.category.draftCategoryId,\n categoryPath: syiSlice.category.draftCategoryPath,\n images: resolveImages(syiSlice),\n openingBid: syiSlice.price.openingBid,\n reservePrice: syiSlice.price.reservePrice,\n fixedPrice: syiSlice.price.isPureBinSelected\n ? syiSlice.price.fixedPrice\n : syiSlice.price.auctionBinPrice,\n vat: syiSlice.price.vat,\n durationDays: syiSlice.itemDuration.durationDays,\n customEndTime: syiSlice.itemDuration.customEndTime,\n shippingOptions: syiSlice.shipping.selectedShippingOptions,\n selectedShippingSize: syiSlice.shipping.selectedShippingSize,\n fromCountry: syiSlice.shipping.fromCountry,\n itemCondition: syiSlice.itemCondition.itemCondition,\n allowedBuyerRegion: syiSlice.buyerRegion?.selectedBuyerRegion,\n campaignCode: syiSlice.campaignCode.campaignCode,\n campaignCodeId: syiSlice.campaignCode.campaignCodeId,\n displayPromoted: syiSlice.extraFeatures.displayPromoted,\n displayHighlighted: syiSlice.extraFeatures.displayHighlighted,\n charityId: syiSlice.charityCampaign.charityId,\n charity:\n featureToggles.isPennybridgeCharitiesEnabled &&\n syiSlice.charity?.charityId\n ? syiSlice.charity\n : undefined,\n allowZeroDayAuctions:\n syiSlice.charityCampaign.allowZeroDayAuctions || false,\n version: syiSlice.draft.version || 0,\n attributeValues: {\n termAttributeValues: syiSlice.attributes.categoryAttributes.map(\n (attribute) => {\n const values = attribute.options.reduce((acc, option) => {\n if (option.isActive && option.value) {\n acc.push(option.value);\n }\n return acc;\n }, [] as string[]);\n return {\n id: attribute.id,\n backingField: attribute.backingField,\n userGenerated: true,\n values\n };\n }\n )\n }\n };\n\n return draft;\n};\n\nexport default {\n isPureBin,\n isAuctionBin,\n getDefaultTemplateValue,\n loadDefaultDraft,\n loadDefaultTemplateDraft,\n loadDraftFromTemplate,\n saveDraft\n};\n","import type {\n Charity,\n GetDefaultDraftApiResponse,\n MemberPaymentOption\n} from 'tradera/state/services/types/webapi-selling-generated';\nimport { isServer } from 'tradera/utils/nextjs';\n\nexport type SellingJsData = {\n member: MemberData;\n charities: Charity[];\n isCompanyUser: boolean;\n isSwedishUser: boolean;\n defaultDrafts: GetDefaultDraftApiResponse;\n braintree: BraintreeData;\n initialBankIdForBinRequired: boolean;\n bankIdForBinRequired: boolean;\n maskedPersonalNumber: string;\n paymentOptions: MemberPaymentOption[];\n supportsVerification: boolean;\n birthdate: string;\n consent: ConsentData;\n selectedDescriptionLanguageCodeIso2: string;\n shippingFromCountryCodeIso2: string;\n combinedShippingDays: number;\n};\n\nexport type BraintreeData = {\n isBankAccountNumberProvided: boolean;\n maskedBankAccount: string;\n};\n\nexport type MemberData = {\n firstName: string;\n};\n\nexport type ConsentData = {\n hasTraderaPayConsent: boolean;\n isUnderLicense: boolean;\n needsConsentOfTraderaPayAgreement: string;\n signatoryVerificationRequired: boolean;\n};\n\n// extend window object with global data\ndeclare global {\n interface Window {\n sellingGlobalData: SellingJsData;\n }\n}\n\nexport default isServer ? undefined : window.sellingGlobalData;\n","import campaignCodeActions from './campaign-code-actions';\nimport { webApiClient } from 'tradera/utils/http';\nimport { selectCategoryAttributes } from '../selectors/attribute-selectors';\nimport { getSyiSlice } from 'tradera/apps/syi/state/selectors/syi';\nimport ThrottledAction from 'tradera/apps/syi/utils/throttled-action';\nimport { logger } from 'packages/logger';\nimport { selectPreferredLanguageCode } from 'tradera/state/language/selectors';\nimport * as imageActions from './image-actions';\nimport {\n resetAttributes,\n resetImageAttributeSuggestions,\n setCategoryAttributeOption,\n setCategoryAttributes,\n setCategoryAttributesSuggestions,\n setDraftAttributes,\n setImageToColorSuggestions,\n updateCategoryAttributesOptionsStatuses,\n autoFillSuggestedAttributes\n} from '../reducers/attributes';\nimport {\n type GetAttributeDefinitionsApiResponse,\n InputType,\n type AttributeDefinition,\n type PossibleValue,\n type DraftImageColorsApiResponse,\n type CreateSuggestAttributesApiResponse,\n type CreateSuggestAttributesApiRequest,\n ExtractorType,\n type ItemDraftResponse\n} from 'tradera/state/services/types/webapi-selling-generated';\nimport type {\n SyiAttribute,\n SyiAttributeOption\n} from 'tradera/apps/syi/components/attributes/types';\nimport type { AppDispatch, GetState } from 'tradera/state/configure-store';\n\nconst throttleTimeout = 2000;\nconst suggestionsThrottle = new ThrottledAction(throttleTimeout, true);\nconst imageToColorsThrottle = new ThrottledAction(throttleTimeout, false);\n\nconst INPUT_TYPE_MAP: Record<\n InputType.Button | InputType.Color,\n 'button' | 'color'\n> = {\n [InputType.Button]: 'button',\n [InputType.Color]: 'color'\n};\n\nconst COLOR_ATTRIBUTE_ID = 2;\n\nconst transformServerOption = (\n serverOption: PossibleValue\n): SyiAttributeOption => {\n return {\n value:\n typeof serverOption === 'string'\n ? serverOption\n : (serverOption.value ?? undefined),\n sortOrder: serverOption.sortOrder,\n isActive: false,\n warningLabel: {\n title:\n serverOption.warningLabel !== undefined &&\n serverOption.warningLabel !== null\n ? (serverOption.warningLabel.title ?? undefined)\n : undefined,\n text:\n serverOption.warningLabel !== undefined &&\n serverOption.warningLabel !== null\n ? (serverOption.warningLabel.text ?? undefined)\n : undefined\n }\n };\n};\n\nconst transformServerAttribute = (\n attribute: AttributeDefinition\n): SyiAttribute => {\n return {\n id: attribute.id,\n title: attribute.displayName ?? undefined,\n description: attribute.description ?? undefined,\n sortOrder: attribute.sortOrder,\n backingField: attribute.backingField ?? undefined,\n options: attribute.possibleValues?.map(transformServerOption) || [],\n inputType:\n INPUT_TYPE_MAP[\n attribute.type as InputType.Button | InputType.Color\n ],\n // TODO: replace isMultiSelect with maxNumberOfValues === 1\n isMultiSelect: attribute.isMultiSelect,\n maxNumberOfValues: attribute.maxNumberOfValues,\n minNumberOfValues: attribute.minNumberOfValues,\n numberOfValuesSelected: 0,\n shouldTranslateValues: attribute.shouldTranslateValues\n };\n};\n\nexport const setAttributesFromDraft =\n (draft: ItemDraftResponse) => (dispatch: AppDispatch) => {\n dispatch(setDraftAttributes(draft.attributeValues));\n };\n\nexport const reset = () => (dispatch: AppDispatch) => {\n dispatch(resetAttributes());\n};\n\nexport const fetchForCategory =\n (categoryId: number) =>\n async (dispatch: AppDispatch, getState: GetState) => {\n dispatch(reset());\n\n if (!categoryId) {\n return;\n }\n\n try {\n const languageCodeIso2 = selectPreferredLanguageCode(getState());\n const response =\n await webApiClient.get(\n `/selling/attributes/?categoryId=${categoryId}&locale=${languageCodeIso2}`\n );\n dispatch(\n setCategoryAttributes(\n response.data.attributeDefinitions?.map(\n transformServerAttribute\n ) || []\n )\n );\n dispatch(updateCategoryAttributesOptionsStatuses());\n dispatch(campaignCodeActions.validateCampaignCode());\n dispatch(imageActions.fetchImageAttributeSuggestions());\n } catch (error) {\n dispatch(reset());\n throw error;\n }\n };\n\nexport const updateAttribute =\n (\n attributeId: number,\n optionValue: string,\n activate: boolean,\n onUpdated?: () => void\n ) =>\n (dispatch: AppDispatch, getState: GetState) => {\n const { maxNumberOfValues, numberOfValuesSelected, isMultiSelect } =\n selectCategoryAttributes(getState()).find(\n (a) => a.id === attributeId\n ) || {};\n\n if (\n activate &&\n isMultiSelect &&\n maxNumberOfValues === numberOfValuesSelected\n ) {\n return;\n }\n\n dispatch(\n setCategoryAttributeOption({\n attributeId,\n optionValue,\n activate\n })\n );\n dispatch(campaignCodeActions.validateCampaignCode());\n onUpdated?.();\n };\n\nexport const resetAttribute =\n (attributeId: number) => (dispatch: AppDispatch) => {\n dispatch(\n setCategoryAttributeOption({\n attributeId,\n activate: false\n })\n );\n dispatch(campaignCodeActions.validateCampaignCode());\n };\n\nexport const throttledFetchCategoryAttributeSuggestions =\n (categoryId: number, shortDescription: string) =>\n (dispatch: AppDispatch) => {\n const action = () => {\n dispatch(\n fetchCategoryAttributeSuggestions(categoryId, shortDescription)\n );\n };\n suggestionsThrottle.execute(action);\n };\n\nexport const throttledFetchImageAttributeSuggestions =\n (draftImageIds: string[]) =>\n (dispatch: AppDispatch, getState: GetState) => {\n const featureSwitches = getState().environment.featureSwitches;\n const draftCategoryId =\n getSyiSlice(getState())?.category?.draftCategoryId;\n const categoryAttributes =\n getSyiSlice(getState())?.attributes?.categoryAttributes;\n const hasColorAttribute =\n categoryAttributes &&\n categoryAttributes.some(\n (attribute) => attribute.backingField === 'color'\n );\n\n if (\n !featureSwitches['syi-image-attribute-suggestions'] ||\n !draftImageIds ||\n draftImageIds.length === 0 ||\n !draftCategoryId ||\n draftCategoryId === 0 ||\n !hasColorAttribute\n ) {\n return;\n }\n const action = () => {\n dispatch(fetchImageAttributeSuggestions(draftImageIds));\n };\n imageToColorsThrottle.execute(action);\n };\n\nconst fetchImageAttributeSuggestions =\n (draftImageIds: string[]) => async (dispatch: AppDispatch) => {\n dispatch(resetImageAttributeSuggestions());\n\n const paramKeyPart = 'imageIds=';\n const query = paramKeyPart + draftImageIds.join(`&${paramKeyPart}`);\n\n try {\n const response =\n await webApiClient.get(\n `/selling/image-colors?${query}`\n );\n\n const colors =\n response.data?.colorValues\n ?.map((cv) => cv.color)\n .filter((c) => c !== null && c !== undefined) || [];\n\n dispatch(\n setImageToColorSuggestions({\n suggestedAttributes: [\n {\n id: COLOR_ATTRIBUTE_ID,\n name: 'color',\n values: colors\n }\n ]\n })\n );\n } catch (error) {\n logger(error);\n }\n };\n\nexport const fetchCategoryAttributeSuggestions =\n (categoryId: number, shortDescription: string | null) =>\n async (dispatch: AppDispatch, getState: GetState) => {\n const featureSwitches = getState().environment.featureSwitches;\n if (!featureSwitches['syi-attribute-suggestions']) {\n return;\n }\n\n if (!categoryId || !shortDescription) {\n return;\n }\n\n const splitTestGroup = getState().environment.splitTestGroups[\n 'attribute_suggestion_extractor'\n ] as ExtractorType;\n if (!splitTestEnabled(splitTestGroup)) {\n return;\n }\n const extractorType = getAttributeSuggestionExtractor(splitTestGroup);\n\n try {\n const params = {\n categoryId,\n shortDescription,\n extractorType: extractorType as unknown as ExtractorType\n };\n const response = await webApiClient.post<\n CreateSuggestAttributesApiResponse,\n CreateSuggestAttributesApiRequest\n >('/selling/suggest/attributes', params);\n\n dispatch(\n setCategoryAttributesSuggestions({\n suggestedAttributes:\n response.data.attributeValues?.termAttributeValues ||\n [],\n suggestionsExtractorType: response.data.extractorType\n })\n );\n dispatch(autoFillSuggestedAttributes());\n } catch (error) {\n dispatch({\n type: 'RESET_ATTRIBUTES'\n });\n throw error;\n }\n };\n\nconst splitTestEnabled = (splitTest: ExtractorType) =>\n splitTest.toLocaleLowerCase() !== 'control';\n\nconst getAttributeSuggestionExtractor = (splitTest: ExtractorType) => {\n switch (splitTest) {\n case ExtractorType.Code.toLocaleLowerCase():\n return 0;\n case ExtractorType.Tradera.toLocaleLowerCase():\n return 1;\n case ExtractorType.Google.toLocaleLowerCase():\n return 2;\n default:\n return 0;\n }\n};\n","/* eslint-disable promise/always-return */\n/* eslint-disable promise/catch-or-return */\nimport campaignService from 'tradera/apps/syi/services/campaign-service';\nimport ThrottledAction from 'tradera/apps/syi/utils/throttled-action';\nimport userData from 'tradera/apps/syi/services/user-data';\nimport { setDisplayPromoted, setDisplayHighlighted } from './draft-actions';\nimport { getSyiSlice } from 'tradera/apps/syi/state/selectors/syi';\nimport type { AppDispatch, GetState } from 'tradera/state/configure-store';\nimport {\n disableZeroDayAuctions,\n enableRestart,\n enableZeroDayAuctions\n} from '../reducers/item-duration';\nimport { resetSelectedShippingOptions } from 'tradera/apps/syi/state/reducers/shipping-reducer';\nimport {\n initializeCampaignCodeState,\n resetCampaignBanner,\n resetFees,\n searchingForCampaignCodeIsDelayed,\n setCampaignValidationResult,\n setUnverifiedCampaignCode,\n toggleCampaignCodeCheckbox,\n validatingCampaignCodeBySearching\n} from 'tradera/apps/syi/state/reducers/campaign-code';\nimport type { Charity } from 'tradera/state/services/types/webapi-selling-generated';\nimport { disableRestart } from 'tradera/apps/syi/state/reducers/draft';\nimport {\n resetCharityCampaign as resetCharityCampaignReducer,\n setCharityCampaign\n} from 'tradera/apps/syi/state/reducers/charity-campaign';\n\nconst CHARITIES = userData?.charities || [];\nconst throttleTimeout = 2000;\nconst throttledCampaignCodeValidation = new ThrottledAction(throttleTimeout);\nlet delayedValidationTimeoutId: ReturnType | undefined =\n undefined;\n\nconst findBrandAttributeValues = (getState: GetState) => {\n if (\n !getSyiSlice(getState()).attributes ||\n !getSyiSlice(getState()).attributes.categoryAttributes\n ) {\n return [];\n }\n\n const brandAttribute = getSyiSlice(\n getState()\n ).attributes.categoryAttributes.find((attribute) => {\n const brandAttributeId = 3; //Brand Attribute has Id == 3\n if (attribute.id != brandAttributeId) {\n return false;\n }\n if (attribute.options.length === 0) {\n return false;\n }\n return true;\n });\n\n const brandAttributeValues = brandAttribute?.options\n .filter((option) => option.isActive)\n .map((option) => option.value)\n .filter((value) => value !== undefined);\n return brandAttributeValues ?? [];\n};\n\nconst resetCharityCampaign = (dispatch: AppDispatch, getState: GetState) => {\n const { name, forceFreeShipping: wasForceFreeShipping } =\n getSyiSlice(getState()).charityCampaign;\n if (!name) {\n return;\n }\n dispatch(resetCharityCampaignReducer());\n dispatch(disableZeroDayAuctions());\n if (wasForceFreeShipping) {\n dispatch(resetSelectedShippingOptions());\n }\n};\n\nconst resetCampaign = (dispatch: AppDispatch) => {\n dispatch(resetCharityCampaign);\n dispatch({\n type: 'UNSET_UNSOLD_FEE_FREE_FOR_CAMPAIGN'\n });\n dispatch(enableRestart());\n dispatch(resetFees());\n dispatch(resetCampaignBanner());\n};\n\nconst applyCharityFromCampaignCodeId =\n (campaignCodeId: number, campaignCode: string) =>\n (dispatch: AppDispatch) => {\n const charityCampaign = CHARITIES.find(\n (charityCampaign: Charity) =>\n charityCampaign.campaignCodeId === campaignCodeId\n );\n\n if (!charityCampaign) {\n dispatch(resetCharityCampaign);\n return;\n }\n\n dispatch(setCharityCampaign({ charityCampaign, campaignCode }));\n const { allowZeroDayAuctions, forceFreeShipping } = charityCampaign;\n\n if (allowZeroDayAuctions) {\n dispatch(enableZeroDayAuctions());\n }\n\n if (forceFreeShipping) {\n dispatch({\n type: 'FORCE_FREE_SHIPPING'\n });\n }\n\n dispatch(setDisplayPromoted(false));\n dispatch(setDisplayHighlighted(false));\n };\n\nconst validateCampaignCode =\n () => (dispatch: AppDispatch, getState: GetState) => {\n const campaignCode = getSyiSlice(getState()).campaignCode.campaignCode;\n if (!campaignCode || campaignCode.trim().length === 0) {\n return;\n }\n dispatch(validatingCampaignCodeBySearching());\n const isReadOnly = getSyiSlice(getState()).campaignCode.isReadOnly;\n throttledCampaignCodeValidation.execute(function () {\n const category = getSyiSlice(getState()).category;\n const brandAttributeValues = findBrandAttributeValues(getState);\n campaignService\n .validate(\n campaignCode,\n category.draftCategoryId?.toString() ?? '',\n brandAttributeValues\n )\n .then((result) => {\n const {\n bannerDesktopImageUrl,\n bannerMobileImageUrl,\n bannerTabletImageUrl,\n campaignCodeId,\n hasEnded,\n isUnsoldFeeFree,\n maxFeeCap,\n provisionFactor = null,\n validationDisplayMessage\n } = result;\n\n // If the campaign is read-only, ignore if the code is invalid since it has already been used.\n const campaignCodeValid = isReadOnly\n ? true\n : result.campaignCodeValid;\n const campaignCodeMessage = isReadOnly\n ? null\n : result.campaignCodeMessage;\n\n const campaignCodeDescription = campaignCodeValid\n ? campaignCodeMessage\n : validationDisplayMessage;\n\n const commissionPercent =\n provisionFactor !== null\n ? `${provisionFactor * 100}`\n : null;\n\n dispatch(\n setCampaignValidationResult({\n bannerDesktopImageUrl,\n bannerMobileImageUrl,\n bannerTabletImageUrl,\n campaignCode,\n campaignCodeDescription,\n campaignCodeId,\n campaignCodeValid,\n hasEnded,\n maxFeeCap,\n commissionPercent\n })\n );\n\n if (!campaignCodeValid) {\n dispatch(resetCampaign);\n return;\n }\n\n if (isUnsoldFeeFree) {\n dispatch({\n type: 'SET_UNSOLD_FEE_FREE_FOR_CAMPAIGN'\n });\n }\n\n dispatch(disableRestart());\n\n if (campaignCodeId) {\n dispatch(\n applyCharityFromCampaignCodeId(\n campaignCodeId,\n campaignCode\n )\n );\n }\n });\n });\n };\n\nconst saveTypedCampaignCode =\n (inputCampaignCode: string) =>\n (dispatch: AppDispatch, getState: GetState) => {\n const campaignCode = inputCampaignCode?.trim() || null;\n dispatch(setUnverifiedCampaignCode(campaignCode));\n\n if (delayedValidationTimeoutId) {\n clearTimeout(delayedValidationTimeoutId);\n }\n\n if (campaignCode === null) {\n dispatch(resetCampaign);\n return;\n }\n\n /* eslint-disable-next-line better-mutation/no-mutation */\n delayedValidationTimeoutId = setTimeout(() => {\n if (delayedValidationTimeoutId) {\n clearTimeout(delayedValidationTimeoutId);\n }\n dispatch(validateCampaignCode());\n /* eslint-disable-next-line better-mutation/no-mutation */\n delayedValidationTimeoutId = setTimeout(() => {\n if (getSyiSlice(getState()).campaignCode.searching) {\n dispatch(searchingForCampaignCodeIsDelayed());\n }\n }, 100);\n }, 700);\n };\n\nconst setInitialCampaignCode =\n (\n campaignCode: string | null,\n campaignCodeId?: number,\n campaignCodeDescription?: string,\n isChangeItem?: boolean\n ) =>\n (dispatch: AppDispatch) => {\n const isReadOnly = !!campaignCodeId && !!isChangeItem;\n\n dispatch(\n initializeCampaignCodeState({\n campaignCode,\n campaignCodeId,\n campaignCodeDescription,\n isReadOnly\n })\n );\n dispatch(resetCampaign);\n\n // Always validate because this fetches info about the campaign like free shipping etc.\n // If the campaign is read-only, ignore if the code is invalid since it has already been used.\n dispatch(validateCampaignCode());\n };\n\nconst toggleShowInput = (isChecked: boolean) => (dispatch: AppDispatch) => {\n if (delayedValidationTimeoutId) {\n clearTimeout(delayedValidationTimeoutId);\n }\n dispatch(toggleCampaignCodeCheckbox(isChecked));\n dispatch(resetCampaign);\n};\n\nexport default {\n toggleShowInput,\n setInitialCampaignCode,\n saveTypedCampaignCode,\n validateCampaignCode\n};\n","/* eslint-disable promise/always-return */\nimport publishService from 'tradera/apps/syi/services/publish-service';\nimport navigationService from 'tradera/apps/syi/services/navigation-service';\nimport draftService, {\n buildDraftFromState,\n loadDraft as loadDraftFromServer\n} from 'tradera/apps/syi/services/draft-service';\nimport { setDraftCategory } from './category-actions';\nimport * as imageActions from './image-actions';\nimport { setFromDraft } from './price-actions';\nimport { shortDescriptionActions } from './short-description-actions';\nimport { setDescriptionLanguageCodeIso2 } from 'tradera/apps/syi/state/reducers/short-description';\nimport { setLongDescriptionFromDraft } from './long-description-actions';\nimport { getAndSetShippingOptionsByWeight } from './shipping-actions';\nimport {\n resetSelectedShippingOptions,\n setSelectedShippingSize,\n setShippingFromCountry\n} from '../reducers/shipping-reducer';\nimport campaignCodeActions from './campaign-code-actions';\nimport {\n resetCharityAndShippingInfo,\n setCharityAndFetchInfo,\n setCharityFromDraftAndFetchInfo\n} from 'tradera/apps/syi/state/actions/charity-actions';\nimport feesActions from './fees-actions';\nimport { setAttributesFromDraft } from './attributes-actions';\nimport scribe from 'tradera/apps/syi/services/scribe';\nimport {\n setAllowedBuyerRegion,\n setAvailableAllowedBuyerRegions\n} from '../reducers/buyer-region';\nimport { resetImageAttributeSuggestions } from '../reducers/attributes';\nimport { getSyiSlice } from 'tradera/apps/syi/state/selectors/syi';\nimport {\n selectCategorySuggestedAttributes,\n selectImageToColorSuggestedAttributes\n} from 'tradera/apps/syi/state/selectors/attribute-selectors';\nimport { selectFeatureSwitches } from 'tradera/state/environment/selectors';\nimport { trackAttributeSuggestions } from './draft-tracking';\nimport dayjs from 'dayjs';\nimport {\n getDefaultSelectedDescriptionLanguageCodeIso2,\n getDefaultShippingFromCountryCodeIso2\n} from 'tradera/apps/my-tradera/app/components/settings/selling/item-localization';\nimport userData from 'tradera/apps/syi/services/user-data';\nimport initData from 'init-data';\nimport { Tags, util } from '../drafts-api';\nimport {\n setCustomEndTime,\n setDurationDays,\n getCustomEndTimeForWeekdays\n} from '../reducers/item-duration';\nimport { GtmService as gtm } from 'tradera/services/google-tagmanager/google-tagmanager-service';\nimport {\n disableAutoSave,\n enableAutoSave,\n hideAllErrors,\n resetSyi,\n setDraftCanBeResumed,\n setIsDraftSaved,\n setIsEditOfPublishedItem,\n setPublishFailed,\n setPublishPending\n} from '../reducers/syi';\nimport { selectShippingRegionCountryCodeIso2 } from 'tradera/state/shipping-region/selectors';\nimport {\n addAdditionalDescription,\n setCurrency,\n setDraftId,\n setDraftIsLoading,\n setDraftProperties,\n setDraftReason,\n setDraftVersion,\n setMagicalSyiEnabled,\n ensureDraftReason,\n setResellPartner,\n resetDraft\n} from 'tradera/apps/syi/state/reducers/draft';\nimport { memberApi } from 'tradera/state/services/member-api';\nimport { trackSyiForm } from 'tradera/apps/syi/services/syi-ga4-service';\nimport {\n selectIsItemConditionDirty,\n selectItemCondition\n} from 'tradera/apps/syi/state/selectors/item-condition-selectors';\nimport { setHasUsedAutoFill } from 'tradera/apps/syi/state/reducers/predictions-reducer';\nimport { handleError, logError, reloadOnUnauthorized } from 'tradera/utils/api';\nimport { selectPreferredLanguageCode } from 'tradera/state/language/selectors';\nimport { showErrorToast, showInfoToast } from 'tradera/services/toasts';\nimport { HTTP_STATUS_CODES } from 'tradera/constants/http-status-codes';\nimport { AxiosError } from 'axios';\nimport { translateErrorCode } from 'tradera/apps/syi/state/actions/helpers/server-validation-error-helper';\n\nconst trackAddonBeforePublish = function (addOnfeatureName) {\n gtm.trackAction('Listing AddOns', addOnfeatureName, 'Before Publish');\n};\n\nexport const setDraft =\n (draft, params = {}) =>\n (dispatch, getState) => {\n const memberCountryCodeIso2 =\n selectShippingRegionCountryCodeIso2(getState());\n\n const fromCountry =\n draft.fromCountry ||\n userData.shippingFromCountryCodeIso2 ||\n getDefaultShippingFromCountryCodeIso2(memberCountryCodeIso2);\n\n dispatch(setShippingFromCountry({ fromCountry }));\n\n dispatch(disableAutoSave());\n dispatch(ensureDraftReason(draft));\n\n const isNewDraft =\n getSyiSlice(getState()).draft.draftId != draft.draftId ||\n getSyiSlice(getState()).draft.draftReason != draft.draftReason;\n const isChangeItem = draft.draftReason === 'ChangeItem';\n\n // Do first for actions that depends on this info.\n dispatch(setIsEditOfPublishedItem(isChangeItem));\n dispatch(hideAllErrors());\n\n dispatch(setDraftProperties(draft));\n\n dispatch(\n setAllowedBuyerRegion({\n allowedBuyerRegion: draft.allowedBuyerRegion\n })\n );\n dispatch(setAvailableAllowedBuyerRegions());\n // fallback to null to not become dirty if undefined\n dispatch(setItemConditionFromUser(draft.itemCondition ?? null));\n dispatch(\n campaignCodeActions.setInitialCampaignCode(\n draft.campaignCode,\n draft.campaignCodeId,\n draft.campaignCodeDescription,\n isChangeItem\n )\n );\n\n // Setting short description also loads top categories!\n dispatch(\n shortDescriptionActions.setShortDescription(draft.shortDescription)\n );\n dispatch(\n setDescriptionLanguageCodeIso2(\n draft.descriptionLanguageCodeIso2 ||\n userData.selectedDescriptionLanguageCodeIso2 ||\n getDefaultSelectedDescriptionLanguageCodeIso2(\n initData.languageCodeIso2,\n memberCountryCodeIso2\n )\n )\n );\n dispatch(setCurrency(draft.currency));\n dispatch(setResellPartner(draft.resellPartner));\n dispatch(setDraftCategory(draft.categoryId, draft.categoryPath, false));\n\n dispatch(\n setDurationDays({ durationDays: draft.durationDays, isChangeItem })\n );\n\n /*\n * If the draft has a custom end time, use it.\n * If the draft is a new item and not from a template, use the custom end time for weekdays.\n * Otherwise, use undefined (do not set custom end time).\n */\n const customEndTime = draft.customEndTime\n ? draft.customEndTime\n : draft.draftReason === 'NewItem' && !draft.templateId\n ? getCustomEndTimeForWeekdays(draft.durationDays)\n : undefined;\n\n dispatch(\n setCustomEndTime({\n customEndTime: customEndTime,\n isChangeItem\n })\n );\n dispatch(setLongDescriptionFromDraft(draft.longDescription));\n dispatch(setDisplayPromoted(draft.displayPromoted));\n dispatch(setDisplayHighlighted(draft.displayHighlighted));\n dispatch(imageActions.setDraftImages(draft.images || []));\n dispatch(resetImageAttributeSuggestions());\n dispatch(\n setFromDraft(\n draft.openingBid,\n draft.fixedPrice,\n draft.reservePrice,\n draft.charity?.charityId,\n draft.vat,\n isChangeItem\n )\n );\n\n const pennybridgeCharitiesEnabled =\n selectFeatureSwitches(getState())['pennybridge-charities'];\n\n if (pennybridgeCharitiesEnabled) {\n if (params.charityId) {\n dispatch(setCharityAndFetchInfo(params.charityId));\n } else if (draft.charity) {\n dispatch(setCharityFromDraftAndFetchInfo(draft.charity));\n }\n }\n dispatch(setAttributesFromDraft(draft));\n\n dispatch(getAndSetShippingOptionsByWeight(draft.shippingOptions));\n dispatch(setSelectedShippingSize(draft.selectedShippingSize));\n\n if (draft.draftReason !== 'Template') {\n dispatch(enableAutoSave());\n }\n\n dispatch(memberApi.endpoints.getMagicalSyiEnabled.initiate())\n .then((result) => {\n if (result.data) {\n dispatch(setMagicalSyiEnabled(result.data.enabled));\n }\n })\n .catch(() => {\n // Do nothing\n });\n\n if (isNewDraft) {\n scribe.sendSessionStart();\n }\n };\n\nconst resetAllDraftData = () => (dispatch) => {\n dispatch(setDraftIsLoading(false));\n dispatch(setDraft({}));\n dispatch(resetDraft());\n dispatch(disableAutoSave());\n};\n\nconst handleDraftError = (dispatch) => (error) => {\n const response = error?.response;\n const status = response?.status;\n\n // Log any non-client errors (not 4xx HTTP status codes)\n if (!(error instanceof AxiosError) || !String(status).startsWith('4')) {\n logError(error);\n throw error;\n }\n\n const data = response?.data;\n switch (status) {\n case HTTP_STATUS_CODES.NOT_FOUND:\n case HTTP_STATUS_CODES.FORBIDDEN: {\n showErrorToast('syi_drafts_error_not_found');\n navigationService.goToStart();\n dispatch(resetAllDraftData());\n return;\n }\n case HTTP_STATUS_CODES.GONE: {\n showInfoToast('syi_drafts_error_already_published');\n const itemId = data.publishedItemId || data.itemId;\n if (itemId) {\n navigationService.goToPublished(itemId);\n dispatch(resetAllDraftData());\n }\n return;\n }\n }\n\n reloadOnUnauthorized(error);\n};\n\nconst loadDraft = (dispatch, draftId, languageCodeIso2, countryCodeIso2) => {\n dispatch(setDraftIsLoading(true));\n return loadDraftFromServer(draftId, languageCodeIso2, countryCodeIso2)\n .then((result) => {\n dispatch(setDraft(result));\n dispatch(setIsDraftSaved(true));\n dispatch(setDraftIsLoading(false));\n return result;\n })\n .catch(handleError())\n .catch(handleDraftError(dispatch, languageCodeIso2))\n .catch(() => {\n showErrorToast('syi_drafts_error_loading');\n dispatch(setDraftIsLoading(false));\n navigationService.goToStart();\n dispatch(resetAllDraftData());\n });\n};\n\nexport const loadImagesFromDraft = (draftId) => async (dispatch, getState) => {\n const browserDraftImageUrls = (getSyiSlice(getState()).images.images || [])\n .map((image) => image.imageUrl)\n .filter(Boolean);\n\n const serverDraft = await loadDraftFromServer(draftId);\n const serverDraftImages = serverDraft.images || [];\n const serverDraftImageUrls = serverDraftImages.map(\n (image) => image.imageUrl\n );\n\n const changedImages = browserDraftImageUrls\n .filter((x) => !serverDraftImageUrls.includes(x))\n .concat(\n serverDraftImageUrls.filter(\n (x) => !browserDraftImageUrls.includes(x)\n )\n );\n const imagesHaveChanged = changedImages.length > 0;\n if (imagesHaveChanged) {\n dispatch(imageActions.setDraftImages(serverDraftImages));\n }\n return imagesHaveChanged;\n};\n\n// KATS: this should perhaps be moved to the draft service on BE - do not save a draft if it's not\n// complete. Then we could check in FE if the save action succeeded, and if it did then we know that it can be resumed.\nexport const canBeResumed = (\n draftId,\n draftReason,\n shortDescription,\n longDescription,\n images\n) => {\n if (!draftId) {\n return false;\n }\n\n var hasShortDescription =\n shortDescription && shortDescription.trim().length > 0;\n var hasLongDescription =\n longDescription && longDescription.trim().length > 0;\n var hasImage =\n Array.isArray(images) && images.some((image) => !!image.imageUrl);\n return hasShortDescription || hasLongDescription || hasImage;\n};\n\nexport const updateDraftCanBeResumed = () => (dispatch, getState) => {\n const draft = getSyiSlice(getState()).draft;\n const shortDescription =\n getSyiSlice(getState()).shortDescription.shortDescription;\n const longDescription =\n getSyiSlice(getState()).longDescription.longDescription;\n const images = getSyiSlice(getState()).images.images;\n\n // TODO: avoid duplication by using canBeResumed\n if (!draft.draftId) {\n return false;\n }\n\n if (draft.draftReason !== 'NewItem') {\n return false;\n }\n\n var hasShortDescription =\n shortDescription && shortDescription.trim().length > 0;\n var hasLongDescription =\n longDescription && longDescription.trim().length > 0;\n var hasImage = Array.isArray(images) && images.length > 0;\n const canBeResumed = hasShortDescription || hasLongDescription || hasImage;\n\n dispatch(setDraftCanBeResumed(canBeResumed));\n};\n\nexport const setDisplayPromoted = (displayPromoted) => (dispatch) => {\n dispatch({\n type: 'SET_DISPLAY_PROMOTED',\n payload: displayPromoted || false\n });\n dispatch(feesActions.updatePrices());\n};\n\nexport const setDisplayHighlighted = (displayHighlighted) => (dispatch) => {\n dispatch({\n type: 'SET_DISPLAY_HIGHLIGHTED',\n payload: displayHighlighted || false\n });\n dispatch(feesActions.updatePrices());\n};\n\nexport const publish = (t, doneCallback) => (dispatch, getState) => {\n dispatch(setPublishPending());\n dispatch(disableAutoSave());\n\n const state = getSyiSlice(getState());\n const { displayHighlighted, displayPromoted } = state.extraFeatures;\n const reservePrice = state.price.reservePrice;\n const draft = buildDraftFromState(state);\n var splitTestGroups = getState().environment.splitTestGroups;\n var featureSwitches = getState().environment.featureSwitches;\n const customEndTime = state.itemDuration.customEndTime;\n\n if (draft.draftReason === 'NewItem') {\n gtm.trackAction(\n 'SYI',\n 'Creation time in seconds',\n String(dayjs().diff(dayjs(state.syi.creationStart), 'second'))\n );\n }\n\n publishService\n .publish(draft, state.memberConsent.hasTraderaPayConsent)\n .then((result) => {\n if (displayHighlighted) {\n trackAddonBeforePublish('Highlight');\n }\n if (displayPromoted) {\n trackAddonBeforePublish('Rank up');\n }\n if (reservePrice) {\n trackAddonBeforePublish('Reserve price');\n }\n if (customEndTime) {\n trackAddonBeforePublish('End time');\n }\n\n if (featureSwitches['syi-attribute-suggestions']) {\n const draftSelectedCategoryAttributes =\n draft.attributeValues.termAttributeValues;\n const suggestedCategoryAttributes =\n selectCategorySuggestedAttributes(getState()) || [];\n if (draftSelectedCategoryAttributes.length > 0) {\n trackAttributeSuggestions(\n draftSelectedCategoryAttributes,\n suggestedCategoryAttributes,\n splitTestGroups['attribute_suggestion_extractor'],\n state.draft.isNewDraft,\n result.itemId\n );\n }\n }\n\n if (featureSwitches['syi-image-attribute-suggestions']) {\n const draftSelectedColorAttributes =\n draft.attributeValues.termAttributeValues.filter(\n (a) => a.backingField === 'color'\n );\n const suggestedColorAttributes =\n selectImageToColorSuggestedAttributes(getState()) || [];\n if (draftSelectedColorAttributes) {\n trackAttributeSuggestions(\n draftSelectedColorAttributes,\n suggestedColorAttributes,\n 'ImageToColor',\n state.draft.isNewDraft,\n result.itemId\n );\n }\n }\n\n const { predictions, shortDescription, longDescription } = state;\n const hasAiTitle =\n predictions.shortDescription ===\n shortDescription.shortDescription;\n const hasAiDescription =\n predictions.longDescription === longDescription.longDescription;\n\n trackSyiForm({\n eventName: 'syi_form_submit_success',\n parameters: {\n form_name: 'syi',\n item_id: result.itemId,\n ai_title: hasAiTitle ? 1 : 0,\n ai_description: hasAiDescription ? 1 : 0,\n ai_images: predictions.numProcessedImages,\n ai_processing_time: predictions.aiProcessingTime,\n draft_id: draft.draftId\n }\n });\n\n doneCallback?.(result.itemId);\n\n navigationService.goToPublished(result.itemId);\n dispatch(resetAllDraftData());\n })\n .catch(handleError())\n .catch(handleDraftError(dispatch))\n .catch((error) => {\n dispatch(setPublishFailed(translateErrorCode(error, t)));\n });\n};\n\nexport const loadDraftIfMissing = (draftId) => (dispatch, getState) => {\n var draft = getSyiSlice(getState()).draft;\n const isAlreadyLoaded = draft.draftId === draftId;\n if (isAlreadyLoaded) {\n return Promise.resolve(draft);\n }\n const languageCodeIso2 = selectPreferredLanguageCode(getState());\n const countryCodeIso2 = selectShippingRegionCountryCodeIso2(getState());\n return loadDraft(dispatch, draftId, languageCodeIso2, countryCodeIso2);\n};\n\nexport const loadDefaultDraft =\n ({ charityId }) =>\n (dispatch) => {\n dispatch(resetSyi());\n dispatch(resetDraft());\n dispatch(resetCharityAndShippingInfo());\n dispatch(setDraft(draftService.loadDefaultDraft(), { charityId }));\n dispatch(resetSelectedShippingOptions());\n };\n\nexport const loadDefaultTemplateDraft = () => (dispatch) => {\n dispatch(resetSyi());\n dispatch(resetCharityAndShippingInfo());\n var template = draftService.loadDefaultTemplateDraft();\n dispatch(setDraft({ ...template, templateId: 'new' }));\n};\n\nexport const useDraftAsTemplate = () => (dispatch) => {\n dispatch(setDraftReason('Template'));\n dispatch(setDraftId(null));\n};\n\nexport const triggerSave = () => (dispatch) => dispatch(saveDraft);\n\nexport const saveDraft = (dispatch, getState) => {\n const draft = buildDraftFromState(getSyiSlice(getState()));\n const version = getSyiSlice(getState()).draft.version || 0;\n return draftService\n .saveDraft(draft)\n .then((response) => {\n const { data } = response;\n if (draft.draftId !== data.draftId) {\n dispatch(setDraftId(data.draftId));\n }\n if (version > 0 && version + 1 !== data.version) {\n // Unexpected version. The draft is being edited somewhere else.\n }\n dispatch(setIsDraftSaved(true));\n const wasNewDraftWithoutId = !draft.draftId && !!data.draftId;\n // since this function runs on a timer, we might have moved to a new route.\n // For example, when publishing a draft, we move to the published page, but\n // this function might run afterwards, which creates a new draft. Therefore,\n // make sure to only run this if we are still on the 'new' route. TWT-6947\n const routeIsNew = window.location.href.endsWith('/new');\n if (wasNewDraftWithoutId && routeIsNew) {\n navigationService.setDraftUrlWithoutReload(data.draftId);\n }\n // Must happen after new URL is set for re-render to happen.\n dispatch(setDraftVersion(data.version));\n // KATS: This is only manually dispatched since not all of the templates API is in RTK query yet\n dispatch(util.invalidateTags([Tags.DRAFT_LIST]));\n\n return data;\n })\n .catch(handleError())\n .catch(handleDraftError(dispatch));\n // If error is thrown here, auto-saver will catch it and retry\n};\n\nconst setUsedAllowed = (isAllowed) => ({\n type: 'SET_ITEM_CONDITION_SELECTION_ERROR',\n payload: isAllowed ? null : 'syi_validation_used_not_allowed_for_category'\n});\n\nexport const setItemConditionFromUser = (condition) => (dispatch) => {\n dispatch({\n type: 'SET_ITEM_CONDITION_FROM_USER',\n payload: condition\n });\n dispatch(updateItemConditionRestrictionForCategory());\n};\n\nexport const setItemConditionFromPrediction =\n (condition) => (dispatch, getState) => {\n const isPristine = !selectIsItemConditionDirty(getState());\n if (!isPristine) {\n return;\n }\n const oldValue = selectItemCondition(getState());\n\n dispatch({\n type: 'SET_ITEM_CONDITION',\n payload: condition\n });\n\n if (oldValue !== condition) {\n dispatch(setHasUsedAutoFill(true));\n }\n\n dispatch(updateItemConditionRestrictionForCategory());\n };\n\nexport const updateItemConditionRestrictionForCategory =\n () => (dispatch, getState) => {\n const condition = getSyiSlice(getState()).itemCondition.itemCondition;\n const isUsed = condition === 'Used';\n if (isUsed) {\n const isAllowed = isUsedAllowed(getState);\n dispatch(setUsedAllowed(isAllowed));\n } else {\n dispatch(setUsedAllowed(true));\n }\n };\n\nconst isUsedAllowed = (getState) => {\n const categoryRestriction = getSyiSlice(getState()).syi.categoryRestriction;\n return !categoryRestriction || categoryRestriction.allowUsed !== false;\n};\n\nexport const resetItemCondition = () => ({\n type: 'RESET_ITEM_CONDITION'\n});\n\nexport const publishAdditionalDescription = (text) => (dispatch, getState) => {\n if (text && text.length > 0) {\n dispatch(addAdditionalDescription(text));\n }\n dispatch(setPublishPending());\n const draft = buildDraftFromState(getSyiSlice(getState()));\n publishService\n .publish(draft)\n .then((result) => {\n navigationService.goToPublished(result.itemId);\n dispatch(resetAllDraftData());\n })\n .catch(handleError())\n .catch(handleDraftError(dispatch))\n .catch(() => {\n dispatch(setPublishFailed());\n });\n};\n","import { getSyiSlice } from 'tradera/apps/syi/state/selectors/syi';\nimport { PossibleFeatures } from 'tradera/apps/syi/state/reducers/fees';\n\nconst updatePrices = () => (dispatch, getState) => {\n const featureFees = [];\n const state = getSyiSlice(getState());\n\n if (state.price.reservePrice) {\n featureFees.push(PossibleFeatures.reservePrice);\n }\n\n if (state.extraFeatures.displayHighlighted) {\n featureFees.push(PossibleFeatures.highlight);\n }\n\n if (state.extraFeatures.displayPromoted) {\n featureFees.push(PossibleFeatures.rankUp);\n }\n\n dispatch({\n type: 'SET_CHOSEN_EXTRA_FEATURES',\n payload: featureFees\n });\n};\n\nexport default {\n updatePrices\n};\n","import {\n resetLongDescription,\n setLongDescription as setLongDescriptionReducer,\n setLongDescriptionFromDraft as setLongDescriptionFromDraftReducer\n} from 'tradera/apps/syi/state/reducers/long-description';\nimport { updateDraftCanBeResumed } from './draft-actions';\nimport type {\n AppDispatch,\n GetState,\n RootState\n} from 'tradera/state/configure-store';\nimport { selectLongDescription } from 'tradera/apps/syi/state/selectors/syi';\nimport { createAsyncThunk } from '@reduxjs/toolkit';\nimport type {\n OffsitePaymentDetectionApiRequest,\n OffsitePaymentDetectionApiResponse\n} from 'tradera/state/services/types/webapi-selling-generated';\nimport { webApiClient } from 'tradera/utils/http';\nimport { selectIsFeatureEnabled } from 'tradera/state/environment/selectors';\n\nexport const setLongDescription =\n (longDescription: string) => (dispatch: AppDispatch) => {\n dispatch(setLongDescriptionReducer(longDescription));\n dispatch(updateDraftCanBeResumed());\n };\n\nexport const prependLongDescription =\n (longDescription: string) =>\n (dispatch: AppDispatch, getState: GetState) => {\n const currentLongDescription = selectLongDescription(getState());\n const newLongDescription = `${longDescription}\\n\\n${currentLongDescription}`;\n // Needs to be FromDraft, otherwise the update will not be shown\n // in the redactor-controlled textarea.\n dispatch(setLongDescriptionFromDraftReducer(newLongDescription));\n dispatch(updateDraftCanBeResumed());\n };\n\nexport const setLongDescriptionFromDraft =\n (longDescription: string) => (dispatch: AppDispatch) => {\n dispatch(setLongDescriptionFromDraftReducer(longDescription));\n dispatch(updateDraftCanBeResumed());\n };\n\nexport const reset = () => (dispatch: AppDispatch) => {\n dispatch(resetLongDescription());\n dispatch(updateDraftCanBeResumed());\n};\n\nexport const fetchOffsitePaymentDetection = createAsyncThunk<\n OffsitePaymentDetectionApiResponse | null,\n OffsitePaymentDetectionApiRequest,\n {\n state: RootState;\n }\n>(\n 'syi/longDescription/fetchOffsitePaymentDetection',\n async (request: OffsitePaymentDetectionApiRequest, { getState }) => {\n const isOffsitePaymentDetectionEnabled = selectIsFeatureEnabled(\n 'offsite-payment-detection'\n )(getState());\n\n if (isOffsitePaymentDetectionEnabled) {\n const { data } = await webApiClient.post<\n OffsitePaymentDetectionApiResponse,\n OffsitePaymentDetectionApiRequest\n >(`/selling/offsite-payment-detection`, request);\n return data;\n } else {\n return null;\n }\n }\n);\n","import { createAsyncThunk } from '@reduxjs/toolkit';\nimport qs from 'qs';\nimport { trackSyiForm } from 'tradera/apps/syi/services/syi-ga4-service';\nimport { setLongDescription } from 'tradera/apps/syi/state/reducers/long-description';\nimport {\n setAiProcessingTime,\n setHasUsedPredictedDescription,\n setNumProcessedImages,\n setPredictedLongDescription,\n setPredictedShortDescription,\n setShouldSuggestLongDescription,\n setShouldSuggestShortDescription\n} from 'tradera/apps/syi/state/reducers/predictions-reducer';\nimport { setShortDescription } from 'tradera/apps/syi/state/reducers/short-description';\nimport { selectDraftId } from 'tradera/apps/syi/state/selectors/draft-selectors';\nimport { selectImageIds } from 'tradera/apps/syi/state/selectors/image-selectors';\nimport { selectClassificationResponse } from 'tradera/apps/syi/state/selectors/predictions-selectors';\nimport {\n selectLongDescription,\n selectShortDescription\n} from 'tradera/apps/syi/state/selectors/syi';\nimport type { RootState, AppDispatch } from 'tradera/state/configure-store';\nimport { selectIsFeatureEnabled } from 'tradera/state/environment/selectors';\nimport { selectPreferredLanguageCode } from 'tradera/state/language/selectors';\nimport type {\n ClassifyFromDraftImageApiResponse,\n ClassifyFromImageRequest,\n ConditionListingTypeFromCategoryRequest,\n GetConditionAndListingTypeFromCategoryApiResponse,\n PredictionsFromDraftImageApiResponse\n} from 'tradera/state/services/types/webapi-selling-generated';\nimport { webApiClient } from 'tradera/utils/http';\nimport { setItemConditionFromPrediction } from 'tradera/apps/syi/state/actions/draft-actions';\nimport { setIsPureBinSelectedFromPrediction } from 'tradera/apps/syi/state/actions/price-actions';\nimport ItemTypes from 'tradera/constants/item-types';\n\nexport const fetchClassificationFromFirstImage = createAsyncThunk(\n 'syi/images/fetchClassificationFromFirstImage',\n async ({ imageId, draftId }: ClassifyFromImageRequest) => {\n trackSyiForm({\n eventName: 'magical_classifier_call',\n parameters: { draft_id: draftId }\n });\n\n const response =\n await webApiClient.get(\n `/selling/classify-from-image?${qs.stringify({\n imageId,\n draftId\n })}`\n );\n\n return response.data;\n }\n);\n\nexport const fetchPredictionsFromImages = createAsyncThunk<\n void,\n void,\n { state: RootState }\n>(\n 'predictions/fetchPredictionsFromImages',\n async (_, { dispatch, getState }) => {\n const languageCodeIso2 = selectPreferredLanguageCode(getState());\n const existingShortDescription = selectShortDescription(getState());\n const existingLongDescription = selectLongDescription(getState());\n const isModalFeatureToggleEnabled = selectIsFeatureEnabled(\n 'magical-syi-autofill-prompt'\n )(getState());\n const { itemClassification } =\n selectClassificationResponse(getState()) || {};\n\n const imageIds = selectImageIds(getState());\n const draftId = selectDraftId(getState());\n\n trackSyiForm({\n eventName: 'magical_api_trigger',\n parameters: { draft_id: draftId }\n });\n\n const response =\n await webApiClient.get(\n `/selling/predict-from-images?${qs.stringify({\n imageIds: imageIds,\n languageCodeIso2,\n itemClassification,\n draftId: draftId\n })}`\n );\n\n trackSyiForm({\n eventName: 'magical_api_call',\n parameters: { draft_id: draftId }\n });\n\n // If we already have descriptions, we don't want to overwrite them with the predicted one without asking the user first.\n // If we don't have short and long description, we want to set the predicted ones\n if (response.data.shortDescription) {\n dispatch(\n setPredictedShortDescription(response.data.shortDescription)\n );\n\n if (existingShortDescription && isModalFeatureToggleEnabled) {\n dispatch(\n setShouldSuggestShortDescription(\n response.data.shortDescription !==\n existingShortDescription\n )\n );\n } else {\n dispatch(setHasUsedPredictedDescription(true));\n dispatch(setShortDescription(response.data.shortDescription));\n }\n }\n\n if (response.data.longDescription) {\n dispatch(\n setPredictedLongDescription(response.data.longDescription)\n );\n\n if (existingLongDescription && isModalFeatureToggleEnabled) {\n dispatch(\n setShouldSuggestLongDescription(\n response.data.longDescription !==\n existingLongDescription\n )\n );\n } else {\n dispatch(setHasUsedPredictedDescription(true));\n dispatch(setLongDescription(response.data.longDescription));\n }\n }\n\n dispatch(setNumProcessedImages(response.data.numProcessedImages));\n dispatch(setAiProcessingTime(response.data.aiProcessingTime));\n }\n);\n\nexport const fetchConditionAndItemTypeFromCategory = createAsyncThunk<\n GetConditionAndListingTypeFromCategoryApiResponse,\n ConditionListingTypeFromCategoryRequest,\n {\n dispatch: AppDispatch;\n }\n>(\n 'syi/images/fetchConditionAndItemTypeFromCategory',\n async (\n { isCompany, categoryId }: ConditionListingTypeFromCategoryRequest,\n { dispatch }\n ) => {\n const response =\n await webApiClient.get(\n `/selling/condition-listing-type-from-category?${qs.stringify({\n isCompany,\n categoryId\n })}`\n );\n\n if (response.data.condition) {\n dispatch(setItemConditionFromPrediction(response.data.condition));\n }\n dispatch(\n setIsPureBinSelectedFromPrediction(\n response.data.itemType === ItemTypes.PURE_BIN\n )\n );\n\n return response.data;\n }\n);\n","import type { AppDispatch, RootState } from 'tradera/state/configure-store';\nimport feesActions from './fees-actions';\nimport { getSyiSlice } from 'tradera/apps/syi/state/selectors/syi';\nimport { resetCharityAndShippingInfo } from 'tradera/apps/syi/state/actions/charity-actions';\nimport { PURE_BIN_CATEGORY_IDS, ITEM_TYPE } from '../constants';\nimport { selectIsFeatureEnabled } from 'tradera/state/environment/selectors';\nimport { setCustomEndTime } from '../reducers/item-duration';\nimport { selectMagicalSyiSettngEnabled } from 'tradera/apps/syi/state/selectors/draft-selectors';\nimport { selectIsPureBinSelected } from 'tradera/apps/syi/state/selectors/price-selectors';\nimport { setHasUsedAutoFill } from 'tradera/apps/syi/state/reducers/predictions-reducer';\nimport {\n setAuctionBinPrice,\n setFixedPrice,\n setOpeningBid,\n setReservePrice as setReservePriceReducer,\n setReservePriceVisibility as setReservePriceVisibilityReducer,\n setCharityDonationVisibility as setCharityDonationVisibilityReducer,\n setIsPureBinSelected as setIsPureBinSelectedReducer,\n setVat,\n setSelectedItemType as setSelectedItemTypeReducer,\n setReservePriceCanChangeButNotBeRemoved\n} from 'tradera/apps/syi/state/reducers/price';\nimport { isNullOrUndefined } from 'tradera/utils/condition-check';\n\nexport const setReservePrice =\n (reservePrice: number | null) =>\n (dispatch: AppDispatch): void => {\n dispatch(setReservePriceReducer(reservePrice));\n dispatch(feesActions.updatePrices());\n };\n\nexport const setReservePriceVisibility =\n (visible: boolean) =>\n (dispatch: AppDispatch): void => {\n dispatch(setReservePriceVisibilityReducer(visible));\n if (!visible) {\n dispatch(setReservePrice(null));\n }\n };\n\nexport const setCharityDonationVisibility =\n (visible: boolean) =>\n (dispatch: AppDispatch): void => {\n dispatch(setCharityDonationVisibilityReducer(visible));\n if (!visible) {\n dispatch(resetCharityAndShippingInfo());\n }\n };\n\nexport const setIsPureBinSelected =\n (isPureBinSelected: boolean) =>\n (dispatch: AppDispatch): void => {\n dispatch(setIsPureBinSelectedReducer(isPureBinSelected));\n\n if (isPureBinSelected) {\n dispatch(setOpeningBid(null));\n dispatch(setAuctionBinPrice(null));\n dispatch(setReservePrice(null));\n dispatch(setCustomEndTime(null));\n } else {\n dispatch(setFixedPrice(null));\n }\n };\n\nexport const setIsPureBinSelectedFromPrediction =\n (isPureBinSelected: boolean) =>\n (dispatch: AppDispatch, getState: () => RootState): void => {\n const isPristine = !getSyiSlice(getState()).price.isDirty;\n if (!isPristine) return;\n\n const oldValue = selectIsPureBinSelected(getState());\n\n dispatch(setIsPureBinSelected(isPureBinSelected));\n\n if (oldValue !== isPureBinSelected) {\n dispatch(setHasUsedAutoFill(true));\n }\n };\n\nexport const setSelectedItemType =\n (itemType: (typeof ITEM_TYPE)[keyof typeof ITEM_TYPE]) =>\n (dispatch: AppDispatch): void => {\n dispatch(setSelectedItemTypeReducer(itemType));\n\n if (itemType === ITEM_TYPE.BIN) {\n dispatch(setOpeningBid(null));\n dispatch(setAuctionBinPrice(null));\n dispatch(setReservePrice(null));\n dispatch(setCustomEndTime(null));\n } else if (itemType === ITEM_TYPE.AUCTION) {\n dispatch(setFixedPrice(null));\n dispatch(setAuctionBinPrice(null));\n } else if (itemType === ITEM_TYPE.AUCTION_AND_BIN) {\n dispatch(setFixedPrice(null));\n }\n };\n\nexport const setFromDraft =\n (\n openingBid: number | null,\n fixedPrice: number | null,\n reservePrice: number | null,\n charityId: string | null,\n vat: number | null,\n isChangeItem: boolean\n ) =>\n (dispatch: AppDispatch): void => {\n const queryParams = new URLSearchParams(location.search);\n const queryParamCharityId = queryParams.get('charityId');\n const hasOpeningBid = !isNullOrUndefined(openingBid);\n const hasFixedPrice = !isNullOrUndefined(fixedPrice);\n const hasReservePrice = !isNullOrUndefined(reservePrice);\n const hasCharityId =\n !isNullOrUndefined(charityId) ||\n !isNullOrUndefined(queryParamCharityId);\n const isAuction = hasOpeningBid && !hasFixedPrice;\n const isAuctionBin = hasOpeningBid && hasFixedPrice;\n const isPureBin = !hasOpeningBid && hasFixedPrice;\n\n dispatch(setVat(vat));\n\n // TODO: fewer changes to the state makes the page load faster...\n if (isAuction) {\n dispatch(setOpeningBid(openingBid));\n dispatch(setReservePrice(reservePrice));\n dispatch(setAuctionBinPrice(null));\n dispatch(setFixedPrice(null));\n dispatch(setReservePriceVisibility(hasReservePrice));\n dispatch(setCharityDonationVisibility(hasCharityId));\n dispatch(setIsPureBinSelected(false));\n dispatch(setSelectedItemType(ITEM_TYPE.AUCTION));\n } else if (isAuctionBin) {\n dispatch(setOpeningBid(openingBid));\n dispatch(setReservePrice(reservePrice));\n dispatch(setAuctionBinPrice(fixedPrice));\n dispatch(setFixedPrice(null));\n dispatch(setReservePriceVisibility(hasReservePrice));\n dispatch(setCharityDonationVisibility(hasCharityId));\n dispatch(setIsPureBinSelected(false));\n dispatch(setSelectedItemType(ITEM_TYPE.AUCTION_AND_BIN));\n } else if (isPureBin) {\n dispatch(setOpeningBid(null));\n dispatch(setReservePrice(null));\n dispatch(setAuctionBinPrice(null));\n dispatch(setFixedPrice(fixedPrice));\n dispatch(setReservePriceVisibility(false));\n dispatch(setCharityDonationVisibility(false));\n dispatch(setIsPureBinSelected(true));\n dispatch(setSelectedItemType(ITEM_TYPE.BIN));\n } else {\n dispatch(setOpeningBid(null));\n dispatch(setReservePrice(null));\n dispatch(setAuctionBinPrice(null));\n dispatch(setFixedPrice(null));\n dispatch(setReservePriceVisibility(false));\n dispatch(setCharityDonationVisibility(hasCharityId));\n dispatch(setIsPureBinSelected(false));\n }\n\n dispatch(\n setReservePriceCanChangeButNotBeRemoved(\n isChangeItem && hasReservePrice\n )\n );\n };\n\nexport const rootCategoryHasBeenSelected =\n (categoryId: number) =>\n (dispatch: AppDispatch, getState: () => RootState): void => {\n const isPureBinCategory = PURE_BIN_CATEGORY_IDS.includes(categoryId);\n const isMagicalSyiFeatureEnabled =\n selectIsFeatureEnabled('magical-syi')(getState());\n const isMagicalSyiSettingEnabled =\n selectMagicalSyiSettngEnabled(getState());\n const isAutoFillConditionAndListingTypeEnabled = selectIsFeatureEnabled(\n 'auto-fill-condition-and-listing-type'\n )(getState());\n const isEditOfPublishedItem =\n getSyiSlice(getState()).syi.isEditOfPublishedItem;\n\n // We do not want to change the auction type if the user is editing a\n // published item, since that's not allowed anyway\n if (\n !isEditOfPublishedItem &&\n !isMagicalSyiFeatureEnabled &&\n !isAutoFillConditionAndListingTypeEnabled &&\n !isMagicalSyiSettingEnabled\n ) {\n dispatch(setIsPureBinSelected(isPureBinCategory));\n }\n };\n","import { createApi } from '@reduxjs/toolkit/dist/query/react';\nimport type {\n GetShippingProductsForCountryByWeightSpanAndSizeApiResponse,\n ShippingProductsForCountryByWeightSpanAndSizeRequest\n} from 'tradera/state/services/types/webapi-selling-generated';\nimport { isomorphicWebApiBaseQuery } from 'tradera/state/services/utils/webapi-base-query';\nimport qs from 'qs';\n\nexport const syiShippingApi = createApi({\n reducerPath: 'syiShippingApi',\n baseQuery: isomorphicWebApiBaseQuery,\n endpoints: (builder) => ({\n getShippingProducts: builder.query<\n GetShippingProductsForCountryByWeightSpanAndSizeApiResponse,\n ShippingProductsForCountryByWeightSpanAndSizeRequest\n >({\n query: (params) =>\n `/api/webapi/selling/shipping-products-for-country-by-weight-span-and-size?${qs.stringify(\n params\n )}`\n })\n })\n});\n","export const DRAFT_REASON = {\n NEW_ITEM: 'NewItem',\n CHANGE_ITEM: 'ChangeItem',\n CHANGE_ITEM_WITH_BIDS: 'ChangeItemWithBids',\n COPY_OTHER_MEMBERS_ITEM: 'CopyOtherMembersItem',\n COPY_OWN_ITEM: 'CopyOwnItem',\n SELL_SIMILAR_ITEM: 'SellSimilarItem',\n RESTART_ITEM: 'RestartItem'\n};\n\nexport const ITEM_TYPE = {\n BIN: 'bin',\n AUCTION: 'auction',\n AUCTION_AND_BIN: 'auction_and_bin'\n};\n\n// Clothes, Accessories, Shoes\nconst CSA_CATEGORY_IDS = [16, 1612, 1623];\n\nexport const PURE_BIN_CATEGORY_IDS = [...CSA_CATEGORY_IDS];\n","import { createApi } from '@reduxjs/toolkit/query/react';\nimport { isomorphicWebApiBaseQuery } from 'tradera/state/services/utils/webapi-base-query';\nimport { canBeResumed } from './actions/draft-actions';\nimport type {\n DeleteDraftsApiRequest,\n DraftsRequest,\n GetDraftsPageApiResponse\n} from 'tradera/state/services/types/webapi-selling-generated';\n\nexport enum Tags {\n DRAFT_LIST = 'DRAFT_LIST'\n}\n\nexport const draftsApi = createApi({\n reducerPath: 'draftsApi',\n baseQuery: isomorphicWebApiBaseQuery,\n tagTypes: Object.keys(Tags),\n endpoints: (builder) => ({\n deleteDrafts: builder.mutation({\n invalidatesTags: [Tags.DRAFT_LIST],\n query: (parameters) => {\n return {\n url: '/api/webapi/selling/drafts',\n method: 'DELETE',\n body: parameters\n };\n }\n }),\n loadDrafts: builder.query<\n GetDraftsPageApiResponse,\n DraftsRequest | undefined\n >({\n providesTags: [Tags.DRAFT_LIST],\n query: (params) => ({\n url: '/api/webapi/selling/drafts',\n method: 'GET',\n params\n }),\n transformResponse: (response: GetDraftsPageApiResponse) => {\n return {\n ...response,\n items: response.items?.filter((item) =>\n canBeResumed(\n item.draftId,\n item.draftReason,\n item.shortDescription,\n item.longDescription,\n [\n {\n imageUrl: item.images?.find(\n (image) => image.imageUrl\n )\n }\n ]\n )\n )\n };\n }\n })\n })\n});\n\nexport const { useDeleteDraftsMutation, useLoadDraftsQuery, util } = draftsApi;\n","/* eslint-disable better-mutation/no-mutation */\nimport { type PayloadAction, createSlice } from '@reduxjs/toolkit';\nimport {\n filterSelectableSuggestions,\n filterCombinedSelectableSuggestions\n} from './attributes-helpers';\nimport type { SyiAttribute } from '../../components/attributes/types';\nimport type { TermAttributeValue } from 'tradera/state/services/types/webapi-selling-generated';\n\ntype InitialState = {\n categoryAttributes: SyiAttribute[];\n draftAttributes:\n | Record\n | {\n termAttributeValues: TermAttributeValue[];\n numberAttributeValues: [];\n };\n selectableSuggestedAttributes: TermAttributeValue[];\n selectableCategorySuggestedAttributes: SyiAttribute[];\n selectableImageToColorSuggestedAttributes: SyiAttribute[];\n imageToColorSuggestedAttributes: TermAttributeValue[];\n validationErrors: Record;\n categorySuggestedAttributes: TermAttributeValue[];\n suggestionsExtractorType: string;\n};\n\nconst initialState: InitialState = {\n // The attributes for the current category\n categoryAttributes: [],\n // The attributes of the draft.\n /**\n draftAttributes: {\n termAttributeValues: [\n {\n id: 1,\n backingField: 'clothes_size',\n userGenerated: true,\n values: [\n 'b'\n ]\n }\n ],\n numberAttributeValues: []\n }\n */\n draftAttributes: {},\n // A list of the selected attributes (draftAttributes) for display on the page.\n // Exists for ease of use in views.\n // Format:\n /**\n {\n title: 'Klädstorlek',\n value: 'L'\n }\n */\n selectableSuggestedAttributes: [],\n selectableCategorySuggestedAttributes: [],\n selectableImageToColorSuggestedAttributes: [],\n // Attribute suggestions from the image-to-color service.\n imageToColorSuggestedAttributes: [],\n validationErrors: {},\n categorySuggestedAttributes: [],\n suggestionsExtractorType: ''\n};\n\nconst updateSelectableImageToColorSuggestedAttributes = (\n state: InitialState\n) => {\n state.selectableImageToColorSuggestedAttributes =\n filterSelectableSuggestions(\n state.imageToColorSuggestedAttributes,\n state.categoryAttributes\n );\n updateSelectableSuggestedAttributes(state);\n};\n\nconst updateSelectableSuggestedAttributes = (state: InitialState) => {\n state.selectableSuggestedAttributes = filterCombinedSelectableSuggestions(\n state.selectableCategorySuggestedAttributes,\n state.selectableImageToColorSuggestedAttributes,\n state.categoryAttributes\n );\n};\n\nconst attributeSlice = createSlice({\n name: 'attributes',\n initialState,\n reducers: {\n setCategoryAttributesSuggestions: (\n state,\n action: PayloadAction<{\n suggestedAttributes: TermAttributeValue[];\n suggestionsExtractorType: string;\n }>\n ) => {\n const { payload } = action;\n state.categorySuggestedAttributes = payload.suggestedAttributes;\n state.selectableCategorySuggestedAttributes =\n filterSelectableSuggestions(\n payload.suggestedAttributes,\n state.categoryAttributes\n );\n state.suggestionsExtractorType = payload.suggestionsExtractorType;\n updateSelectableSuggestedAttributes(state);\n state.validationErrors = validate(state);\n },\n autoFillSuggestedAttributes: (state) => {\n state.categoryAttributes.forEach((attribute) => {\n // Abort if the attribute has any option that's already active.\n // If loading a draft, an option might already be selected and we don't want to overwrite that.\n if (attribute.options.find((option) => option.isActive)) {\n return;\n }\n\n // only allow for certain attributes to be auto-filled. This is a limitation of the model as per 2024-08-15\n if (![1, 2, 3, 91].includes(attribute.id)) {\n return;\n }\n\n const suggestedAttributeValues =\n state.selectableSuggestedAttributes\n ?.find((suggested) => suggested.id === attribute.id)\n ?.values // do not auto-fill more values than the attribute allows\n ?.slice(0, attribute.maxNumberOfValues) || [];\n\n if (suggestedAttributeValues.length > 0) {\n attribute.options = attribute.options.map((option) => {\n if (\n suggestedAttributeValues.includes(\n option.value || ''\n )\n ) {\n return { ...option, isActive: true };\n }\n return option;\n });\n attribute.numberOfValuesSelected = attribute.options.filter(\n (option) => option.isActive\n ).length;\n }\n });\n },\n setImageToColorSuggestions: (\n state,\n action: PayloadAction<{\n suggestedAttributes: TermAttributeValue[];\n }>\n ) => {\n const { payload } = action;\n state.imageToColorSuggestedAttributes = payload.suggestedAttributes;\n updateSelectableImageToColorSuggestedAttributes(state);\n state.validationErrors = validate(state);\n },\n\n setCategoryAttributeOption: (\n state,\n action: PayloadAction<{\n attributeId: number;\n optionValue?: string;\n activate: boolean;\n }>\n ) => {\n const { payload } = action;\n const attribute = state.categoryAttributes.find(\n (a) => a.id === payload.attributeId\n );\n if (attribute) {\n let options = attribute.options;\n if (\n !attribute.isMultiSelect ||\n (!payload.optionValue && !payload.activate)\n ) {\n options = options.map((o) =>\n !o.isActive ? o : { ...o, isActive: false }\n );\n }\n if (payload.optionValue) {\n options = options.map((o) =>\n o.value !== payload.optionValue\n ? o\n : { ...o, isActive: payload.activate }\n );\n }\n const numberOfValuesSelected = options.filter(\n (o) => o.isActive\n ).length;\n attribute.options = options;\n attribute.numberOfValuesSelected = numberOfValuesSelected;\n }\n state.validationErrors = validate(state);\n },\n updateCategoryAttributesOptionsStatuses: (state) => {\n state.categoryAttributes.forEach((a) => {\n const draftAttributeValues =\n state.draftAttributes.termAttributeValues?.find(\n (tav) => a.id === tav.id\n )?.values || [];\n a.options?.forEach((o) => {\n const isActive = draftAttributeValues.includes(\n o.value || ''\n );\n o.isActive = isActive;\n });\n a.numberOfValuesSelected = a.options?.filter(\n (o) => o.isActive\n ).length;\n });\n state.validationErrors = validate(state);\n },\n setDraftAttributes: (state, action) => {\n state.draftAttributes = { ...action.payload };\n state.validationErrors = validate(state);\n },\n setCategoryAttributes: (\n state,\n action: PayloadAction\n ) => {\n state.categoryAttributes = [...action.payload];\n updateSelectableImageToColorSuggestedAttributes(state);\n state.validationErrors = validate(state);\n },\n resetAttributes: () => initialState,\n resetSelectedAttributes: (state) => {\n state.categoryAttributes.forEach((attribute) => {\n attribute.options?.forEach((option) => {\n option.isActive = false;\n });\n attribute.numberOfValuesSelected = 0;\n });\n state.draftAttributes = initialState.draftAttributes;\n },\n\n resetImageAttributeSuggestions: (state) => {\n state.imageToColorSuggestedAttributes =\n initialState.imageToColorSuggestedAttributes;\n updateSelectableImageToColorSuggestedAttributes(state);\n state.validationErrors = validate(state);\n }\n }\n});\n\nconst validate = (state: InitialState) => {\n const validationErrors: Record = {};\n state.categoryAttributes.forEach((attribute) => {\n if (attribute.minNumberOfValues === 0) {\n return;\n }\n if (attribute.options?.length === 0) {\n // There were no options to choose from.\n // May not happen when backend implementation is done,\n // we should not get an empty list of options.\n return;\n }\n const values = attribute.options?.reduce((acc, option) => {\n if (option.isActive) {\n acc.push(option.value || '');\n }\n return acc;\n }, [] as string[]);\n if (values?.length === 0 && attribute.backingField) {\n validationErrors[attribute.backingField] =\n `attributes:::syi_validation_missing_attribute_${attribute.backingField}`;\n }\n });\n return validationErrors;\n};\n\nconst { actions, reducer } = attributeSlice;\nexport const {\n setCategoryAttributesSuggestions,\n setImageToColorSuggestions,\n setCategoryAttributeOption,\n updateCategoryAttributesOptionsStatuses,\n setDraftAttributes,\n setCategoryAttributes,\n resetAttributes,\n resetSelectedAttributes,\n resetImageAttributeSuggestions,\n autoFillSuggestedAttributes\n} = actions;\n\nexport default reducer;\n","/* eslint-disable better-mutation/no-mutation */\nimport initData from 'tradera/legacy/static/packages/init-data';\nimport { createSlice, type PayloadAction } from '@reduxjs/toolkit';\nimport { getSyiSlice } from 'tradera/apps/syi/state/selectors/syi';\nimport type { AppDispatch, GetState } from 'tradera/state/configure-store';\n\nconst defaultRegionValue = 'EU';\n\ninterface BuyerRegion {\n value: string;\n text: string;\n}\n\ninterface BuyerRegionState {\n defaultBuyerRegion: BuyerRegion;\n availableAllowedBuyerRegions: BuyerRegion[];\n selectedBuyerRegion: string;\n selectedBuyerRegionText: string;\n availableAllowedBuyerRegionsForEditWithBids: boolean;\n isSetAllowedBuyerRegionToAtLeastEuEnabled: boolean;\n}\n\nconst initModuleGlobals = (): BuyerRegionState | null => {\n if (\n !initData.pageSpecificData ||\n !initData.pageSpecificData.allowedBuyerRegions\n ) {\n return null;\n }\n\n const availableAllowedBuyerRegions: BuyerRegion[] =\n initData.pageSpecificData.allowedBuyerRegions;\n const defaultBuyerRegion = availableAllowedBuyerRegions.find(\n (r: BuyerRegion) => r.value === defaultRegionValue\n ) as BuyerRegion;\n\n return {\n defaultBuyerRegion,\n availableAllowedBuyerRegions,\n selectedBuyerRegion: defaultBuyerRegion.value,\n selectedBuyerRegionText: defaultBuyerRegion.text,\n availableAllowedBuyerRegionsForEditWithBids: false,\n isSetAllowedBuyerRegionToAtLeastEuEnabled:\n initData?.featureSwitches?.[\n 'international-shipping-schenker-eu-default'\n ] || false\n };\n};\n\nconst buyerRegionSlice = createSlice({\n name: 'buyer-region',\n initialState: initModuleGlobals(),\n reducers: {\n setAllowedBuyerRegion: (\n state,\n action: PayloadAction<{ allowedBuyerRegion: string }>\n ) => {\n if (state) {\n const region = state.availableAllowedBuyerRegions.find(\n (r) => r.value === action.payload.allowedBuyerRegion\n );\n const { value, text } = region || state.defaultBuyerRegion;\n\n state.selectedBuyerRegion = value;\n state.selectedBuyerRegionText = text;\n }\n },\n setAvailableAllowedBuyerRegions: (\n state,\n action: PayloadAction<{ availableRegions: BuyerRegion[] }>\n ) => {\n if (state) {\n state.availableAllowedBuyerRegions =\n action.payload.availableRegions;\n state.availableAllowedBuyerRegionsForEditWithBids = true;\n }\n }\n }\n});\n\nexport const setAvailableAllowedBuyerRegions =\n () => (dispatch: AppDispatch, getState: GetState) => {\n const draftState = getSyiSlice(getState()).draft;\n const regionState = getSyiSlice(getState()).buyerRegion;\n if (regionState) {\n const regions = regionState.availableAllowedBuyerRegions;\n const selectedRegion = regionState.selectedBuyerRegion;\n const filters: { [key: string]: (region: BuyerRegion) => boolean } =\n {\n Sweden: (region) =>\n ['Sweden', 'Nordic', 'EU', 'International'].indexOf(\n region.value\n ) > -1,\n Nordic: (region) =>\n ['Nordic', 'International'].indexOf(region.value) > -1,\n EU: (region) =>\n ['EU', 'International'].indexOf(region.value) > -1,\n International: (region) =>\n ['International'].indexOf(region.value) > -1\n };\n const useFilter = draftState.draftReason === 'ChangeItemWithBids';\n const filter =\n (useFilter && filters[selectedRegion]) || (() => true);\n const availableRegions = regions.filter(filter);\n dispatch(\n buyerRegionSlice.actions.setAvailableAllowedBuyerRegions({\n availableRegions\n })\n );\n }\n };\n\nexport const { setAllowedBuyerRegion } = buyerRegionSlice.actions;\n\nexport default buyerRegionSlice.reducer;\n","/* eslint-disable better-mutation/no-mutation */\nimport { createSlice, type PayloadAction } from '@reduxjs/toolkit';\nimport type { Category } from 'tradera/state/services/touchweb-syi-api';\n\ntype CategoryState = {\n draftCategoryId?: number;\n draftCategoryPath: Category[];\n validationError: string | null;\n};\n\nconst initialState: CategoryState = {\n draftCategoryId: 0,\n draftCategoryPath: [],\n validationError: null\n};\n\nfunction validate(state: CategoryState) {\n if (!state.draftCategoryId || state.draftCategoryId === 0) {\n state.validationError = 'syi_validation_missing_category';\n } else {\n state.validationError = null;\n }\n}\n\nconst categorySlice = createSlice({\n name: 'category',\n initialState,\n reducers: {\n resetCategory: (state) => {\n state.draftCategoryId = 0;\n state.draftCategoryPath = [];\n validate(state);\n },\n setDraftCategory: (\n state,\n action: PayloadAction<{\n categoryId: number;\n categoryPath: Category[];\n }>\n ) => {\n state.draftCategoryId = action.payload.categoryId;\n state.draftCategoryPath = action.payload.categoryPath;\n validate(state);\n }\n }\n});\n\nexport const { resetCategory, setDraftCategory } = categorySlice.actions;\n\nexport default categorySlice.reducer;\n","/* eslint-disable better-mutation/no-mutation */\n\nimport { createSlice } from '@reduxjs/toolkit';\nimport type { ItemDraftCharity } from 'tradera/state/services/types/webapi-selling-generated';\n\n// if on server there is no window object\nconst windowExists = typeof window !== 'undefined';\n\nconst isNewDraft = windowExists\n ? window.location?.pathname?.endsWith('new')\n : false;\nconst queryParams = windowExists\n ? new URLSearchParams(window.location?.search)\n : null;\nconst queryParamCharityId = queryParams?.get('charityId');\nconst preselectCharity = isNewDraft && queryParamCharityId;\n\ntype CharitySlice = ItemDraftCharity & {\n forceFreeShipping: boolean;\n isFreeShippingPaidByProvider: boolean;\n freeShippingPaidByProviderName: string | null;\n description: string | null;\n logoUrl: string | null;\n name: string | null;\n};\n\nconst initialStateShipping = {\n forceFreeShipping: false,\n isFreeShippingPaidByProvider: false,\n freeShippingPaidByProviderName: null\n};\n\nconst initialState: CharitySlice = {\n anonymous: true,\n charityId: preselectCharity ? Number(queryParamCharityId) : 0,\n description: null,\n logoUrl: null,\n name: null,\n percentageToDonate: preselectCharity ? 100 : 0,\n ...initialStateShipping\n};\n\nconst charitySlice = createSlice({\n name: 'charity',\n initialState,\n reducers: {\n setCharityId: (state, { payload }) => {\n state.charityId = payload.charityId;\n if (payload.charityId) {\n state.percentageToDonate = 100;\n } else {\n state.percentageToDonate = 0;\n }\n },\n setCharityInfo: (\n state,\n { payload: { name, description, logoUrl } }\n ) => {\n return { ...state, name, description, logoUrl };\n },\n setCharityAnonymous: (state, { payload }) => {\n state.anonymous = payload.anonymous;\n },\n setCharityFromDraft: (state, { payload }) => {\n state.charityId = payload.charityId;\n state.percentageToDonate = payload.percentageToDonate;\n state.anonymous = payload.anonymous;\n },\n resetCharity: () => {\n return { ...initialState };\n },\n setCharityShippingInfo: (state, { payload }) => {\n return { ...state, ...payload };\n }\n }\n});\n\nexport const {\n resetCharity,\n setCharityAnonymous,\n setCharityFromDraft,\n setCharityId,\n setCharityInfo,\n setCharityShippingInfo\n} = charitySlice.actions;\n\nexport default charitySlice.reducer;\n","/* eslint-disable better-mutation/no-mutation */\n\nimport dayjs from 'dayjs';\nimport pick from 'lodash/pick';\nimport { createSlice, type PayloadAction } from '@reduxjs/toolkit';\nimport type {\n ItemAdditionalDescription,\n ItemDraftMetadata\n} from 'tradera/state/services/types/webapi-selling-generated';\n\ntype DraftReason =\n | 'NewItem'\n | 'Template'\n | 'ChangeItem'\n | 'ChangeItemWithBids'\n | 'CopyOtherMembersItem'\n | 'CopyOwnItem'\n | 'RestartItem'\n | 'ResellItem'\n | 'SellSimilarItem';\n\nexport type DraftSlice = {\n isLoading: boolean;\n draftId?: string;\n draftReason?: DraftReason;\n memberId?: number;\n itemId?: number;\n restart?: boolean;\n publishedPromoted?: boolean;\n publishedHighlighted?: boolean;\n createdDate?: string;\n lastModifiedDate?: string;\n publishedDate?: unknown;\n publishedAsItemType?: unknown;\n reference?: string | null;\n referenceIsReadonly?: boolean;\n additionalDescriptions: ItemAdditionalDescription[];\n metadata?: ItemDraftMetadata;\n templateId?: string;\n templateName?: string;\n version?: number;\n isNewDraft?: unknown;\n descriptionLanguageCodeIso2?: string;\n currency?: string;\n resellPartner?: string;\n magicalSyiEnabled?: boolean;\n};\n\nconst initialState: DraftSlice = {\n isLoading: false,\n additionalDescriptions: []\n};\n\nconst draftSlice = createSlice({\n name: 'draft',\n initialState,\n reducers: {\n setDraftProperties(state, action: PayloadAction>) {\n const draft = action.payload;\n const referenceIsReadonly =\n draft.reference?.includes('Sello artnr') ?? false;\n if (JSON.stringify(state) != JSON.stringify(draft)) {\n state.lastModifiedDate = dayjs().toISOString();\n }\n Object.assign(\n state,\n pick(draft, [\n 'draftId',\n 'draftReason',\n 'memberId',\n 'itemId',\n 'restart',\n 'publishedPromoted',\n 'publishedHighlighted',\n 'createdDate',\n 'lastModifiedDate',\n 'publishedDate',\n 'publishedAsItemType',\n 'reference',\n 'additionalDescriptions',\n 'metadata',\n 'templateId',\n 'templateName',\n 'version'\n ]),\n {\n referenceIsReadonly,\n isNewDraft: !draft.draftId\n }\n );\n },\n setDraftId(state, action: PayloadAction) {\n if (state.draftId !== action.payload) {\n state.lastModifiedDate = dayjs().toISOString();\n }\n state.draftId = action.payload;\n },\n setRestart(state, action: PayloadAction) {\n if (state.restart !== action.payload) {\n state.lastModifiedDate = dayjs().toISOString();\n }\n state.restart = action.payload;\n },\n disableRestart(state) {\n if (state.restart !== false) {\n state.lastModifiedDate = dayjs().toISOString();\n }\n state.restart = false;\n },\n setReference(state, action: PayloadAction) {\n if (state.reference !== action.payload) {\n state.lastModifiedDate = dayjs().toISOString();\n }\n state.reference = action.payload;\n },\n addAdditionalDescription(state, action: PayloadAction) {\n const newAdditionalDescriptions = [\n ...state.additionalDescriptions,\n { message: action.payload } as ItemAdditionalDescription\n ];\n if (\n JSON.stringify(state.additionalDescriptions) !=\n JSON.stringify(newAdditionalDescriptions)\n ) {\n state.lastModifiedDate = dayjs().toISOString();\n }\n state.additionalDescriptions = newAdditionalDescriptions;\n },\n setDraftReason(state, action: PayloadAction) {\n if (state.draftReason !== action.payload) {\n state.lastModifiedDate = dayjs().toISOString();\n }\n state.draftReason = action.payload;\n },\n ensureDraftReason(state) {\n if (!state.draftReason) {\n state.draftReason = 'NewItem';\n }\n },\n setDraftVersion(state, action: PayloadAction) {\n if (state.version !== action.payload) {\n state.lastModifiedDate = dayjs().toISOString();\n }\n state.version = action.payload;\n },\n resetDraft() {\n return initialState;\n },\n setDraftIsLoading(state, action: PayloadAction) {\n if (state.isLoading !== action.payload) {\n state.lastModifiedDate = dayjs().toISOString();\n }\n state.isLoading = action.payload;\n },\n setCurrency(state, action: PayloadAction) {\n if (state.currency !== action.payload) {\n state.lastModifiedDate = dayjs().toISOString();\n }\n state.currency = action.payload;\n },\n setResellPartner(state, action: PayloadAction) {\n if (state.resellPartner !== action.payload) {\n state.lastModifiedDate = dayjs().toISOString();\n }\n state.resellPartner = action.payload;\n },\n setMagicalSyiEnabled(state, action: PayloadAction) {\n state.magicalSyiEnabled = action.payload;\n }\n }\n});\n\nexport const {\n setDraftProperties,\n setDraftId,\n setRestart,\n disableRestart,\n setReference,\n addAdditionalDescription,\n setDraftReason,\n ensureDraftReason,\n setDraftVersion,\n resetDraft,\n setDraftIsLoading,\n setCurrency,\n setResellPartner,\n setMagicalSyiEnabled\n} = draftSlice.actions;\n\nexport default draftSlice.reducer;\n","/* eslint-disable better-mutation/no-mutation */\nimport { createSlice, type PayloadAction } from '@reduxjs/toolkit';\nimport type { DraftSlice } from './draft';\n\ntype EditState = {\n draftBeforeChange: DraftSlice | null;\n};\n\nconst initialState: EditState = {\n draftBeforeChange: null\n};\n\nconst editSlice = createSlice({\n name: 'edit',\n initialState,\n reducers: {\n setDraftBeforeChange: (state, action: PayloadAction) => {\n state.draftBeforeChange = action.payload;\n }\n }\n});\n\nexport const { setDraftBeforeChange } = editSlice.actions;\n\nexport default editSlice.reducer;\n","/* eslint-disable better-mutation/no-mutation */\nimport { type PayloadAction, createSlice } from '@reduxjs/toolkit';\nimport { hideAllErrors } from './syi';\nimport type {\n ItemDraftImage,\n TemplateImage\n} from 'tradera/state/services/types/webapi-selling-generated';\nimport config from 'tradera/apps/syi/services/config';\n\n// This will be increased when supporting more images.\nexport const MAX_NUMBER_OF_IMAGES = config.isSyiTenImagesEnabled ? 10 : 5;\nexport const ALLOWED_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif'];\n\nexport enum ITEM_CLASSIFICATIONS_FOR_PREDICTION {\n Books = 'books',\n Cameras = 'cameras',\n Clothes = 'clothes',\n DigitalMedia = 'digital_media',\n // Other means that we cannot do predictions for this category\n Other = 'other',\n Shoes = 'shoes',\n Stamps = 'stamps',\n Watches = 'watches'\n}\n\ntype ImagesSlice = {\n images: Image[];\n uploadingCount: number;\n validationError: string | null;\n uploadError: string | null;\n isUploadingWithApp: boolean;\n};\n\nexport type Rotation = 0 | 90 | 180 | 270;\ntype DraftImage = {\n imageId: string;\n isUploadedBySystem: boolean;\n imageUrl: string;\n rotationDegrees: Rotation;\n isListingImage: false;\n};\ntype ListingImage = {\n imageId: number;\n imageGroupId: number;\n filename: string;\n isUploadedBySystem: boolean;\n imageUrl: string;\n rotationDegrees: Rotation;\n isListingImage: true;\n};\ntype OtherImage = {\n imageId: string;\n imageUrl: string;\n isListingImage: false;\n rotationDegrees: Rotation;\n isUploadedBySystem: false;\n};\nexport type Image = DraftImage | ListingImage | OtherImage;\n\nconst initialState: ImagesSlice = {\n images: [],\n uploadingCount: 0,\n validationError: null,\n uploadError: null,\n isUploadingWithApp: false\n};\n\nexport function setValidation(state: ImagesSlice) {\n if (state.uploadingCount > 0) {\n state.validationError = 'syi_validation_images_uploading';\n } else if (state.images.length === 0) {\n state.validationError = 'syi_validation_images';\n } else if (state.images.every((image) => image.isUploadedBySystem)) {\n // If there isn't at least one image uploaded by the user (can be uploaded by Klarna for example)\n state.validationError = 'syi_validation_images_not_uploaded_by_user';\n } else {\n state.validationError = null;\n }\n}\n\nfunction resetUploadError(state: ImagesSlice) {\n state.uploadError = null;\n}\n\nconst imagesSlice = createSlice({\n name: 'images',\n initialState,\n reducers: {\n setDraftImages: (\n state,\n action: PayloadAction\n ) => {\n state.images = action.payload.map((image) => {\n if ('draftImage' in image && image.draftImage) {\n return {\n imageUrl: image.imageUrl,\n imageId: image.draftImage.imageId,\n isUploadedBySystem: image.draftImage.isUploadedBySystem,\n rotationDegrees: image.draftImage.rotationDegrees,\n isListingImage: false\n } as DraftImage;\n }\n if ('listingImage' in image && image.listingImage) {\n return {\n imageUrl: image.imageUrl,\n imageId: image.listingImage.imageId,\n imageGroupId: image.listingImage.imageGroupId,\n filename: image.listingImage.filename,\n isUploadedBySystem:\n image.listingImage.isUploadedBySystem,\n rotationDegrees: image.listingImage.rotationDegrees,\n isListingImage: true\n } as ListingImage;\n }\n if ('imageId' in image && image.imageId) {\n return {\n imageUrl: image.imageUrl,\n imageId: image.imageId,\n isUploadedBySystem: false,\n rotationDegrees: image.rotationDegrees,\n isListingImage: false\n } as OtherImage;\n }\n throw Error('Unknown image type');\n });\n resetUploadError(state);\n setValidation(state);\n },\n addImage: (\n state,\n action: PayloadAction<{\n imageUrl: string;\n imageId: string;\n }>\n ) => {\n if (state.images.length >= MAX_NUMBER_OF_IMAGES) {\n return;\n }\n\n const { imageId, imageUrl } = action.payload;\n state.images.push({\n imageId,\n imageUrl,\n isListingImage: false,\n isUploadedBySystem: false,\n rotationDegrees: 0\n });\n if (state.uploadingCount > 0) {\n state.uploadingCount--;\n }\n resetUploadError(state);\n setValidation(state);\n },\n replaceImage: (\n state,\n action: PayloadAction<{\n index: number;\n imageUrl: string;\n imageId: string;\n }>\n ) => {\n const { imageId, imageUrl, index } = action.payload;\n\n if (!state.images[index]) {\n throw Error('Replace image failed');\n }\n state.images[index] = {\n imageId,\n imageUrl,\n isListingImage: false,\n isUploadedBySystem: false,\n rotationDegrees: 0\n };\n resetUploadError(state);\n setValidation(state);\n },\n removeImage: (state, action: PayloadAction<{ index: number }>) => {\n const { index } = action.payload;\n if (!state.images[index]) {\n throw new Error('Remove failed, invalid position.');\n }\n\n state.images.splice(index, 1);\n resetUploadError(state);\n setValidation(state);\n },\n changeImagePosition: (\n state,\n action: PayloadAction<{ from: number; to: number }>\n ) => {\n const { from, to } = action.payload;\n if (!state.images[from] || !state.images[to]) {\n throw new Error(\n 'Change image position failed, invalid position.'\n );\n }\n\n const movedImage = state.images.splice(from, 1);\n state.images.splice(to, 0, movedImage[0]);\n resetUploadError(state);\n setValidation(state);\n },\n setImageRotation: (\n state,\n action: PayloadAction<{\n index: number;\n rotationDegrees: Rotation;\n }>\n ) => {\n const { index, rotationDegrees } = action.payload;\n if (!state.images[index]) {\n throw new Error('Set rotation failed, invalid position.');\n }\n\n state.images[index].rotationDegrees = rotationDegrees;\n resetUploadError(state);\n setValidation(state);\n },\n setImageUploadFailed: (\n state,\n action: PayloadAction<{ errorMessage: string }>\n ) => {\n const { errorMessage } = action.payload;\n if (state.uploadingCount > 0) {\n state.uploadingCount--;\n }\n state.uploadError = errorMessage;\n setValidation(state);\n },\n setImagesUploading: (\n state,\n action: PayloadAction<{ numberOfImages: number }>\n ) => {\n const { numberOfImages } = action.payload;\n state.uploadingCount = numberOfImages;\n resetUploadError(state);\n setValidation(state);\n },\n setMobileUpload: (\n state,\n action: PayloadAction<{ isUploadingWithApp: boolean }>\n ) => {\n const { isUploadingWithApp } = action.payload;\n state.isUploadingWithApp = isUploadingWithApp;\n\n if (action.payload.isUploadingWithApp) {\n resetUploadError(state);\n }\n }\n },\n extraReducers: (builder) => {\n builder.addCase(hideAllErrors.type, (state) => {\n state.uploadError = null;\n });\n }\n});\n\nexport default imagesSlice.reducer;\n\nexport const {\n setDraftImages,\n addImage,\n replaceImage,\n removeImage,\n changeImagePosition,\n setImageRotation,\n setImageUploadFailed,\n setImagesUploading,\n setMobileUpload\n} = imagesSlice.actions;\n","import { dayjs } from 'tradera/utils/date';\nimport userData from 'tradera/apps/syi/services/user-data';\nimport draftService from 'tradera/apps/syi/services/draft-service';\nimport { type PayloadAction, createSlice } from '@reduxjs/toolkit';\nimport { disableRestart } from 'tradera/apps/syi/state/reducers/draft';\n\ntype ItemDurationSlice = {\n isRestartAvailable: boolean;\n durationDays: number | null | undefined;\n customEndTime?: string;\n allowZeroDayAuctions: boolean;\n validationErrors: { customEndTime?: string };\n};\n\nconst getEndDate = (durationDays: number, customEndTime?: string) => {\n const endDate = dayjs().startOf('date').add(durationDays, 'day');\n if (!customEndTime) return endDate;\n\n const [hours, minutes] = customEndTime.split(':').map(Number);\n return endDate.hour(hours).minute(minutes);\n};\n\nconst getValidationErrors = (\n durationDays: number,\n allowZeroDayAuctions: boolean,\n customEndTime?: string\n) => {\n let customEndTimeError = null;\n const endDate = getEndDate(durationDays, customEndTime);\n\n if (allowZeroDayAuctions) {\n const earliestEndDate = dayjs().add(5, 'minute');\n\n if (endDate.isBefore(earliestEndDate)) {\n customEndTimeError = 'syi_validation_duration_too_short_zero_day'; //'Din valda sluttid är för tidig. Annonser får avslutas tidigast efter 5 minuter.';\n }\n } else if (customEndTime) {\n const earliestEndDate = dayjs().add(3, 'day');\n\n if (endDate.isBefore(earliestEndDate, 'minute')) {\n customEndTimeError = 'syi_validation_duration_too_short'; //'Din valda sluttid är för tidig. Annonser får avslutas tidigast efter 72 timmar.';\n }\n }\n\n return customEndTimeError ? { customEndTime: customEndTimeError } : {};\n};\n\n/**\n * Maps the current hour to an specific end hour.\n * This is to default the end time to the evening slot.\n * @param startHour - The current hour (0-23)\n * @returns The end hour (18-21)\n */\nconst mapHourToEndHour = (startHour: number) => {\n // Add 1 to distribute hours evenly across 4 evening slots (18-21)\n const cycleIndex = startHour + 1;\n\n // Get value 1-4 to determine which evening hour to use\n const remainder = cycleIndex % 4 || 4;\n\n switch (remainder) {\n case 1:\n return 18;\n case 2:\n return 19;\n case 3:\n return 20;\n case 4:\n return 21;\n }\n};\n\nexport const getCustomEndTimeForWeekdays = (durationDays: number) => {\n const endDate = dayjs().add(durationDays, 'day');\n const endingOnWeekend = endDate.day() === 0 || endDate.day() === 6;\n const currentHour = dayjs().hour();\n\n // If ending on weekend or if current hour is already between 17 and 22 (inclusive), do nothing\n if (endingOnWeekend || (currentHour >= 17 && currentHour <= 22)) {\n return undefined;\n }\n\n const currentMinute = dayjs().minute();\n const endHour = mapHourToEndHour(currentHour);\n const customEndTime = `${endHour}:${currentMinute.toString().padStart(2, '0')}`;\n\n return customEndTime;\n};\n\nconst initialState: ItemDurationSlice = {\n isRestartAvailable: true,\n durationDays: userData?.defaultDrafts?.newItem?.durationDays,\n customEndTime: undefined,\n allowZeroDayAuctions: false,\n validationErrors: {}\n};\n\nconst newStateWithoutCampaignRelatedProps = (\n state: ItemDurationSlice,\n durationDays: number,\n allowZeroDayAuctions: boolean,\n customEndTime?: string\n) => {\n const validationErrors = getValidationErrors(\n durationDays,\n allowZeroDayAuctions,\n customEndTime\n );\n return {\n ...state,\n durationDays,\n customEndTime,\n validationErrors\n };\n};\n\nconst itemDurationSlice = createSlice({\n name: 'itemDuration',\n initialState,\n reducers: {\n setDurationDays: (\n state,\n action: PayloadAction<{\n durationDays: number;\n isChangeItem?: boolean;\n }>\n ) => {\n const { durationDays, isChangeItem } = action.payload;\n const validationErrors = isChangeItem\n ? {}\n : getValidationErrors(\n durationDays,\n state.allowZeroDayAuctions,\n state.customEndTime\n );\n return {\n ...state,\n durationDays,\n validationErrors\n };\n },\n setCustomEndTime: (\n state,\n action: PayloadAction<{\n customEndTime: string;\n isChangeItem?: boolean;\n } | null>\n ) => {\n const { customEndTime, isChangeItem } = action.payload || {};\n\n const validationErrors =\n customEndTime && !isChangeItem\n ? getValidationErrors(\n state.durationDays ?? 0,\n state.allowZeroDayAuctions,\n customEndTime\n )\n : {};\n\n return {\n ...state,\n customEndTime,\n validationErrors\n };\n },\n resetDurationAndEndTime: (state) => {\n const durationDays =\n draftService.getDefaultTemplateValue('durationDays');\n const customEndTime =\n draftService.getDefaultTemplateValue('customEndTime');\n const newState = newStateWithoutCampaignRelatedProps(\n state,\n durationDays ?? 0,\n state.allowZeroDayAuctions,\n customEndTime ?? undefined\n );\n\n return newState;\n },\n // maybe this can be removed ..\n resetCustomEndTime: (state) => {\n return {\n ...state,\n customEndTime: initialState.customEndTime\n };\n },\n disableZeroDayAuctions: (state) => {\n const durationDays =\n (state.durationDays ?? 0) >= 3 ? state.durationDays : 3;\n\n return {\n ...state,\n allowZeroDayAuctions: false,\n durationDays\n };\n },\n enableZeroDayAuctions: (state) => {\n return {\n ...state,\n allowZeroDayAuctions: true\n };\n },\n enableRestart: (state) => {\n return {\n ...state,\n isRestartAvailable: true\n };\n }\n },\n extraReducers(builder) {\n builder.addCase(disableRestart, (state) => {\n return {\n ...state,\n isRestartAvailable: false\n };\n });\n }\n});\n\nexport default itemDurationSlice.reducer;\n\nexport const {\n setDurationDays,\n setCustomEndTime,\n resetDurationAndEndTime,\n resetCustomEndTime,\n disableZeroDayAuctions,\n enableZeroDayAuctions,\n enableRestart\n} = itemDurationSlice.actions;\n","/* eslint-disable better-mutation/no-mutation */\nimport { type PayloadAction, createSlice } from '@reduxjs/toolkit';\nimport { fetchOffsitePaymentDetection } from 'tradera/apps/syi/state/actions/long-description-actions';\n\nconst MAX_DESCRIPTION_LENGTH = 7000;\n\nfunction validate(textWithHtml: string | null) {\n if (textWithHtml && textWithHtml.length > MAX_DESCRIPTION_LENGTH) {\n return 'syi_validation_description_to_long';\n }\n\n const elm = document.createElement('div');\n elm.innerHTML = textWithHtml || '';\n\n if (elm.textContent) {\n return elm.textContent.trim() !== ''\n ? null\n : 'syi_validation_missing_description';\n } else if (elm.innerText) {\n return elm.innerText.trim() !== ''\n ? null\n : 'syi_validation_missing_description';\n }\n return 'syi_validation_missing_description';\n}\n\n// By ensuring that shortDescription is always a string makes\n// it easy to know when it has really changed to something significant.\nfunction ensureString(s?: string | null) {\n return !s ? '' : s;\n}\n\ntype longDescriptionSlice = {\n longDescription: string | null;\n validationError: string | null;\n isCurrentDescriptionFromDraft: boolean;\n fromDraftCounter: number;\n isOffsitePaymentDetected?: boolean;\n};\nconst initialState: longDescriptionSlice = {\n longDescription: null,\n validationError: null,\n isCurrentDescriptionFromDraft: false,\n fromDraftCounter: 0,\n isOffsitePaymentDetected: false\n};\n\nconst longDescriptionSlice = createSlice({\n name: 'longDescription',\n initialState,\n reducers: {\n setLongDescription: (state, action: PayloadAction) => {\n state.isCurrentDescriptionFromDraft = false;\n state.longDescription = ensureString(action.payload);\n state.validationError = validate(action.payload);\n },\n setLongDescriptionFromDraft: (\n state,\n action: PayloadAction\n ) => {\n state.isCurrentDescriptionFromDraft = true;\n state.longDescription = ensureString(action.payload);\n state.validationError = validate(action.payload);\n state.fromDraftCounter += 1;\n },\n resetLongDescription: (state) => {\n const defaultValue = null;\n state.isCurrentDescriptionFromDraft = false;\n state.longDescription = defaultValue;\n state.validationError = validate(defaultValue);\n }\n },\n extraReducers: (builder) => {\n builder.addCase(\n fetchOffsitePaymentDetection.fulfilled,\n (state, action) => {\n state.isOffsitePaymentDetected =\n action?.payload?.isOffsitePaymentDetected || false;\n }\n );\n }\n});\n\nexport const {\n setLongDescription,\n setLongDescriptionFromDraft,\n resetLongDescription\n} = longDescriptionSlice.actions;\n\nexport default longDescriptionSlice.reducer;\n","import { createSlice } from '@reduxjs/toolkit';\nimport userData from 'tradera/apps/syi/services/user-data';\nimport config from 'tradera/apps/syi/services/config';\n\nconst setValidationError = (condition: boolean | undefined) =>\n condition ? 'syi_summary_terms_active_consent_missing_error' : null;\n\nconst validate = (state: MemberConsentState) => {\n return {\n ...state,\n validationError: setValidationError(!state.hasTraderaPayConsent)\n };\n};\n\ntype MemberConsentState = {\n isUnderLicense?: boolean;\n hasTraderaPayConsent?: boolean;\n initalConsentGiven?: boolean;\n shouldGiveConsent?: boolean;\n needsConsentOfTraderaPayAgreement?: string;\n signatoryVerificationRequired?: boolean;\n validationError?: string | null;\n};\n\nconst createInitalState = (): MemberConsentState => {\n if (!userData || !userData.consent || !userData.braintree) {\n // seems syi is not loaded, return empty object\n return {};\n }\n // Companies need to verify signatory when consent to money transfer license.\n // And this is not possible on SYI and should therefor not be shown or validated.\n const shouldBypassConsent = userData.consent.signatoryVerificationRequired;\n\n const shouldGiveConsent = config.isSyiMemberConsentEnabled;\n const hasTraderaPayConsent = !!userData.consent.hasTraderaPayConsent;\n const needsConsentOfTraderaPayAgreement =\n userData.consent.needsConsentOfTraderaPayAgreement;\n const hasValidationError =\n shouldGiveConsent &&\n !shouldBypassConsent &&\n !userData.consent.hasTraderaPayConsent;\n\n return {\n isUnderLicense: userData.consent.isUnderLicense,\n hasTraderaPayConsent,\n initalConsentGiven: hasTraderaPayConsent,\n shouldGiveConsent,\n needsConsentOfTraderaPayAgreement,\n signatoryVerificationRequired:\n userData.consent.signatoryVerificationRequired,\n validationError: setValidationError(hasValidationError)\n };\n};\n\nconst initialState = createInitalState();\n\nconst memberConsentSlice = createSlice({\n name: 'memberConsent',\n initialState,\n reducers: {\n setTraderaPayConsent: (state, action) =>\n validate({\n ...state,\n hasTraderaPayConsent: action.payload\n })\n }\n});\n\nexport const { setTraderaPayConsent } = memberConsentSlice.actions;\nexport default memberConsentSlice.reducer;\n","/* eslint-disable better-mutation/no-mutation */\nimport { type PayloadAction, createSlice } from '@reduxjs/toolkit';\nimport {\n fetchClassificationFromFirstImage,\n fetchPredictionsFromImages\n} from 'tradera/apps/syi/state/actions/predictions-actions';\nimport { ITEM_CLASSIFICATIONS_FOR_PREDICTION } from 'tradera/apps/syi/state/reducers/images';\nimport type { ClassifyFromDraftImageApiResponse } from 'tradera/state/services/types/webapi-selling-generated';\n\nconst setValidationError = (condition: boolean | undefined) =>\n condition ? 'syi_validation_prediction_publish_consent' : null;\n\nconst validate = (state: PredictionsState) => {\n return {\n ...state,\n validationError: setValidationError(!state.hasAutoFillConsent)\n };\n};\n\ntype PredictionsState = {\n isLoadingPredictions: boolean;\n shortDescription?: string;\n longDescription?: string;\n shouldSuggestShortDescription?: boolean;\n shouldSuggestLongDescription?: boolean;\n numProcessedImages?: number;\n aiProcessingTime?: number;\n\n classification: ClassifyFromDraftImageApiResponse | null;\n canGetPredictionFromImages: boolean;\n isClassificationPending: boolean;\n hasUsedPredictedDescription: boolean;\n hasAutoFillConsent: boolean;\n validationError?: string | null;\n hasUsedAutoFill: boolean;\n};\n\nconst initialState: PredictionsState = {\n isLoadingPredictions: false,\n classification: null,\n canGetPredictionFromImages: false,\n isClassificationPending: false,\n hasUsedAutoFill: false,\n hasUsedPredictedDescription: false,\n hasAutoFillConsent: false,\n shortDescription: undefined,\n validationError: null\n};\n\nconst predictionsSlice = createSlice({\n name: 'predictions',\n initialState,\n reducers: {\n setPredictedShortDescription: (state, action) => {\n state.shortDescription = action.payload;\n },\n setPredictedLongDescription: (state, action) => {\n state.longDescription = action.payload;\n },\n setShouldSuggestShortDescription: (state, action) => {\n state.shouldSuggestShortDescription = action.payload;\n },\n setShouldSuggestLongDescription: (state, action) => {\n state.shouldSuggestLongDescription = action.payload;\n },\n setHasUsedPredictedDescription: (\n state,\n action: PayloadAction\n ) =>\n validate({\n ...state,\n hasUsedAutoFill: action.payload,\n hasUsedPredictedDescription: action.payload,\n hasAutoFillConsent: false\n }),\n setHasUsedAutoFill: (state, action: PayloadAction) =>\n validate({\n ...state,\n hasUsedAutoFill: action.payload\n }),\n setNumProcessedImages: (state, action) => {\n state.numProcessedImages = action.payload;\n },\n setAiProcessingTime: (state, action) => {\n state.aiProcessingTime = action.payload;\n },\n setHasAutoFillConsent: (state, action) =>\n validate({\n ...state,\n hasAutoFillConsent: action.payload\n })\n },\n extraReducers: (builder) => {\n builder.addCase(fetchClassificationFromFirstImage.pending, (state) => {\n state.classification = null;\n state.isClassificationPending = true;\n state.canGetPredictionFromImages = false;\n });\n builder.addCase(\n fetchClassificationFromFirstImage.fulfilled,\n (state, action) => {\n state.classification = action.payload;\n state.isClassificationPending = false;\n state.canGetPredictionFromImages =\n action.payload.itemClassification !==\n ITEM_CLASSIFICATIONS_FOR_PREDICTION.Other;\n }\n );\n builder.addCase(fetchClassificationFromFirstImage.rejected, (state) => {\n state.classification = null;\n state.isClassificationPending = false;\n state.canGetPredictionFromImages = false;\n });\n builder.addCase(fetchPredictionsFromImages.pending, (state) => {\n state.isLoadingPredictions = true;\n });\n builder.addCase(fetchPredictionsFromImages.fulfilled, (state) => {\n state.isLoadingPredictions = false;\n });\n builder.addCase(fetchPredictionsFromImages.rejected, (state) => {\n state.isLoadingPredictions = false;\n });\n }\n});\n\nexport const {\n setPredictedShortDescription,\n setPredictedLongDescription,\n setShouldSuggestShortDescription,\n setShouldSuggestLongDescription,\n setHasUsedAutoFill,\n setHasUsedPredictedDescription,\n setNumProcessedImages,\n setAiProcessingTime,\n setHasAutoFillConsent\n} = predictionsSlice.actions;\nexport default predictionsSlice.reducer;\n","/* eslint-disable better-mutation/no-mutation */\nimport { createSlice, type PayloadAction } from '@reduxjs/toolkit';\nimport config from 'tradera/apps/syi/services/config';\nimport { ITEM_TYPE } from 'tradera/apps/syi/state/constants';\n\ntype ValidationErrors = {\n fixedPrice?: string | null;\n openingBid?: string | null;\n auctionBinPrice?: string | null;\n reservePrice?: string | null;\n};\n\ntype PriceState = {\n openingBid: number | null;\n auctionBinPrice: number | null;\n fixedPrice: number | null;\n reservePrice: number | null;\n showReservePrice: boolean;\n showCharityDonation: boolean;\n editCharity: boolean;\n isAuctionBinSelected: boolean | null;\n isPureBinSelected: boolean | null;\n validationErrors: ValidationErrors;\n selectableVats: number[];\n reservePriceCanChangeButNotBeRemoved: boolean;\n vat: number | null;\n reservePriceCost: number;\n isDirty: boolean;\n selectedItemType: (typeof ITEM_TYPE)[keyof typeof ITEM_TYPE];\n};\n\nfunction isValidPrice(number: number | null): boolean {\n if (number === null || number < 1) return false;\n const str = String(number);\n if (!Number.isFinite(parseInt(str))) {\n return false;\n } else if (str.indexOf('.') > -1) {\n return false;\n } else if (str.indexOf(',') > -1) {\n return false;\n }\n return true;\n}\n\nfunction isInt(number: number | null): number is number {\n if (number === null) return false;\n return number % 1 === 0;\n}\n\nfunction validateOpeningBid({\n isPureBinSelected,\n openingBid\n}: Pick): string | null {\n if (isPureBinSelected) {\n return null;\n }\n\n if (openingBid && !isInt(openingBid)) {\n return 'syi_validation_amount_must_be_whole_number';\n }\n\n const maxPrice = 10000000;\n const minPrice = 1;\n\n if (!isValidPrice(openingBid)) {\n return 'syi_validation_opening_bid_missing';\n }\n\n if (openingBid && openingBid > maxPrice) {\n return 'syi_validation_max_opening_bid';\n }\n\n if (openingBid && openingBid < minPrice) {\n return 'syi_validation_minimum_opening_bid';\n }\n\n return null;\n}\n\nfunction validateReservePrice({\n isPureBinSelected,\n showReservePrice,\n openingBid,\n reservePrice,\n auctionBinPrice\n}: Pick<\n PriceState,\n | 'isPureBinSelected'\n | 'showReservePrice'\n | 'openingBid'\n | 'reservePrice'\n | 'auctionBinPrice'\n>): string | null {\n if (isPureBinSelected) {\n return null;\n }\n\n if (showReservePrice && !reservePrice) {\n return 'syi_validation_amount_missing';\n }\n\n if (reservePrice && !isInt(reservePrice)) {\n return 'syi_validation_amount_must_be_whole_number';\n }\n\n const maxPrice = 10000000;\n\n if (reservePrice && !isValidPrice(reservePrice)) {\n return 'syi_validation_invalid_reservation_price';\n }\n\n const reservePriceIsLessThanOpeningBid =\n reservePrice && reservePrice <= (openingBid ?? 0);\n if (reservePriceIsLessThanOpeningBid) {\n return 'syi_validation_reservation_must_be_larger_than_starting';\n }\n\n const reservePriceIsGreaterThanAuctionBinPrice =\n reservePrice && auctionBinPrice && reservePrice >= auctionBinPrice;\n if (reservePriceIsGreaterThanAuctionBinPrice) {\n return 'syi_validation_reservation_must_be_less_than_buy_now';\n }\n\n if (reservePrice && reservePrice > maxPrice) {\n return 'syi_validation_max_reservation_price';\n }\n\n return null;\n}\n\nfunction validateAuctionBinPrice({\n isAuctionBinSelected,\n isPureBinSelected,\n openingBid,\n reservePrice,\n auctionBinPrice\n}: Pick<\n PriceState,\n | 'isAuctionBinSelected'\n | 'isPureBinSelected'\n | 'openingBid'\n | 'reservePrice'\n | 'auctionBinPrice'\n>): string | null {\n if (isPureBinSelected) {\n return null;\n }\n\n if (isAuctionBinSelected && !isInt(auctionBinPrice)) {\n return 'syi_validation_amount_missing';\n }\n\n const auctionBinPriceIsLessThanOpeningBid =\n auctionBinPrice && auctionBinPrice <= (openingBid ?? 0);\n if (auctionBinPriceIsLessThanOpeningBid) {\n return 'syi_validation_buy_now_must_be_larger_than_starting';\n }\n\n const reservePriceIsGreaterThanAuctionBinPrice =\n reservePrice && auctionBinPrice && reservePrice >= auctionBinPrice;\n if (reservePriceIsGreaterThanAuctionBinPrice) {\n return 'syi_validation_buy_now_must_be_larger_than_reservation';\n }\n\n return null;\n}\n\nfunction validateFixedPrice({\n isPureBinSelected,\n fixedPrice\n}: Pick): string | null {\n if (!isPureBinSelected) {\n return null;\n }\n\n if (fixedPrice && !isInt(fixedPrice)) {\n return 'syi_validation_amount_must_be_whole_number';\n }\n\n const maxPrice = 10000000;\n const minPrice = 1;\n\n if (!isValidPrice(fixedPrice)) {\n return 'syi_validation_enter_fixed_price';\n }\n\n if (!isNaN(Number(fixedPrice))) {\n if (fixedPrice && fixedPrice > maxPrice) {\n return 'syi_validation_fixed_price_max_value';\n }\n\n if (fixedPrice && fixedPrice < minPrice) {\n return 'syi_validation_fixed_price_min_value';\n }\n }\n\n return null;\n}\n\nfunction validate(newState: PriceState): PriceState {\n const validationErrors: ValidationErrors = {};\n\n validationErrors.fixedPrice = validateFixedPrice(newState);\n validationErrors.openingBid = validateOpeningBid(newState);\n validationErrors.auctionBinPrice = validateAuctionBinPrice(newState);\n validationErrors.reservePrice = validateReservePrice(newState);\n\n // Remove null validation errors\n Object.keys(validationErrors).forEach((key) => {\n if (!validationErrors[key as keyof ValidationErrors]) {\n delete validationErrors[key as keyof ValidationErrors];\n }\n });\n\n const isDirty =\n newState.openingBid !== initialState.openingBid ||\n newState.auctionBinPrice !== initialState.auctionBinPrice ||\n newState.fixedPrice !== initialState.fixedPrice ||\n newState.reservePrice !== initialState.reservePrice;\n\n return { ...newState, validationErrors, isDirty };\n}\n\nconst queryParams = new URLSearchParams(\n typeof window !== 'undefined' ? window?.location?.search : ''\n);\n\nfunction toIntOrNull(\n numberOrString: string | number | null | undefined\n): number | null {\n if (numberOrString === null || numberOrString === undefined) {\n return null;\n }\n\n const number =\n typeof numberOrString === 'number'\n ? numberOrString\n : parseInt(numberOrString);\n\n if (isFinite(number)) {\n return number;\n }\n return null;\n}\n\nconst initialState: PriceState = {\n openingBid: null,\n auctionBinPrice: null,\n fixedPrice: null,\n reservePrice: null,\n showReservePrice: false,\n showCharityDonation: Boolean(queryParams.get('charityId')),\n editCharity: false,\n isAuctionBinSelected: null,\n isPureBinSelected: null,\n validationErrors: {},\n selectableVats: config.selectableVatValues,\n reservePriceCanChangeButNotBeRemoved: false,\n vat: null,\n reservePriceCost: 40,\n isDirty: false,\n selectedItemType: ITEM_TYPE.AUCTION\n};\n\nconst priceSlice = createSlice({\n name: 'price',\n initialState,\n reducers: {\n setOpeningBid: (state, action: PayloadAction) => {\n state.openingBid = toIntOrNull(action.payload);\n const validated = validate(state);\n state.validationErrors = validated.validationErrors;\n state.isDirty = validated.isDirty;\n },\n setAuctionBinPrice: (\n state,\n action: PayloadAction\n ) => {\n state.auctionBinPrice = toIntOrNull(action.payload);\n const validated = validate(state);\n state.validationErrors = validated.validationErrors;\n state.isDirty = validated.isDirty;\n },\n setFixedPrice: (\n state,\n action: PayloadAction\n ) => {\n state.fixedPrice = toIntOrNull(action.payload);\n const validated = validate(state);\n state.validationErrors = validated.validationErrors;\n state.isDirty = validated.isDirty;\n },\n setReservePrice: (state, action: PayloadAction) => {\n state.reservePrice = toIntOrNull(action.payload);\n const validated = validate(state);\n state.validationErrors = validated.validationErrors;\n state.isDirty = validated.isDirty;\n },\n setReservePriceVisibility: (state, action: PayloadAction) => {\n state.showReservePrice = action.payload;\n const validated = validate(state);\n state.validationErrors = validated.validationErrors;\n state.isDirty = validated.isDirty;\n },\n setCharityDonationVisibility: (\n state,\n action: PayloadAction\n ) => {\n state.showCharityDonation = action.payload;\n const validated = validate(state);\n state.validationErrors = validated.validationErrors;\n state.isDirty = validated.isDirty;\n },\n setEditCharity: (state, action: PayloadAction) => {\n state.editCharity = action.payload;\n const validated = validate(state);\n state.validationErrors = validated.validationErrors;\n state.isDirty = validated.isDirty;\n },\n setIsPureBinSelected: (\n state,\n action: PayloadAction\n ) => {\n state.isPureBinSelected = action.payload;\n const validated = validate(state);\n state.validationErrors = validated.validationErrors;\n state.isDirty = validated.isDirty;\n },\n setIsAuctionBinSelected: (\n state,\n action: PayloadAction\n ) => {\n state.isAuctionBinSelected = action.payload;\n const validated = validate(state);\n state.validationErrors = validated.validationErrors;\n state.isDirty = validated.isDirty;\n },\n setVat: (state, action: PayloadAction) => {\n state.vat = action.payload;\n const validated = validate(state);\n state.validationErrors = validated.validationErrors;\n state.isDirty = validated.isDirty;\n },\n setSelectedItemType: (\n state,\n action: PayloadAction<(typeof ITEM_TYPE)[keyof typeof ITEM_TYPE]>\n ) => {\n state.selectedItemType = action.payload;\n const validated = validate(state);\n state.validationErrors = validated.validationErrors;\n state.isDirty = validated.isDirty;\n },\n resetPricesAndVat: (state) => {\n state.openingBid = null;\n state.auctionBinPrice = null;\n state.fixedPrice = null;\n state.vat = null;\n const validated = validate(state);\n state.validationErrors = validated.validationErrors;\n state.isDirty = validated.isDirty;\n },\n setReservePriceCanChangeButNotBeRemoved: (\n state,\n action: PayloadAction\n ) => {\n state.reservePriceCanChangeButNotBeRemoved = action.payload;\n const validated = validate(state);\n state.validationErrors = validated.validationErrors;\n state.isDirty = validated.isDirty;\n }\n }\n});\n\nexport const {\n setOpeningBid,\n setAuctionBinPrice,\n setFixedPrice,\n setReservePrice,\n setReservePriceVisibility,\n setCharityDonationVisibility,\n setEditCharity,\n setIsAuctionBinSelected,\n setIsPureBinSelected,\n setVat,\n setSelectedItemType,\n resetPricesAndVat,\n setReservePriceCanChangeButNotBeRemoved\n} = priceSlice.actions;\n\nexport default priceSlice.reducer;\n","/* eslint-disable better-mutation/no-mutation */\n\nimport { type PayloadAction, createSlice } from '@reduxjs/toolkit';\nimport {\n getSelectedShippingOptions,\n getSelectedShippingProducts\n} from './helpers/shipping-reducer-helpers';\nimport { v4 as uuidv4 } from 'uuid';\nimport type {\n ProductsPerWeightSpanAndSize,\n ShippingOption,\n ShippingProduct\n} from 'tradera/state/services/types/webapi-selling-generated';\n\nconst getUuid = () => uuidv4();\n\nconst errors = {\n noShipping: 'syi_validation_shipping_no_shipping',\n empty: 'syi_validation_shipping_enter_method_and_cost',\n invalid: 'syi_validation_shipping_method_invalid',\n duplicate: 'syi_validation_shipping_method_identical',\n weight: 'syi_validation_shipping_enter_weight'\n};\n\nfunction validate(newState: ShippingState) {\n if (!newState.offerTakeaway && !newState.offerShipping) {\n newState.globalValidationError = errors.noShipping;\n newState.validationErrors = {\n global: errors.noShipping\n };\n return newState;\n }\n\n newState.globalValidationError = null;\n newState.validationErrors = {};\n\n return newState;\n}\n\nconst offersFreeShipping = (shippingOptions: ShippingOption[]) =>\n shippingOptions.some((shippingOption) => shippingOption.cost === 0);\n\nexport type DecoratedShippingProduct = ShippingProduct & {\n cost: number | null;\n productId: number;\n type: string;\n uuid: string;\n outage?: boolean;\n};\n\ntype ShippingState = {\n validationErrors: Record;\n globalValidationError: string | null;\n shippingByWeightGroupedBySizes: ProductsPerWeightSpanAndSize[] | undefined;\n selectedShippingOptions: DecoratedShippingProduct[];\n selectedShippingSize: string | null;\n shippingOptionsLoading: boolean;\n shippingOptionsError: boolean;\n offerTakeaway: boolean;\n offerShipping: boolean;\n offersFreeShipping: boolean;\n fromCountry: string | null;\n packagingCost: number | null;\n decoratedShippingProducts: DecoratedShippingProduct[];\n};\n\nconst initialState: ShippingState = validate({\n validationErrors: {},\n globalValidationError: null,\n selectedShippingOptions: [],\n selectedShippingSize: null,\n shippingOptionsLoading: false,\n shippingOptionsError: false,\n offerTakeaway: false,\n offerShipping: false,\n offersFreeShipping: false,\n fromCountry: null,\n packagingCost: null,\n shippingByWeightGroupedBySizes: [],\n decoratedShippingProducts: []\n});\n\nconst shippingContainsTakeaway = (shippingOptions: ShippingOption[]) =>\n shippingOptions.some(\n (shippingOption) =>\n shippingOption.type === 'Takeaway' ||\n shippingOption.type === 'TakeawayOnly'\n );\n\nconst shippingContainsNonTakeaway = (shippingOptions: ShippingOption[]) =>\n shippingOptions.some(\n (shippingOption) =>\n shippingOption.type !== 'Takeaway' &&\n shippingOption.type !== 'TakeawayOnly'\n );\n\nexport const mapToDecoratedShippingProduct = (\n shippingProduct: ShippingProduct\n): DecoratedShippingProduct => ({\n ...shippingProduct,\n cost: shippingProduct.price,\n productId: shippingProduct.id,\n type: shippingProduct.providerId || '',\n uuid: getUuid()\n});\n\nconst flatMapProductsPerWeightSpanAndSizeToDecoratedShippingProducts = (\n productsPerWeightSpanAndSize:\n | ProductsPerWeightSpanAndSize[]\n | null\n | undefined\n): DecoratedShippingProduct[] =>\n productsPerWeightSpanAndSize\n ?.flatMap((weightClass) =>\n weightClass.productsBySize?.flatMap((size) => size.products)\n )\n .filter((x) => !!x)\n .map(mapToDecoratedShippingProduct) ?? [];\n\nconst shippingSlice = createSlice({\n name: 'shipping',\n initialState,\n reducers: {\n resetSelectedShippingOptions: (state) => {\n state.selectedShippingOptions = [];\n state.offerShipping = false;\n state.offerTakeaway = false;\n state.selectedShippingSize = null;\n return validate(state);\n },\n setShippingOptionsByWeight: (\n state,\n action: PayloadAction<{\n productsPerWeightSpanAndSize:\n | ProductsPerWeightSpanAndSize[]\n | null\n | undefined;\n shippingOptions: ShippingOption[];\n }>\n ) => {\n const { productsPerWeightSpanAndSize, shippingOptions } =\n action.payload;\n\n const decoratedShippingProducts =\n flatMapProductsPerWeightSpanAndSizeToDecoratedShippingProducts(\n productsPerWeightSpanAndSize\n );\n\n state.decoratedShippingProducts = decoratedShippingProducts;\n state.shippingByWeightGroupedBySizes =\n productsPerWeightSpanAndSize ?? undefined;\n\n state.offerTakeaway = shippingContainsTakeaway(shippingOptions);\n state.offerShipping = shippingContainsNonTakeaway(shippingOptions);\n\n state.selectedShippingOptions = getSelectedShippingOptions(\n decoratedShippingProducts,\n shippingOptions,\n state.offerTakeaway\n );\n state.offersFreeShipping = offersFreeShipping(\n state.selectedShippingOptions\n );\n\n state.shippingOptionsLoading = false;\n state.shippingOptionsError = false;\n return validate(state);\n },\n autoSelectShippingOptions: (\n state,\n action: PayloadAction\n ) => {\n // only use autoSelect if no shipping options are selected, otherwise\n // we might overwrite selected shipping options from a template or resell\n if (state.selectedShippingOptions.length > 0) return;\n\n const autoSelectedWeight =\n state.shippingByWeightGroupedBySizes?.find(\n (weightClass) => weightClass.autoSelect\n );\n if (autoSelectedWeight) {\n const autoSelectedSize =\n autoSelectedWeight.productsBySize?.find(\n (size) => size.autoSelect\n );\n if (autoSelectedSize) {\n state.selectedShippingSize =\n autoSelectedSize.sizeCategory ?? null;\n state.selectedShippingOptions =\n autoSelectedSize.products?.map((p) => ({\n ...mapToDecoratedShippingProduct(p),\n cost: p.price + (action.payload ?? 0)\n })) ?? [];\n if (state.selectedShippingOptions.length > 0) {\n state.packagingCost = action.payload ?? 0;\n }\n }\n }\n\n state.offerTakeaway = shippingContainsTakeaway(\n state.selectedShippingOptions\n );\n state.offerShipping = shippingContainsNonTakeaway(\n state.selectedShippingOptions\n );\n return validate(state);\n },\n\n setShippingOptionsLoading: (state, action: PayloadAction) => {\n state.shippingOptionsLoading = action.payload;\n return validate(state);\n },\n setShippingOptionSelected: (\n state,\n action: PayloadAction\n ) => {\n const { payload } = action;\n\n const selectedOptions = getSelectedShippingProducts(\n state.decoratedShippingProducts,\n payload,\n state.offerTakeaway\n );\n\n state.offerShipping = shippingContainsNonTakeaway(selectedOptions);\n state.offersFreeShipping = offersFreeShipping(selectedOptions);\n state.selectedShippingOptions = selectedOptions;\n\n return validate(state);\n },\n setSelectedShippingSize: (\n state,\n action: PayloadAction\n ) => {\n state.selectedShippingSize = action.payload;\n return validate(state);\n },\n setPackagingCost: (state, action: PayloadAction) => {\n state.packagingCost = action.payload;\n return validate(state);\n },\n setTakeawaySelected: (\n state,\n action: PayloadAction<{ offerTakeaway: boolean }>\n ) => {\n state.offerTakeaway = action.payload.offerTakeaway;\n state.selectedShippingOptions = getSelectedShippingProducts(\n state.decoratedShippingProducts,\n state.selectedShippingOptions,\n state.offerTakeaway\n );\n\n return validate(state);\n },\n setShippingOptionsError: (state) => {\n state.shippingOptionsLoading = false;\n state.shippingOptionsError = true;\n\n return validate(state);\n },\n setShippingFromCountry: (\n state,\n action: PayloadAction<{ fromCountry: string }>\n ) => {\n state.fromCountry = action.payload.fromCountry;\n }\n }\n});\n\nexport const {\n autoSelectShippingOptions,\n setShippingFromCountry,\n setShippingOptionsByWeight,\n setShippingOptionsError,\n setTakeawaySelected,\n setShippingOptionSelected,\n resetSelectedShippingOptions,\n setShippingOptionsLoading,\n setSelectedShippingSize,\n setPackagingCost\n} = shippingSlice.actions;\n\nexport default shippingSlice.reducer;\n","import { type PayloadAction, createSlice } from '@reduxjs/toolkit';\nimport { isDenmarkCountryCode } from 'tradera/localization/countrycode';\nimport initData from 'tradera/legacy/static/packages/init-data';\nimport { MAX_SHORT_DESCRIPTION_LENGTH } from 'tradera/apps/syi/containers/short-description';\n\ntype ShortDescriptionSlice = {\n shortDescription: string | null;\n validationError?: string | null;\n descriptionLanguageCodeIso2: string | null;\n isDescriptionLanguageCodeIso2ChangeAvailable: boolean;\n};\nconst initialState: ShortDescriptionSlice = {\n shortDescription: null,\n validationError: null,\n descriptionLanguageCodeIso2: null,\n isDescriptionLanguageCodeIso2ChangeAvailable:\n initData &&\n initData.memberCountryCodeIso2 &&\n isDenmarkCountryCode(initData.memberCountryCodeIso2)\n};\n\nconst getValidationError = (state: ShortDescriptionSlice) => {\n if (!state.shortDescription || state.shortDescription.trim() === '') {\n return 'syi_validation_missing_title';\n }\n\n if (state.shortDescription.length > MAX_SHORT_DESCRIPTION_LENGTH) {\n return 'syi_shortdescription_error_count_toast';\n }\n\n if (\n state.isDescriptionLanguageCodeIso2ChangeAvailable &&\n !state.descriptionLanguageCodeIso2\n ) {\n return 'syi_validation_missing_descriptionLanguageCodeIso2';\n }\n};\n\nconst validate = (state: ShortDescriptionSlice) => ({\n ...state,\n validationError: getValidationError(state)\n});\n\nconst shortDescriptionSlice = createSlice({\n name: 'shortDescription',\n initialState,\n reducers: {\n setShortDescription: (state, action: PayloadAction) =>\n validate({ ...state, shortDescription: action.payload }),\n resetShortDescription: (state) =>\n validate({ ...state, shortDescription: null }),\n setDescriptionLanguageCodeIso2: (\n state,\n action: PayloadAction\n ) =>\n validate({\n ...state,\n descriptionLanguageCodeIso2: action.payload\n })\n }\n});\n\nexport const {\n setShortDescription,\n resetShortDescription,\n setDescriptionLanguageCodeIso2\n} = shortDescriptionSlice.actions;\n\nexport default shortDescriptionSlice.reducer;\n","/* eslint-disable better-mutation/no-mutation */\nimport { createSlice, type PayloadAction } from '@reduxjs/toolkit';\nimport type {\n ItemDraftResponse,\n GetCategoryRestrictionApiResponse\n} from 'tradera/state/services/types/webapi-selling-generated';\n\ntype SyiState = {\n creationStart: number | null;\n allErrorsVisible: boolean;\n isEditOfPublishedItem: boolean;\n publishPending: boolean;\n publishFailed: boolean;\n publishFailedReasonDisplayText: string | null;\n publishedItemPendingVip: { itemId: string } | null;\n publishedItem: ItemDraftResponse | null;\n openModal: string | null;\n openModalData: null;\n autoSaveEnabled: boolean;\n draftCanBeResumed: boolean;\n itemUpdating: boolean;\n itemUpdated: boolean;\n isDraftSaved: boolean;\n publishDelayed: boolean;\n categoryRestriction: GetCategoryRestrictionApiResponse | null;\n fadeUi: boolean;\n};\n\nconst initialState: SyiState = {\n creationStart: null,\n allErrorsVisible: false,\n isEditOfPublishedItem: false,\n publishPending: false,\n publishFailed: false,\n publishFailedReasonDisplayText: null,\n publishedItemPendingVip: null,\n publishedItem: null,\n openModal: null,\n openModalData: null,\n autoSaveEnabled: false,\n draftCanBeResumed: false,\n itemUpdating: false,\n itemUpdated: false,\n isDraftSaved: false,\n publishDelayed: false,\n categoryRestriction: null,\n fadeUi: false\n};\n\nconst syiSlice = createSlice({\n name: 'syi',\n initialState,\n reducers: {\n resetSyi: () => initialState,\n /**\n *\n * @param action Epoch\n */\n setCreationStart: (state, action: PayloadAction) => {\n state.creationStart = action.payload;\n },\n showAllErrors: (state) => {\n state.allErrorsVisible = true;\n },\n hideAllErrors: (state) => {\n state.allErrorsVisible = false;\n },\n setIsEditOfPublishedItem: (state, action: PayloadAction) => {\n state.isEditOfPublishedItem = action.payload;\n },\n setPublishedItemPendingVip: (\n state,\n action: PayloadAction<{ itemId: string }>\n ) => {\n state.publishedItemPendingVip = action.payload;\n state.publishedItem = null;\n state.publishFailed = false;\n state.publishFailedReasonDisplayText = null;\n state.publishPending = false;\n state.publishDelayed = false;\n },\n setPublishedItemDelayed: (\n state,\n action: PayloadAction<{ itemId: string }>\n ) => {\n state.publishedItemPendingVip = action.payload;\n state.publishedItem = null;\n state.publishFailed = false;\n state.publishFailedReasonDisplayText = null;\n state.publishPending = false;\n state.publishDelayed = true;\n },\n setPublishedItem: (state, action: PayloadAction) => {\n state.publishedItem = action.payload;\n state.publishedItemPendingVip = null;\n state.publishFailed = false;\n state.publishFailedReasonDisplayText = null;\n state.publishPending = false;\n state.publishDelayed = false;\n },\n setPublishFailed: (state, action: PayloadAction) => {\n state.publishedItem = null;\n state.publishedItemPendingVip = null;\n state.publishFailed = true;\n state.publishFailedReasonDisplayText = action.payload;\n state.publishPending = false;\n state.publishDelayed = false;\n },\n setPublishPending: (state) => {\n state.publishedItem = null;\n state.publishedItemPendingVip = null;\n state.publishFailed = false;\n state.publishFailedReasonDisplayText = null;\n state.publishPending = true;\n state.publishDelayed = false;\n },\n setCategoryRestriction: (\n state,\n action: PayloadAction\n ) => {\n state.categoryRestriction = action.payload;\n },\n toggleModal: (state, action: PayloadAction) => {\n state.openModal =\n state.openModal === action.payload ? null : action.payload;\n },\n enableAutoSave: (state) => {\n state.autoSaveEnabled = true;\n },\n disableAutoSave: (state) => {\n state.autoSaveEnabled = false;\n },\n setDraftCanBeResumed: (state, action: PayloadAction) => {\n state.draftCanBeResumed = action.payload;\n },\n setItemUpdating: (state, action: PayloadAction) => {\n state.itemUpdating = action.payload;\n },\n setItemUpdated: (state, action: PayloadAction) => {\n state.itemUpdated = action.payload;\n },\n setIsDraftSaved: (state, action: PayloadAction) => {\n state.isDraftSaved = action.payload;\n },\n setFadeUi: (state, action: PayloadAction) => {\n state.fadeUi = action.payload;\n }\n }\n});\n\nexport const {\n resetSyi,\n setCreationStart,\n showAllErrors,\n hideAllErrors,\n setIsEditOfPublishedItem,\n setPublishedItemPendingVip,\n setPublishedItemDelayed,\n setPublishedItem,\n setPublishFailed,\n setPublishPending,\n setCategoryRestriction,\n toggleModal,\n enableAutoSave,\n disableAutoSave,\n setDraftCanBeResumed,\n setItemUpdating,\n setItemUpdated,\n setIsDraftSaved,\n setFadeUi\n} = syiSlice.actions;\n\nexport default syiSlice.reducer;\n","/* eslint-disable better-mutation/no-mutation */\nimport { type PayloadAction, createSlice } from '@reduxjs/toolkit';\nimport type { ItemDraftResponse } from 'tradera/state/services/types/webapi-selling-generated';\ntype TemplateState = {\n savePending: boolean;\n saveFailed: boolean;\n ignoreProperties: (keyof ItemDraftResponse)[];\n};\n\nconst initialState: TemplateState = {\n savePending: false,\n saveFailed: false,\n ignoreProperties: []\n};\n\nconst templateReducer = createSlice({\n name: 'template',\n initialState,\n reducers: {\n setSavePending: (state, action: PayloadAction) => {\n state.savePending = action.payload;\n },\n setSaveFailed: (state, action: PayloadAction) => {\n state.saveFailed = action.payload;\n },\n resetIgnoreProperties: (state) => {\n state.ignoreProperties = [];\n },\n addIgnoreProperties: (\n state,\n action: PayloadAction>\n ) => {\n state.ignoreProperties = [\n ...new Set([...state.ignoreProperties, ...action.payload])\n ];\n },\n removeIgnoreProperties: (\n state,\n action: PayloadAction>\n ) => {\n state.ignoreProperties = state.ignoreProperties.filter(\n (prop) => !action.payload.includes(prop)\n );\n }\n }\n});\n\nexport const {\n setSavePending,\n setSaveFailed,\n resetIgnoreProperties,\n addIgnoreProperties,\n removeIgnoreProperties\n} = templateReducer.actions;\n\nexport default templateReducer.reducer;\n","import { getSyiSlice } from 'tradera/apps/syi/state/selectors/syi';\nimport type { RootState } from 'tradera/state/configure-store';\n\nexport const selectMagicalSyiSettngEnabled = (state: RootState) =>\n !!getSyiSlice(state).draft.magicalSyiEnabled;\n\nexport const selectDraftId = (state: RootState) =>\n getSyiSlice(state).draft.draftId;\n\nexport const selectDraft = (state: RootState) => getSyiSlice(state).draft;\n","import { createSelector } from '@reduxjs/toolkit';\nimport { getSyiSlice } from 'tradera/apps/syi/state/selectors/syi';\nimport type { RootState } from 'tradera/state/configure-store';\n\nexport const selectIsUploadingFirstImage = createSelector(\n (state: RootState) => getSyiSlice(state).images.uploadingCount,\n (state: RootState) => getSyiSlice(state).images.images.length,\n (uploadingCount, imageCount) => uploadingCount > 0 && imageCount === 0\n);\n\nexport const selectImageIds = createSelector(\n (state: RootState) => getSyiSlice(state).images.images,\n (images) => images.map((image) => image.imageId)\n);\n","import { getSyiSlice } from 'tradera/apps/syi/state/selectors/syi';\nimport type { RootState } from 'tradera/state/configure-store';\n\nexport const selectIsClassificationPending = (state: RootState) =>\n getSyiSlice(state).predictions.isClassificationPending;\n\nexport const selectCanGetPredictionFromImages = (state: RootState) =>\n getSyiSlice(state).predictions.canGetPredictionFromImages;\n\nexport const selectClassificationResponse = (state: RootState) =>\n getSyiSlice(state).predictions.classification;\n\nexport const selectIsLoadingPredictions = (state: RootState) =>\n getSyiSlice(state).predictions.isLoadingPredictions;\n\nexport const selectPredictedShortDescription = (state: RootState) =>\n getSyiSlice(state).predictions.shortDescription;\n\nexport const selectPredictedLongDescription = (state: RootState) =>\n getSyiSlice(state).predictions.longDescription;\n\nexport const selectShouldSuggestShortDescription = (state: RootState) =>\n getSyiSlice(state).predictions.shouldSuggestShortDescription;\n\nexport const selectShouldSuggestLongDescription = (state: RootState) =>\n getSyiSlice(state).predictions.shouldSuggestLongDescription;\n\nexport const selectHasUsedPredictedDescription = (state: RootState) =>\n getSyiSlice(state).predictions.hasUsedPredictedDescription;\n\nexport const selectHasUsedAutoFill = (state: RootState) =>\n getSyiSlice(state).predictions.hasUsedAutoFill;\n","import { getSyiSlice } from 'tradera/apps/syi/state/selectors/syi';\nimport type { RootState } from 'tradera/state/configure-store';\n\nexport const selectPrice = (state: RootState) => getSyiSlice(state).price;\nexport const selectIsPureBinSelected = (state: RootState) =>\n getSyiSlice(state).price.isPureBinSelected;\n","import type { RootState } from 'tradera/state/configure-store';\n\nexport const getSyiSlice = (state: RootState) => state.views.syi;\nexport const selectShortDescription = (state: RootState) =>\n getSyiSlice(state).shortDescription.shortDescription;\n\nexport const selectLongDescription = (state: RootState) =>\n getSyiSlice(state).longDescription.longDescription;\n\nexport const selectItemIdFromDraft = (state: RootState) =>\n getSyiSlice(state).draft?.itemId || undefined;\n\nexport const selectFadeUi = (state: RootState) =>\n getSyiSlice(state).syi.fadeUi || false;\n\nexport const selectIsDraftSaved = (state: RootState) =>\n getSyiSlice(state).syi.isDraftSaved || false;\n","import { createApi } from '@reduxjs/toolkit/query/react';\nimport { isomorphicWebApiBaseQuery } from 'tradera/state/services/utils/webapi-base-query';\nimport type {\n DeleteTemplatesApiRequest,\n GetTemplatesApiResponse\n} from 'tradera/state/services/types/webapi-selling-generated';\n\nexport enum Tags {\n TEMPLATES_LIST = 'TEMPLATES_LIST'\n}\n\nexport const templatesApi = createApi({\n reducerPath: 'templatesApi',\n baseQuery: isomorphicWebApiBaseQuery,\n tagTypes: Object.keys(Tags),\n endpoints: (builder) => ({\n deleteTemplate: builder.mutation({\n invalidatesTags: [Tags.TEMPLATES_LIST],\n query: (parameters) => {\n return {\n url: '/api/webapi/selling/templates',\n method: 'DELETE',\n body: parameters\n };\n }\n }),\n loadTemplates: builder.query({\n providesTags: [Tags.TEMPLATES_LIST],\n query: () => '/api/webapi/selling/templates?take=100'\n })\n })\n});\n\nexport const { useDeleteTemplateMutation, useLoadTemplatesQuery, util } =\n templatesApi;\n","import { useTranslator } from 'tradera/lang/translate';\nimport { ITEM_STATES } from 'tradera/state/views/view-item/constants';\nimport { AnimateOnValueChange } from './animate-on-value-change';\nimport { Button } from 'tradera/components/atoms/button/button';\nimport type {\n PaymentApiDto,\n PaymentCalculations\n} from 'tradera/state/services/types/webapi-browse-generated';\nimport { MandatoryBuyerProtectionInfo } from 'tradera/apps/tradera/components/vip/bidding/mandatory-buyer-protection-info';\nimport type { BuyerProtectionModalType } from 'tradera/apps/tradera/components/vip/seller-details/buyer-protection-info-modal';\nimport { classNames } from 'tradera/utils/class-names';\nimport { useLocalizedPriceFormatterWithExchangeRate } from 'tradera/localization/use-localized-price-formatter';\nimport { CurrencyRateType } from 'tradera/state/multi-currency/reducer';\n\ntype BidDetailsProps = {\n bidCount?: number | null;\n itemState: ITEM_STATES | null;\n leadingBidAmount?: number | null;\n onShowBids: () => void;\n setBuyerProtectionModal: (type: BuyerProtectionModalType) => void;\n openingBid?: number | null;\n finalPrice?: number | null;\n paymentCalculations: PaymentCalculations;\n reservePriceReached?: boolean;\n payment?: PaymentApiDto | null;\n isBuyer: boolean;\n};\n\nexport const BidDetails = ({\n bidCount,\n itemState,\n leadingBidAmount,\n onShowBids,\n setBuyerProtectionModal,\n openingBid,\n finalPrice,\n paymentCalculations,\n reservePriceReached,\n payment,\n isBuyer\n}: BidDetailsProps) => {\n const { t } = useTranslator();\n const localizedPriceFormatter = useLocalizedPriceFormatterWithExchangeRate(\n payment?.paymentMethodExchangeRate,\n isBuyer ? CurrencyRateType.Buyer : CurrencyRateType.Seller\n );\n const itemIsActive =\n itemState === ITEM_STATES.ONGOING_AUCTION_BIN ||\n itemState === ITEM_STATES.ONGOING_AUCTION;\n\n const hasBids = !!bidCount && bidCount > 0;\n const amountDetails = getAmountDetails(\n itemState,\n leadingBidAmount,\n openingBid,\n hasBids,\n finalPrice,\n paymentCalculations.paymentAmountForBid || 0,\n paymentCalculations.paymentAmountForFixedPrice || 0\n );\n\n const amountTitle = (\n

\n {t(amountDetails.title)}\n

\n );\n\n const amountValue = (\n \n \n {amountDetails.amount\n ? localizedPriceFormatter(amountDetails.amount)\n : null}\n \n

\n );\n\n const bidValue = (\n

\n ∙\n {hasBids ? (\n {\n e?.preventDefault();\n onShowBids();\n }}>\n {bidCount} {t('vip_bid')}\n \n ) : (\n \n {bidCount} {t('vip_bid')}\n \n )}\n

\n );\n\n const showBidCount =\n itemState !== ITEM_STATES.ENDED_AUCTION_BIN_BOUGHT_AS_BIN;\n\n return (\n <>\n \n
\n
\n {amountTitle}\n {showBidCount && bidValue}\n
\n
{amountValue}
\n
\n {paymentCalculations.isBuyerProtectionMandatory && (\n \n )}\n \n \n );\n};\n\nexport const getAmountDetails = (\n itemState: ITEM_STATES | null,\n leadingBid?: number | null,\n openingBid?: number | null,\n hasBids?: boolean,\n finalPrice?: number | null,\n paymentAmountForBid?: number | null,\n paymentAmountForFixedPrice?: number | null\n) => {\n if (itemState === ITEM_STATES.ENDED_AUCTION_WITH_WINNING_BID) {\n return {\n title: 'vip_finalPrice',\n amount: finalPrice,\n amountIncludingBuyerProtection: paymentAmountForBid\n };\n }\n\n if (finalPrice && finalPrice > 0) {\n return {\n title: 'vip_soldFor',\n amount: finalPrice,\n amountIncludingBuyerProtection: paymentAmountForFixedPrice\n };\n }\n\n if (hasBids) {\n return {\n title: 'vip_leadingBid',\n amount: leadingBid,\n amountIncludingBuyerProtection: paymentAmountForBid\n };\n }\n return {\n title: 'vip_openingBid',\n amount: openingBid,\n amountIncludingBuyerProtection: paymentAmountForBid\n };\n};\n","import type React from 'react';\nimport { forwardRef } from 'react';\nimport { classNames } from 'tradera/utils/class-names';\nimport type { OnlyAs, PolyRefFunction } from 'react-polymorphed';\n\nconst polyRef = forwardRef as PolyRefFunction;\n\ntype Gap = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type SpaceProps = {\n /**\n * Default: 'horizontal'\n */\n direction?:\n | 'horizontal'\n | 'vertical'\n | 'horizontal-reverse'\n | 'vertical-reverse';\n /**\n * Default: 'center' for horizontal, 'start' for vertical\n */\n align?: 'start' | 'center' | 'end' | 'normal' | 'baseline';\n /**\n * Default: 'start'\n */\n justify?: 'start' | 'center' | 'end' | 'between' | 'around';\n /**\n * Gap sizes as defined by Blueprint. Default: 1. Can be a single value or an array of two values for horizontal and vertical gaps.\n */\n gap?: Gap | [Gap, Gap];\n /**\n * Default: false\n */\n wrap?: boolean;\n /**\n * Default: false\n * If true, the component will be rendered as an inline-flex element.\n */\n inline?: boolean;\n grow?: boolean;\n\n children: React.ReactNode;\n} & React.HTMLAttributes;\n\n/**\n * A component to use when you want to space out elements in a row or column.\n * Example:\n * \n * \n * \n * \n */\nexport const Space = polyRef<\n 'div',\n SpaceProps,\n OnlyAs<'div' | 'section' | 'article' | 'label' | 'span' | 'fieldset'>\n>(\n (\n {\n as: Component = 'div',\n direction = 'horizontal',\n align: alignProp,\n gap = 1,\n wrap = false,\n inline = false,\n className,\n children,\n justify,\n grow,\n ...rest\n },\n ref\n ) => {\n const defaultAlign = direction === 'horizontal' ? 'center' : 'normal';\n const align = alignProp ?? defaultAlign;\n\n const gapX = Array.isArray(gap) ? gap[0] : (gap ?? 1);\n const gapY = Array.isArray(gap) ? gap[1] : (gap ?? 1);\n\n const gapClass = `gap-x-${gapX} gap-y-${gapY}`;\n\n return (\n \n {children}\n \n );\n }\n);\n","import { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\n/**\n * From https://github.com/radix-ui/primitives/blob/main/packages/react/use-controllable-state/src/useControllableState.tsx\n * This is used to support both having a controlled and uncontrolled state\n * in a component depending on what the consumer wants.\n */\n\ntype UseControllableStateParams = {\n prop?: T | undefined;\n defaultProp?: T | undefined;\n onChange?: (state: T) => void;\n};\n\ntype SetStateFn = (prevState?: T) => T;\n\nexport function useControllableState({\n prop,\n defaultProp,\n onChange = () => {}\n}: UseControllableStateParams) {\n const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n const handleChange = useCallbackRef(onChange);\n\n const setValue: React.Dispatch> =\n useCallback(\n (nextValue) => {\n if (isControlled) {\n const setter = nextValue as SetStateFn;\n const value =\n typeof nextValue === 'function'\n ? setter(prop)\n : nextValue;\n if (value !== prop) handleChange(value as T);\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, handleChange]\n );\n\n return [value, setValue] as const;\n}\n\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}: Omit, 'prop'>) {\n const uncontrolledState = useState(defaultProp);\n const [value] = uncontrolledState;\n const prevValueRef = useRef(value);\n const handleChange = useCallbackRef(onChange);\n\n useEffect(() => {\n if (prevValueRef.current !== value) {\n handleChange(value as T);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef, handleChange]);\n\n return uncontrolledState;\n}\n","/**\n OBSOLETE - use google tag manager service instead:\n src\\frontend\\services\\google-tagmanager-service.js\n\n * Ported from Applications/TouchWeb/src/legacy/static/app/ui/layout/google-tagmanager.js\n * Best way to import this module is `import * as Analytics from 'analytics'`\n */\n\nimport * as Sentry from '@sentry/react';\n\ntype WindowWithDataLayer = Window & {\n dataLayer: Record[];\n ga?: (\n command: string,\n eventName: string,\n category: string,\n variable?: string,\n value?: string,\n label?: string\n ) => void;\n};\n\ndeclare const window: WindowWithDataLayer;\n\ntype AnalyticsData = {\n category?: string;\n action?: string;\n label?: string;\n value?: string;\n hitCallback?: unknown[];\n userTriggered?: boolean;\n};\n\nexport const pushToDataLayer = (payload: Record) => {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push(payload);\n};\nexport const trackPageView = () =>\n window.ga\n ? window.ga('send', 'pageview', location.pathname)\n : pushToDataLayer({ event: 'trackPageview' });\nexport const isNonInteractive = (analyticsData: AnalyticsData) =>\n analyticsData.userTriggered === undefined\n ? true\n : !analyticsData.userTriggered;\n/**\n * trackTiming\n * @param {*} category\n * @param {*} variable\n * @param {*} value\n * @param {*} label\n */\nexport const trackTiming = (\n category: string,\n variable: string,\n value: string,\n label = ''\n) =>\n window.ga\n ? window.ga('send', 'timing', category, variable, value, label)\n : false;\n\n/**\n * Track Analytics Event\n */\nexport const trackEvent = (analyticsData: AnalyticsData) => {\n if (!analyticsData) {\n return;\n }\n pushToDataLayer({\n event: 'trackEvent',\n eventCategory: analyticsData.category || '',\n eventAction: analyticsData.action || '',\n eventLabel: analyticsData.label || '',\n eventValue: analyticsData.value || '0',\n eventNonInteractive: isNonInteractive(analyticsData),\n hitCallback: analyticsData.hitCallback || []\n });\n\n Sentry.addBreadcrumb({\n type: 'default',\n level: 'info',\n category: isNonInteractive(analyticsData) ? 'tracking' : 'ui-action',\n message: 'Analytics Event',\n data: analyticsData\n });\n};\n\n// Export object for Sinon stubbing\nexport default {\n pushToDataLayer,\n trackEvent,\n trackPageView,\n trackTiming\n};\n","import Analytics from 'packages/analytics';\nimport { logger } from 'packages/logger';\nimport locationUtils from 'tradera/utils/location';\nimport api from './api';\nimport { selectIsLoggedIn } from 'tradera/state/member/selectors';\n\n/**\n * Sets new preferred language\n * @param {string} code - example: 'sv' or 'en'\n */\nexport const setPreferredLanguage =\n (code, toLocalizedUrl) => async (dispatch, getState) => {\n Analytics.trackEvent({\n category: 'Settings',\n action: 'Language',\n label: code\n });\n\n try {\n if (selectIsLoggedIn(getState())) {\n await api.saveLanguageSetting(code, toLocalizedUrl);\n }\n locationUtils.reloadLocalized(code);\n } catch (error) {\n logger(error);\n }\n };\n","import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';\n\nexport const feesApi = createApi({\n reducerPath: 'feesApi',\n baseQuery: fetchBaseQuery({\n baseUrl: '/api/webapi/selling/commissionfee'\n }),\n endpoints: (builder) => ({\n // itemType and price does not affect the provision fee,\n // therefore we defaults to itemType `Auction` and price `1`\n getCommissionFee: builder.query({\n query: ({ categoryId }) =>\n `?categoryId=${categoryId}&itemType=Auction&price=1`\n })\n })\n});\n\nexport const { useGetCommissionFeeQuery } = feesApi;\n","import { createApi } from '@reduxjs/toolkit/query/react';\nimport type { MemberLatestPublishedListingApiResponse } from 'tradera/state/services/types/webapi-member-generated';\nimport { isomorphicWebApiBaseQuery } from 'tradera/state/services/utils/webapi-base-query';\n\nexport const memberLatestPublishedListingApi = createApi({\n reducerPath: 'memberLatestPublishedListing',\n baseQuery: isomorphicWebApiBaseQuery,\n endpoints: (builder) => ({\n getMemberLatestPublishedListing: builder.query<\n MemberLatestPublishedListingApiResponse,\n void\n >({\n query: () =>\n '/api/webapi/member/selling/member-latest-published-listing'\n })\n })\n});\n\nexport const { useGetMemberLatestPublishedListingQuery } =\n memberLatestPublishedListingApi;\n","import { createApi } from '@reduxjs/toolkit/query/react';\nimport { isServer } from 'tradera/utils/nextjs';\nimport { isomorphicWebApiBaseQuery } from 'tradera/state/services/utils/webapi-base-query';\nimport type {\n ValuationSearchRequest,\n ValuationSearchApiResponse\n} from './types/webapi-discover-generated';\n\nexport const valuationApi = createApi({\n reducerPath: 'valuationApi',\n baseQuery: isomorphicWebApiBaseQuery,\n endpoints: (builder) => ({\n getValuation: builder.query<\n ValuationSearchApiResponse,\n ValuationSearchRequest\n >({\n query: (params: ValuationSearchRequest) => {\n const baseUrl = isServer ? '' : '/api/webapi';\n const searchParams = new URLSearchParams(\n Object.entries(params)\n .filter(([, value]) => value != null)\n .map(([key, value]) => [key, value.toString()])\n );\n return `${baseUrl}/discover/valuation-search?${searchParams.toString()}`;\n }\n })\n })\n});\n\nexport const { useGetValuationQuery } = valuationApi;\n","import axios from 'axios';\n\nimport ENDPOINTS from 'tradera/constants/endpoints';\nimport { finalizeResponse, handleError, logError } from 'tradera/utils/api';\nimport { removeBannedCountries } from 'tradera/localization/countries';\n\nexport const fetchAvailableShippingCountries = () =>\n axios\n .get(ENDPOINTS.AVAILABLE_SHIPPING_COUNTRIES)\n .then(finalizeResponse())\n .then(({ data }) => ({\n shippingCountries: data.availableCountries\n .map((country) => ({\n countryCodeIso2: country.countryCodeIso2.toLowerCase(),\n countryNameEng: country.countryNameEng\n }))\n .filter(removeBannedCountries)\n }))\n .catch(handleError())\n .catch(logError);\n","export enum VIEW_ITEM_STATES {\n INITIALIZING = 'INITIALIZING',\n NOT_STARTED = 'NOT_STARTED',\n ACTIVE = 'ACTIVE',\n ENDING = 'ENDING',\n ENDED = 'ENDED'\n}\n\nexport enum ITEM_STATES {\n NOT_STARTED_AUCTION = 'NOT_STARTED_AUCTION',\n NOT_STARTED_AUCTION_BIN = 'NOT_STARTED_AUCTION_BIN',\n NOT_STARTED_FIXED_PRICE = 'NOT_STARTED_FIXED_PRICE',\n ONGOING_AUCTION = 'ONGOING_AUCTION',\n ONGOING_AUCTION_BIN = 'ONGOING_AUCTION_BIN',\n ONGOING_FIXED_PRICE = 'ONGOING_FIXED_PRICE',\n ENDED_AUCTION_WITHOUT_BID = 'ENDED_AUCTION_WITHOUT_BID',\n ENDED_AUCTION_WITH_WINNING_BID = 'ENDED_AUCTION_WITH_WINNING_BID',\n ENDED_AUCTION_SOLD_THROUGH_PURCHASE_OFFER = 'ENDED_AUCTION_SOLD_THROUGH_PURCHASE_OFFER',\n ENDED_AUCTION_WITHOUT_WINNING_BID = 'ENDED_AUCTION_WITHOUT_WINNING_BID',\n ENDED_AUCTION_BIN_BOUGHT_AS_BIN = 'ENDED_AUCTION_BIN_BOUGHT_AS_BIN',\n ENDED_AUCTION_BIN_SOLD_THROUGH_PURCHASE_OFFER = 'ENDED_AUCTION_BIN_SOLD_THROUGH_PURCHASE_OFFER',\n ENDED_PURE_BIN_SOLD_THROUGH_PURCHASE_OFFER = 'ENDED_PURE_BIN_SOLD_THROUGH_PURCHASE_OFFER',\n ENDED_FIXED_PRICE = 'ENDED_FIXED_PRICE',\n ENDED_CANCELLED = 'ENDED_CANCELLED',\n UNKNOWN = 'UNKNOWN'\n}\n"],"names":["MAX_SHORT_DESCRIPTION_LENGTH","defaultDrafts","isServer","_window$sellingGlobal","window","sellingGlobalData","getType","draft","hasOpeningPrice","isNullOrUndefined","openingBid","hasFixedPrice","fixedPrice","isPureBin","isAuctionBin","getDefaultTemplateValue","propertyName","_defaultDrafts$newTem","newTemplate","loadDefaultDraft","_objectSpread","newItem","allowedBuyerRegion","undefined","loadDefaultTemplateDraft","loadDraftFromTemplate","async","response","touchWebClient","post","templateId","draftWithoutItemId","itemId","resetUnwantedProperties","data","draftReason","saveDraft","Error","ensuredDraft","metadata","applicationId","ensureApplicationId","webApiClient","suggestionsThrottle","ThrottledAction","throttledFetchCategoryAttributeSuggestions","InputType","Button","Color","categoryId","shortDescription","dispatch","execute","action","fetchCategoryAttributeSuggestions","getState","environment","featureSwitches","splitTestGroup","splitTestGroups","splitTestEnabled","extractorType","getAttributeSuggestionExtractor","_response$data$attrib2","params","setCategoryAttributesSuggestions","suggestedAttributes","attributeValues","termAttributeValues","suggestionsExtractorType","autoFillSuggestedAttributes","error","type","splitTest","toLocaleLowerCase","ExtractorType","Code","Tradera","Google","userData","charities","canBeResumed","draftId","longDescription","images","hasShortDescription","trim","length","hasLongDescription","hasImage","Array","isArray","some","image","imageUrl","updateDraftCanBeResumed","getSyiSlice","setDraftCanBeResumed","setDisplayPromoted","displayPromoted","payload","feesActions","updatePrices","setDisplayHighlighted","displayHighlighted","setUsedAllowed","isAllowed","setItemConditionFromPrediction","condition","selectIsItemConditionDirty","oldValue","selectItemCondition","setHasUsedAutoFill","updateItemConditionRestrictionForCategory","itemCondition","isUsedAllowed","categoryRestriction","syi","allowUsed","featureFees","state","price","reservePrice","push","PossibleFeatures","extraFeatures","highlight","rankUp","fetchOffsitePaymentDetection","createAsyncThunk","request","_ref","selectIsFeatureEnabled","fetchClassificationFromFirstImage","imageId","trackSyiForm","eventName","parameters","draft_id","get","qs","fetchPredictionsFromImages","_","_ref2","languageCodeIso2","selectPreferredLanguageCode","existingShortDescription","selectShortDescription","existingLongDescription","selectLongDescription","isModalFeatureToggleEnabled","itemClassification","selectClassificationResponse","imageIds","selectImageIds","selectDraftId","setPredictedShortDescription","setShouldSuggestShortDescription","setHasUsedPredictedDescription","setShortDescription","setPredictedLongDescription","setShouldSuggestLongDescription","setLongDescription","setNumProcessedImages","numProcessedImages","setAiProcessingTime","aiProcessingTime","_ref4","_ref5","isCompany","setIsPureBinSelectedFromPrediction","itemType","ItemTypes","PURE_BIN","setReservePrice","setReservePriceReducer","setIsPureBinSelected","isPureBinSelected","setIsPureBinSelectedReducer","setOpeningBid","setAuctionBinPrice","setCustomEndTime","setFixedPrice","isDirty","selectIsPureBinSelected","syiShippingApi","createApi","reducerPath","baseQuery","isomorphicWebApiBaseQuery","endpoints","builder","getShippingProducts","query","ITEM_TYPE","BIN","AUCTION","AUCTION_AND_BIN","Tags","draftsApi","tagTypes","Object","keys","deleteDrafts","mutation","invalidatesTags","DRAFT_LIST","url","method","body","loadDrafts","providesTags","transformResponse","_response$items","items","filter","item","_item$images","find","useDeleteDraftsMutation","useLoadDraftsQuery","util","initialState","categoryAttributes","draftAttributes","selectableSuggestedAttributes","selectableCategorySuggestedAttributes","selectableImageToColorSuggestedAttributes","imageToColorSuggestedAttributes","validationErrors","categorySuggestedAttributes","updateSelectableImageToColorSuggestedAttributes","filterSelectableSuggestions","updateSelectableSuggestedAttributes","filterCombinedSelectableSuggestions","attributeSlice","createSlice","name","reducers","validate","forEach","attribute","_state$selectableSugg","_state$selectableSugg2","_state$selectableSugg3","options","option","isActive","includes","id","suggestedAttributeValues","suggested","values","slice","maxNumberOfValues","map","value","numberOfValuesSelected","setImageToColorSuggestions","setCategoryAttributeOption","a","attributeId","isMultiSelect","optionValue","activate","o","updateCategoryAttributesOptionsStatuses","_state$draftAttribute","_state$draftAttribute2","_a$options","_a$options2","draftAttributeValues","tav","setDraftAttributes","setCategoryAttributes","resetAttributes","resetSelectedAttributes","_attribute$options","resetImageAttributeSuggestions","_attribute$options2","_attribute$options3","minNumberOfValues","reduce","acc","backingField","actions","reducer","buyerRegionSlice","initModuleGlobals","_initData$featureSwit","initData","pageSpecificData","allowedBuyerRegions","availableAllowedBuyerRegions","defaultBuyerRegion","r","selectedBuyerRegion","selectedBuyerRegionText","text","availableAllowedBuyerRegionsForEditWithBids","isSetAllowedBuyerRegionToAtLeastEuEnabled","setAllowedBuyerRegion","setAvailableAllowedBuyerRegions","availableRegions","draftCategoryId","validationError","categorySlice","draftCategoryPath","resetCategory","setDraftCategory","categoryPath","_categorySlice$action","windowExists","isNewDraft","_window$location","location","_window$location$path","pathname","endsWith","queryParams","URLSearchParams","_window$location2","search","queryParamCharityId","preselectCharity","anonymous","charityId","Number","description","logoUrl","percentageToDonate","forceFreeShipping","isFreeShippingPaidByProvider","freeShippingPaidByProviderName","charitySlice","setCharityId","setCharityInfo","_ref2$payload","setCharityAnonymous","_ref3","setCharityFromDraft","resetCharity","setCharityShippingInfo","_charitySlice$actions","isLoading","additionalDescriptions","draftSlice","setDraftProperties","_draft$reference$incl","_draft$reference","referenceIsReadonly","reference","JSON","stringify","lastModifiedDate","dayjs","toISOString","assign","pick","setDraftId","setRestart","restart","disableRestart","setReference","addAdditionalDescription","newAdditionalDescriptions","message","setDraftReason","ensureDraftReason","setDraftVersion","version","resetDraft","setDraftIsLoading","setCurrency","currency","setResellPartner","resellPartner","setMagicalSyiEnabled","magicalSyiEnabled","_draftSlice$actions","editSlice","draftBeforeChange","setDraftBeforeChange","MAX_NUMBER_OF_IMAGES","config","isSyiTenImagesEnabled","ITEM_CLASSIFICATIONS_FOR_PREDICTION","setValidation","uploadingCount","every","isUploadedBySystem","resetUploadError","uploadError","imagesSlice","isUploadingWithApp","setDraftImages","draftImage","rotationDegrees","isListingImage","listingImage","imageGroupId","filename","addImage","_action$payload","replaceImage","_action$payload2","index","removeImage","splice","changeImagePosition","_action$payload3","from","to","movedImage","setImageRotation","_action$payload4","setImageUploadFailed","errorMessage","setImagesUploading","numberOfImages","setMobileUpload","extraReducers","addCase","hideAllErrors","_imagesSlice$actions","getValidationErrors","durationDays","allowZeroDayAuctions","customEndTime","customEndTimeError","endDate","getEndDate","startOf","add","_customEndTime$split$2","_slicedToArray","split","hours","minutes","hour","minute","earliestEndDate","isBefore","isRestartAvailable","_userData$defaultDraf","_userData$defaultDraf2","itemDurationSlice","setDurationDays","isChangeItem","_state$durationDays","resetDurationAndEndTime","draftService","newState","newStateWithoutCampaignRelatedProps","resetCustomEndTime","disableZeroDayAuctions","_state$durationDays2","enableZeroDayAuctions","enableRestart","_itemDurationSlice$ac","textWithHtml","elm","document","createElement","innerHTML","textContent","innerText","ensureString","s","longDescriptionSlice","isCurrentDescriptionFromDraft","fromDraftCounter","isOffsitePaymentDetected","setLongDescriptionFromDraft","resetLongDescription","fulfilled","_longDescriptionSlice","setValidationError","createInitalState","consent","braintree","shouldBypassConsent","signatoryVerificationRequired","shouldGiveConsent","isSyiMemberConsentEnabled","hasTraderaPayConsent","needsConsentOfTraderaPayAgreement","hasValidationError","isUnderLicense","initalConsentGiven","memberConsentSlice","setTraderaPayConsent","hasAutoFillConsent","isLoadingPredictions","classification","canGetPredictionFromImages","isClassificationPending","hasUsedAutoFill","hasUsedPredictedDescription","predictionsSlice","shouldSuggestShortDescription","shouldSuggestLongDescription","setHasAutoFillConsent","pending","Other","rejected","_predictionsSlice$act","isValidPrice","number","str","String","isFinite","parseInt","indexOf","isInt","isNaN","validateFixedPrice","validateOpeningBid","auctionBinPrice","isAuctionBinSelected","validateAuctionBinPrice","showReservePrice","validateReservePrice","key","_window","toIntOrNull","numberOrString","showCharityDonation","Boolean","editCharity","selectableVats","selectableVatValues","reservePriceCanChangeButNotBeRemoved","vat","reservePriceCost","selectedItemType","priceSlice","validated","setReservePriceVisibility","setCharityDonationVisibility","setEditCharity","setIsAuctionBinSelected","setVat","setSelectedItemType","resetPricesAndVat","setReservePriceCanChangeButNotBeRemoved","_priceSlice$actions","errors","offerTakeaway","offerShipping","globalValidationError","global","offersFreeShipping","shippingOptions","shippingOption","cost","selectedShippingOptions","selectedShippingSize","shippingOptionsLoading","shippingOptionsError","fromCountry","packagingCost","shippingByWeightGroupedBySizes","decoratedShippingProducts","shippingContainsTakeaway","shippingContainsNonTakeaway","mapToDecoratedShippingProduct","shippingProduct","productId","providerId","uuid","uuidv4","shippingSlice","resetSelectedShippingOptions","setShippingOptionsByWeight","productsPerWeightSpanAndSize","_productsPerWeightSpa","flatMap","weightClass","_weightClass$products","productsBySize","size","products","x","flatMapProductsPerWeightSpanAndSizeToDecoratedShippingProducts","getSelectedShippingOptions","autoSelectShippingOptions","_state$shippingByWeig","autoSelectedWeight","autoSelect","_autoSelectedWeight$p","autoSelectedSize","_autoSelectedSize$siz","_autoSelectedSize$pro","_autoSelectedSize$pro2","sizeCategory","p","setShippingOptionsLoading","setShippingOptionSelected","selectedOptions","getSelectedShippingProducts","setSelectedShippingSize","setPackagingCost","setTakeawaySelected","setShippingOptionsError","setShippingFromCountry","_shippingSlice$action","descriptionLanguageCodeIso2","isDescriptionLanguageCodeIso2ChangeAvailable","memberCountryCodeIso2","isDenmarkCountryCode","getValidationError","shortDescriptionSlice","resetShortDescription","setDescriptionLanguageCodeIso2","_shortDescriptionSlic","creationStart","allErrorsVisible","isEditOfPublishedItem","publishPending","publishFailed","publishFailedReasonDisplayText","publishedItemPendingVip","publishedItem","openModal","openModalData","autoSaveEnabled","draftCanBeResumed","itemUpdating","itemUpdated","isDraftSaved","publishDelayed","fadeUi","syiSlice","resetSyi","setCreationStart","showAllErrors","setIsEditOfPublishedItem","setPublishedItemPendingVip","setPublishedItemDelayed","setPublishedItem","setPublishFailed","setPublishPending","setCategoryRestriction","toggleModal","enableAutoSave","disableAutoSave","setItemUpdating","setItemUpdated","setIsDraftSaved","setFadeUi","_syiSlice$actions","templateReducer","savePending","saveFailed","ignoreProperties","setSavePending","setSaveFailed","resetIgnoreProperties","addIgnoreProperties","Set","removeIgnoreProperties","prop","_templateReducer$acti","createSelector","imageCount","predictions","views","templatesApi","deleteTemplate","TEMPLATES_LIST","loadTemplates","useDeleteTemplateMutation","useLoadTemplatesQuery","getAmountDetails","itemState","leadingBid","hasBids","finalPrice","paymentAmountForBid","paymentAmountForFixedPrice","ITEM_STATES","ENDED_AUCTION_WITH_WINNING_BID","title","amount","amountIncludingBuyerProtection","Space","polyRef","forwardRef","ref","_ref$as","as","Component","_ref$direction","direction","alignProp","align","_ref$gap","gap","_ref$wrap","wrap","_ref$inline","inline","className","children","justify","grow","rest","_objectWithoutProperties","_excluded","gapClass","_jsx","classNames","useControllableState","defaultProp","_ref$onChange","onChange","_useUncontrolledState","uncontrolledState","useState","prevValueRef","useRef","handleChange","useCallbackRef","useEffect","current","useUncontrolledState","_useUncontrolledState2","uncontrolledProp","setUncontrolledProp","isControlled","setValue","useCallback","nextValue","pushToDataLayer","dataLayer","isNonInteractive","analyticsData","userTriggered","trackEvent","event","eventCategory","category","eventAction","eventLabel","label","eventValue","eventNonInteractive","hitCallback","Sentry","level","trackPageView","ga","trackTiming","variable","arguments","setPreferredLanguage","code","toLocalizedUrl","Analytics","selectIsLoggedIn","api","locationUtils","logger","feesApi","fetchBaseQuery","baseUrl","getCommissionFee","useGetCommissionFeeQuery","memberLatestPublishedListingApi","getMemberLatestPublishedListing","useGetMemberLatestPublishedListingQuery","valuationApi","getValuation","entries","toString","useGetValuationQuery","fetchAvailableShippingCountries","axios","ENDPOINTS","AVAILABLE_SHIPPING_COUNTRIES","then","finalizeResponse","shippingCountries","availableCountries","country","countryCodeIso2","toLowerCase","countryNameEng","removeBannedCountries","catch","handleError","logError"],"sourceRoot":""}