<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Brushyourideas\Photoprint\Api\ImageSizeRepositoryInterface"
                type="Brushyourideas\Photoprint\Model\ImageSizeRepository"/>
    <preference for="Brushyourideas\Photoprint\Api\Data\ApiResponseInterface"
                type="Brushyourideas\Photoprint\Model\ApiResponse"/>
    <type name="Brushyourideas\Productdesigner\Api\BusinessApiInterface">
        <plugin name="brushyourideas_photoprint_allowed_max_quantity"
                type="Brushyourideas\Photoprint\Plugin\AddAllowedMaxQuantity"
                sortOrder="10"/>
    </type>
    <!-- Photoprint output is rasterised in GD, which can't read SVG. AI/EPS/PDF are already
         converted to PNG by the core upload helper; convert SVG to PNG for photoprint too so
         the card/listing/output all work on a raster source. Covers desktop + mobile uploads. -->
    <type name="Printxpand\Core\Helper\ImageUploadHelper">
        <plugin name="brushyourideas_photoprint_convert_svg_to_png"
                type="Brushyourideas\Photoprint\Plugin\ConvertPhotoprintSvgToPng"
                sortOrder="10"/>
    </type>
    <!-- Photoprint output can't go through node; generate it in PHP. -->
    <type name="Printxpand\Core\Queue\Consumer">
        <plugin name="brushyourideas_photoprint_route_output"
                type="Brushyourideas\Photoprint\Plugin\RoutePhotoprintOutput"
                sortOrder="10"/>
    </type>
    <!-- Slim override (only processCartData); needed because saveDesigns() calls it
         internally via $this->, which plugins cannot intercept. -->
    <preference for="Brushyourideas\Productdesigner\Helper\DesignHelper"
                type="Brushyourideas\Photoprint\Rewrite\DesignHelper"/>
    <type name="Brushyourideas\Productdesigner\Helper\DesignHelper">
        <plugin name="brushyourideas_photoprint_save_details"
                type="Brushyourideas\Photoprint\Plugin\SavePhotoprintDetails"
                sortOrder="10"/>
    </type>
</config>
