�PNG  IHDR22?�� pHYs  �� OiCCPPhotoshop ICC profilexڝSgTS�=���BK���KoR RB���&*! J�!��Q�EEȠ�����Q, � ��!���������{�kּ������>���� �H3Q5� �B�������.@� $p�d!s�#�~<<+"��x� �M��0���B�\���t�8K�@z�B�@F���&S�`�cb�P-`'������{[�!�� e�Dh;��V�EX0fK�9�-0IWfH���� � 0Q��){`�##x��F�W<�+��*x��<�$9E�[-qWW.(�I+6aa�@.�y�2�4���������x����6��_-��"bb���ϫp@�t~��,/��;�m��%�h^ �u��f�@����W�p�~<�5�j>{�-�]c�K'Xt����o��(�h���w��?�G�%�fI�q^D$.Tʳ?�D��*�A��,���� �`6�B$��BB d�r`)��B(�Ͱ*`/�@4�Qh��p.�U�=p�a��(�� A�a!ڈb�X#����!�H�$ ɈQ"K�5H1R�T UH�=r9�\F��;�2����G1���Q=� �C��7�F� �dt1�����r�=�6��Ыhڏ>C�0��3�l0.��B�8, �c˱"� ���V����cϱw�E� 6wB aAHXLXN�H� $4� 7 �Q�'"��K�&���b21�XH,#��/{�C�7$�C2'��I��T��F�nR#�,��4H#���dk�9�, +ȅ����3��!�[ �b@q��S�(R�jJ��4�e�2AU��Rݨ�T5�ZB���R�Q��4u�9̓IK�����hh�i��t�ݕN��W���G���w ��Ljg(�gw��L�Ӌ�T071���oUX*�*|�� �J�&�*/T����ު U�U�T��^S}�FU3S� Ԗ�U��P�SSg�;���g�oT?�~Y��Y�L�OC�Q��_�� c�x,!k ��u�5�&���|v*�����=���9C3J3W�R�f?�q��tN �(���~���)�)�4L�1e\k����X�H�Q�G�6������E�Y��A�J'\'Gg����S�Sݧ �M=:��.�k���Dw�n��^��Lo��y���}/�T�m���G X� $� �<�5qo</���QC]�@C�a�a�ᄑ��<��F�F�i�\�$�m�mƣ&&!&KM�M�RM��)�;L;L���͢�֙5�=1�2��כ߷`ZxZ,����eI��Z�Yn�Z9Y�XUZ]�F���%ֻ�����N�N���gð�ɶ�����ۮ�m�}agbg�Ů��}�}��= ���Z~s�r:V:ޚΜ�?}����/gX���3��)�i�S��Ggg�s�󈋉K��.�>.���Ƚ�Jt�q]�z���������ۯ�6�i�ܟ�4�)�Y3s���C�Q��? ��0k߬~OCO�g��#/c/�W�װ��w��a�>�>r��>�<7�2�Y_�7��ȷ�O�o�_��C#�d�z����%g��A�[��z|!��?:�e����A���AA�������!h�쐭!��Α�i�P~���a�a��~ '���W�?�p�X�1�5w��Cs�D�D�Dޛg1O9�-J5*>�.j<�7�4�?�.fY��X�XIlK9.*�6nl������� �{�/�]py�����.,:�@L�N8��A*��%�w%� y��g"/�6ш�C\*N�H*Mz�쑼5y$�3�,幄'���L Lݛ:��v m2=:�1����qB�!M��g�g�fvˬe����n��/��k���Y- �B��TZ(�*�geWf�͉�9���+��̳�ې7�����ᒶ��KW-X潬j9�������(�x��oʿ�ܔ���Ĺd�f�f���-�[����n �ڴ �V����E�/��(ۻ��C���<��e����;?T�T�T�T6��ݵa��n��{��4���[���>ɾ�UUM�f�e�I���?�������m]�Nmq����#�׹���=TR��+�G�����w- 6 U����#pDy��� �� :�v�{���vg/jB��F�S��[b[�O�>����z�G��499�?r����C�d�&����ˮ/~�����јѡ�򗓿m|������������x31^�V���w�w��O�| (�h���SЧ��������c3-� cHRMz%������u0�`:�o�_�F5IDATx��ytUս�?�;���fN$$��@B�!�k��� -*�gE���j�O�kQ�ʠ`U�B_ �AÐ0%�Ȕ�@r3ޛ;߳��$�@��v����^�s����������$��ߢ !�W��5�̱'-٘������4�>�Rƫ$�G��0U�H}�_ _� #��k�MJ/=�9Du *ڲ�k�PQ;0��j|�*�$�^컂脛y���>�z×� B��� ��(�:$�ʔ_�6��C!B����MVx��a��ζyY����j��ƋY2�9�F�{r��r�딟F��Q��hY6��� x��[l��RC��������nt@��;P��3��� F�w��7��:�P���ɋ'���mj���Bƪ�$�Q�L��y��߷g��\���z����v5�p�v$�v櫻�`6~K �Y�X����,�:��"�o�e0II"(��,������l_�C���/4�+f�E�!q��:����u����c��樼.UE�@� �]K�W���$-�h]�JG���Dz)�`��.�A/ ���mᏣc�3jK� �!�>���$�Q�!�_�? \�C2(E �M$Z I{�U���s�ǣ���=��@Բe ޻��W�����@ �w����}�9v,)��.}*|"�s��di���,���G�]W�AC�������|<����[��ߕ������K�*�G nߴ!��‹��J�!��6(L�a)��Am��������;adf��:�xm��nh�;֦I��(���o�C~ډa?�=��s����h��E������xp����)���_���t��W�����´;8���`dz=(��@@�+,�;�`�fhl��XȌ�3,uI�~z(J����� �ZX�A����H'�À�㜦�82|��a�n�z2��I���� ���EY�h�ε<�0�q�{��C��v�˅��?"@��χ�x�WS+��N�~�KQ�J�8ل�� _.W��� !TU{�����,��"�� �;�������HI S� ��))�o�1�H�D� ���� (� ;����"Ҕ��,���� �F=���O��&�Ph>�`���y��߲ &S��P�<��'��1s�1cĂ�N����2)����@�u��tv��<�+�-&�����h��[!FSG���' � z z0��<����8d&�����E0�,��<��"!P�b4��� �{S�����X����.�囤���T��hEF��X�q0"-<����h���]�Py*����F⩍��@v�˂�Y08�� .q��a��s����(!<̫1�3�L�H��7sYW�`��qtu�\7��?�@�Y�� %Ka�x�GZ�*W�P��y�����N0r9��Z�c�%���q,��k�����!!,��>���IB��� �x1�Xu�Y���v-���ֺ��N������JP��a�2`�e5��w��u;�6�i���̃��(K���ťa��(l51��JL��O'%���]���ٖ뿉!��{*�p+f ���i8��D�ȑ���ܩ�M��V��ӟz��x�7Z�1i}�^͜���6e����x��)u�d�ˏ�V�eG�\�X1�����=n�U'�~Y����L�\,�(d!x ,�:�TW8� M`r���@��r+v�Q0��>^;˴�VbF��('����� �*O��i��j�Ӆ����^�S3&� ���{������.ی�� N;��NU%d0�Ce\r"�C�b��&t7N�7��� �ȪD�[%l�۪�$��'m?�A9tI�9>��NVL ��� 6v~M�����ъ�B���0����9$&=ώm��W�0���L���&��E���f�f��'+�9��hv��7,���M��6�D�&�^� �����8 D֮�����o��k^z��O��hP�8q�5d*��YVq3�{��������#LX4�?��jP=3�~�؅c�ݰ�̱�ұ��8̲��2�G�����j��έ�9��w7���U�X�w�85C��?!I&���o&����L���I#�^�eV�,�^t5�k� �xs˛\��U�8��."���{���ǵ�l4��ݼ�;��r"���G�/~���gJV�N糦��ZZ^k+NN�D��I$�=OE�z����|*�*{��%k���G��>�`9��b;�s���8,�qs��c��.b��q�%�>r��n�R�Ƨ�%�,�A��le#�8���}; 21�0�b�&�QX�f���q�00����$>�h�N�'�a3��A���/�r ��L5�8�GԲ'�����w;��c#�q1���h$*��V^�k��QĽ�b:i������� ����H F#�_���,��]g����Ը����`RUU���� ��"�qD���>-��ϤI�~��3�̴�����NZ[[555�eeek7�m����YF#[��Đ��R��i��L�H�r ��@��J-�Pŝ��_|�-��6y��ks�V�U~��6���w.����(��0A� 4��f��� /���C�xŊ�ٳ����z=6�����rg���mKo��o�/����a�g���?'9%9��P��斓��~���L{�� �H��{AW��B��$����v�1b�&Mb�ر��ر#�0`�`xMBp! )Z�Nmo�mZ�g�}�eذaWTVV ���'99��C5��&�&+5�bT>|8��PUUETT����&���t��~TE%��'������b�tEGG;RSS�S�N�v��ѯ��t����u1@�ޚ"f��͈���r'L�Ph��m��ƌ�74o��`�x�q�P���NRSS�X,�����l&&&��MFFA!-��`��ҷ�n��Yuu�����x<I�LB%����KԒ50�!�3�bz�����ʸKL���;---�l6[��`��������Ȏ;�����egg4��!D�T��jWujyZ��������K����%����p�^���X,6��sV=�ܖ����6�3�X ���4ҿ��A2�&����_k�;d�� �VfOIEND�B`�
Warning: session_start(): Session cannot be started after headers have already been sent in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 124

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 131

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 132

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 133

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 134

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 135

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 547

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 548

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 549

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 550

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 551
/* global woocommerce_admin */ ( function ( $, woocommerce_admin ) { $( function () { if ( 'undefined' === typeof woocommerce_admin ) { return; } // Toggle #wc-lost-connection-notice via WP core's heartbeat events (see WC_Admin_Assets::render_lost_connection_notice()). if ( woocommerce_admin.show_lost_connection_notice ) { $( document ) .on( 'heartbeat-connection-lost.wc-lost-connection-notice', function ( event, error, status ) { if ( 'timeout' === error || 603 === status ) { $( '#wc-lost-connection-notice' ).show(); } } ) .on( 'heartbeat-connection-restored.wc-lost-connection-notice', function () { $( '#wc-lost-connection-notice' ).hide(); } ); } // Add buttons to product screen. var $product_screen = $( '.edit-php.post-type-product' ), $title_action = $product_screen.find( '.page-title-action:first' ), $blankslate = $product_screen.find( '.woocommerce-BlankState' ); if ( 0 === $blankslate.length ) { if ( woocommerce_admin.urls.add_product ) { $title_action .first() .attr( 'href', woocommerce_admin.urls.add_product ); } if ( woocommerce_admin.urls.export_products ) { const exportLink = document.createElement('a'); exportLink.href = woocommerce_admin.urls.export_products; exportLink.className = 'page-title-action'; exportLink.textContent = woocommerce_admin.strings.export_products; $title_action.after(exportLink); } if ( woocommerce_admin.urls.import_products ) { const importLink = document.createElement('a'); importLink.href = woocommerce_admin.urls.import_products; importLink.className = 'page-title-action'; importLink.textContent = woocommerce_admin.strings.import_products; $title_action.after(importLink); } } else { $title_action.hide(); } // Progress indicators when showing steps. $( '.woocommerce-progress-form-wrapper .button-next' ).on( 'click', function () { $( '.wc-progress-form-content' ).block( { message: null, overlayCSS: { background: '#fff', opacity: 0.6, }, } ); return true; } ); // Field validation error tips $( document.body ) .on( 'wc_add_error_tip', function ( e, element, error_type ) { var offset = element.position(); if ( element.parent().find( '.wc_error_tip' ).length === 0 ) { element.after( '
' + woocommerce_admin[ error_type ] + '
' ); element .parent() .find( '.wc_error_tip' ) .css( 'left', offset.left + element.width() - element.width() / 2 - $( '.wc_error_tip' ).width() / 2 ) .css( 'top', offset.top + element.height() ) .fadeIn( '100' ); } } ) .on( 'wc_remove_error_tip', function ( e, element, error_type ) { element .parent() .find( '.wc_error_tip.' + error_type ) .fadeOut( '100', function () { $( this ).remove(); } ); } ) .on( 'click', function () { $( '.wc_error_tip' ).fadeOut( '100', function () { $( this ).remove(); } ); } ) .on( 'blur', '.wc_input_decimal[type=text], .wc_input_price[type=text], .wc_input_country_iso[type=text]', function () { $( '.wc_error_tip' ).fadeOut( '100', function () { $( this ).remove(); } ); } ) .on( 'change', '.wc_input_price[type=text], .wc_input_decimal[type=text], .wc-order-totals #refund_amount[type=text], ' + '.wc_input_variations_price[type=text]', function () { var regex, decimalRegex, decimailPoint = woocommerce_admin.decimal_point; if ( $( this ).is( '.wc_input_price' ) || $( this ).is( '.wc_input_variations_price' ) || $( this ).is( '#refund_amount' ) ) { decimailPoint = woocommerce_admin.mon_decimal_point; } regex = new RegExp( '[^-0-9%\\' + decimailPoint + ']+', 'gi' ); decimalRegex = new RegExp( '\\' + decimailPoint + '+', 'gi' ); var value = $( this ).val(); var newvalue = value .replace( regex, '' ) .replace( decimalRegex, decimailPoint ); if ( value !== newvalue ) { $( this ).val( newvalue ); } } ) .on( 'keyup', // eslint-disable-next-line max-len '.wc_input_price[type=text], .wc_input_decimal[type=text], .wc_input_country_iso[type=text], .wc-order-totals #refund_amount[type=text], .wc_input_variations_price[type=text]', function () { var regex, error, decimalRegex; var checkDecimalNumbers = false; if ( $( this ).is( '.wc_input_price' ) || $( this ).is( '.wc_input_variations_price' ) || $( this ).is( '#refund_amount' ) ) { checkDecimalNumbers = true; regex = new RegExp( '[^-0-9%\\' + woocommerce_admin.mon_decimal_point + ']+', 'gi' ); decimalRegex = new RegExp( '[^\\' + woocommerce_admin.mon_decimal_point + ']', 'gi' ); error = 'i18n_mon_decimal_error'; } else if ( $( this ).is( '.wc_input_country_iso' ) ) { regex = new RegExp( '([^A-Z])+|(.){3,}', 'im' ); error = 'i18n_country_iso_error'; } else { checkDecimalNumbers = true; regex = new RegExp( '[^-0-9%\\' + woocommerce_admin.decimal_point + ']+', 'gi' ); decimalRegex = new RegExp( '[^\\' + woocommerce_admin.decimal_point + ']', 'gi' ); error = 'i18n_decimal_error'; } var value = $( this ).val(); var newvalue = value.replace( regex, '' ); // Check if newvalue have more than one decimal point. if ( checkDecimalNumbers && 1 < newvalue.replace( decimalRegex, '' ).length ) { newvalue = newvalue.replace( decimalRegex, '' ); } if ( value !== newvalue ) { $( document.body ).triggerHandler( 'wc_add_error_tip', [ $( this ), error, ] ); } else { $( document.body ).triggerHandler( 'wc_remove_error_tip', [ $( this ), error, ] ); } } ) .on( 'change', '#_sale_price.wc_input_price[type=text], .wc_input_price[name^=variable_sale_price]', function () { var sale_price_field = $( this ), regular_price_field; if ( sale_price_field .attr( 'name' ) .indexOf( 'variable' ) !== -1 ) { regular_price_field = sale_price_field .parents( '.variable_pricing' ) .find( '.wc_input_price[name^=variable_regular_price]' ); } else { regular_price_field = $( '#_regular_price' ); } var sale_price = parseFloat( window.accounting.unformat( sale_price_field.val(), woocommerce_admin.mon_decimal_point ) ); var regular_price = parseFloat( window.accounting.unformat( regular_price_field.val(), woocommerce_admin.mon_decimal_point ) ); if ( sale_price >= regular_price ) { $( this ).val( '' ); } } ) .on( 'keyup', '#_sale_price.wc_input_price[type=text], .wc_input_price[name^=variable_sale_price]', function () { var sale_price_field = $( this ), regular_price_field; if ( sale_price_field .attr( 'name' ) .indexOf( 'variable' ) !== -1 ) { regular_price_field = sale_price_field .parents( '.variable_pricing' ) .find( '.wc_input_price[name^=variable_regular_price]' ); } else { regular_price_field = $( '#_regular_price' ); } var sale_price = parseFloat( window.accounting.unformat( sale_price_field.val(), woocommerce_admin.mon_decimal_point ) ); var regular_price = parseFloat( window.accounting.unformat( regular_price_field.val(), woocommerce_admin.mon_decimal_point ) ); if ( sale_price >= regular_price ) { $( document.body ).triggerHandler( 'wc_add_error_tip', [ $( this ), 'i18n_sale_less_than_regular_error', ] ); } else { $( document.body ).triggerHandler( 'wc_remove_error_tip', [ $( this ), 'i18n_sale_less_than_regular_error' ] ); } } ) .on( 'keyup', 'input[type=text][name*=_global_unique_id]', function () { // X/x is only valid as the final ISBN-10 check digit (ISO 2108). if ( ! /^[0-9\-]*[0-9Xx]?$/.test( $( this ).val() ) ) { $( document.body ).triggerHandler( 'wc_add_error_tip', [ $( this ), 'i18n_global_unique_id_error', ] ); } else { $( document.body ).triggerHandler( 'wc_remove_error_tip', [ $( this ), 'i18n_global_unique_id_error' ] ); } } ) .on( 'change', 'input[type=text][name*=_global_unique_id]', function () { var cleaned = $( this ) .val() .replace( /[^0-9Xx\-]/g, '' ) .replace( /^-+|-+$/g, '' ); $( this ).val( cleaned ); if ( ! /^[0-9\-]*[0-9Xx]?$/.test( cleaned ) ) { $( document.body ).triggerHandler( 'wc_add_error_tip', [ $( this ), 'i18n_global_unique_id_error', ] ); } else { $( document.body ).triggerHandler( 'wc_remove_error_tip', [ $( this ), 'i18n_global_unique_id_error' ] ); } } ) .on( 'init_tooltips', function () { $( '.tips, .help_tip, .woocommerce-help-tip' ).tipTip( { attribute: 'data-tip', fadeIn: 50, fadeOut: 50, delay: 200, keepAlive: true, } ); $( '.column-wc_actions .wc-action-button' ).tipTip( { fadeIn: 50, fadeOut: 50, delay: 200, } ); // Add tiptip to parent element for widefat tables $( '.parent-tips' ).each( function () { $( this ) .closest( 'a, th' ) .attr( 'data-tip', $( this ).data( 'tip' ) ) .tipTip( { attribute: 'data-tip', fadeIn: 50, fadeOut: 50, delay: 200, keepAlive: true, } ) .css( 'cursor', 'help' ); } ); } ) .on( 'click', '.wc-confirm-delete', function ( event ) { if ( ! window.confirm( woocommerce_admin.i18n_confirm_delete ) ) { event.stopPropagation(); } } ); // Tooltips $( document.body ).trigger( 'init_tooltips' ); // wc_input_table tables $( '.wc_input_table.sortable tbody' ).sortable( { items: 'tr', cursor: 'move', axis: 'y', scrollSensitivity: 40, forcePlaceholderSize: true, helper: 'clone', opacity: 0.65, placeholder: 'wc-metabox-sortable-placeholder', start: function ( event, ui ) { ui.item.css( 'background-color', '#f6f6f6' ); }, stop: function ( event, ui ) { ui.item.removeAttr( 'style' ); }, } ); // Focus on inputs within the table if clicked instead of trying to sort. $( '.wc_input_table.sortable tbody input' ).on( 'click', function () { $( this ).trigger( 'focus' ); } ); $( '.wc_input_table .remove_rows' ).on( 'click', function () { var $tbody = $( this ).closest( '.wc_input_table' ).find( 'tbody' ); if ( $tbody.find( 'tr.current' ).length > 0 ) { var $current = $tbody.find( 'tr.current' ); $current.each( function () { $( this ).remove(); } ); } return false; } ); var controlled = false; var shifted = false; var hasFocus = false; $( document.body ).on( 'keyup keydown', function ( e ) { shifted = e.shiftKey; controlled = e.ctrlKey || e.metaKey; } ); $( '.wc_input_table' ) .on( 'focus click', 'input', function ( e ) { var $this_table = $( this ).closest( 'table, tbody' ); var $this_row = $( this ).closest( 'tr' ); if ( ( e.type === 'focus' && hasFocus !== $this_row.index() ) || ( e.type === 'click' && $( this ).is( ':focus' ) ) ) { hasFocus = $this_row.index(); if ( ! shifted && ! controlled ) { $( 'tr', $this_table ) .removeClass( 'current' ) .removeClass( 'last_selected' ); $this_row .addClass( 'current' ) .addClass( 'last_selected' ); } else if ( shifted ) { $( 'tr', $this_table ).removeClass( 'current' ); $this_row .addClass( 'selected_now' ) .addClass( 'current' ); if ( $( 'tr.last_selected', $this_table ).length > 0 ) { if ( $this_row.index() > $( 'tr.last_selected', $this_table ).index() ) { $( 'tr', $this_table ) .slice( $( 'tr.last_selected', $this_table ).index(), $this_row.index() ) .addClass( 'current' ); } else { $( 'tr', $this_table ) .slice( $this_row.index(), $( 'tr.last_selected', $this_table ).index() + 1 ) .addClass( 'current' ); } } $( 'tr', $this_table ).removeClass( 'last_selected' ); $this_row.addClass( 'last_selected' ); } else { $( 'tr', $this_table ).removeClass( 'last_selected' ); if ( controlled && $( this ).closest( 'tr' ).is( '.current' ) ) { $this_row.removeClass( 'current' ); } else { $this_row .addClass( 'current' ) .addClass( 'last_selected' ); } } $( 'tr', $this_table ).removeClass( 'selected_now' ); } } ) .on( 'blur', 'input', function () { hasFocus = false; } ); // Additional cost and Attribute term tables $( '.woocommerce_page_wc-settings .shippingrows tbody tr:even, table.attributes-table tbody tr:nth-child(odd)' ).addClass( 'alternate' ); // Show order items on orders page $( document.body ).on( 'click', '.show_order_items', function () { $( this ).closest( 'td' ).find( 'table' ).toggle(); return false; } ); // Select availability $( 'select.availability' ) .on( 'change', function () { if ( $( this ).val() === 'all' ) { $( this ).closest( 'tr' ).next( 'tr' ).hide(); } else { $( this ).closest( 'tr' ).next( 'tr' ).show(); } } ) .trigger( 'change' ); // Hidden options $( '.hide_options_if_checked' ).each( function () { $( this ) .find( 'input:eq(0)' ) .on( 'change', function () { if ( $( this ).is( ':checked' ) ) { $( this ) .closest( 'fieldset, tr' ) .nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option' ) .hide(); } else { $( this ) .closest( 'fieldset, tr' ) .nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option' ) .show(); } } ) .trigger( 'change' ); } ); $( '.show_options_if_checked' ).each( function () { $( this ) .find( 'input:eq(0)' ) .on( 'change', function () { if ( $( this ).is( ':checked' ) ) { $( this ) .closest( 'fieldset, tr' ) .nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option' ) .show(); } else { $( this ) .closest( 'fieldset, tr' ) .nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option' ) .hide(); } } ) .trigger( 'change' ); } ); // Reviews. $( 'input#woocommerce_enable_reviews' ) .on( 'change', function () { if ( $( this ).is( ':checked' ) ) { $( '#woocommerce_enable_review_rating' ) .closest( 'tr' ) .show(); } else { $( '#woocommerce_enable_review_rating' ) .closest( 'tr' ) .hide(); } } ) .trigger( 'change' ); // Attribute term table $( 'table.attributes-table tbody tr:nth-child(odd)' ).addClass( 'alternate' ); // Toggle gateway on/off. $( '.wc_gateways' ).on( 'click', '.wc-payment-gateway-method-toggle-enabled', function () { var $link = $( this ), $row = $link.closest( 'tr' ), $toggle = $link.find( '.woocommerce-input-toggle' ); var data = { action: 'woocommerce_toggle_gateway_enabled', security: woocommerce_admin.nonces.gateway_toggle, gateway_id: $row.data( 'gateway_id' ), }; $toggle.addClass( 'woocommerce-input-toggle--loading' ); $.ajax( { url: woocommerce_admin.ajax_url, data: data, dataType: 'json', type: 'POST', success: function ( response ) { if ( true === response.data ) { $toggle.removeClass( 'woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled' ); $toggle.addClass( 'woocommerce-input-toggle--enabled' ); $toggle.removeClass( 'woocommerce-input-toggle--loading' ); } else if ( false === response.data ) { $toggle.removeClass( 'woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled' ); $toggle.addClass( 'woocommerce-input-toggle--disabled' ); $toggle.removeClass( 'woocommerce-input-toggle--loading' ); } else if ( 'needs_setup' === response.data ) { window.location.href = $link.attr( 'href' ); } }, } ); return false; } ); $( '#wpbody' ).on( 'click', '#doaction, #doaction2', function () { var action = $( this ).is( '#doaction' ) ? $( '#bulk-action-selector-top' ).val() : $( '#bulk-action-selector-bottom' ).val(); if ( 'remove_personal_data' === action ) { return window.confirm( woocommerce_admin.i18n_remove_personal_data_notice ); } } ); var marketplaceSectionDropdown = $( '#marketplace-current-section-dropdown' ); var marketplaceSectionName = $( '#marketplace-current-section-name' ); var marketplaceMenuIsOpen = false; // Add event listener to toggle Marketplace menu on touch devices if ( marketplaceSectionDropdown.length ) { if ( isTouchDevice() ) { marketplaceSectionName.on( 'click', function () { marketplaceMenuIsOpen = ! marketplaceMenuIsOpen; if ( marketplaceMenuIsOpen ) { marketplaceSectionDropdown.addClass( 'is-open' ); $( document ).on( 'click', maybeToggleMarketplaceMenu ); } else { marketplaceSectionDropdown.removeClass( 'is-open' ); $( document ).off( 'click', maybeToggleMarketplaceMenu ); } } ); } else { document.body.classList.add( 'no-touch' ); } } // Close menu if the user clicks outside it function maybeToggleMarketplaceMenu( e ) { if ( ! marketplaceSectionDropdown.is( e.target ) && marketplaceSectionDropdown.has( e.target ).length === 0 ) { marketplaceSectionDropdown.removeClass( 'is-open' ); marketplaceMenuIsOpen = false; $( document ).off( 'click', maybeToggleMarketplaceMenu ); } } function isTouchDevice() { return ( 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0 ); } } ); $( function() { /** * Handles heartbeat integration of order locking when HPOS is enabled. */ var wc_order_lock = { init: function() { // Order screen. this.$lock_dialog = $( '#post-lock-dialog.order-lock-dialog' ); if ( 0 !== this.$lock_dialog.length && 'undefined' !== typeof woocommerce_admin_meta_boxes ) { // We do not want WP's lock to interfere. $( document ).off( 'heartbeat-send.refresh-lock' ); $( document ).off( 'heartbeat-tick.refresh-lock' ); $( document ).on( 'heartbeat-send', this.refresh_order_lock ); $( document ).on( 'heartbeat-tick', this.check_order_lock ); } // Orders list table. this.$list_table = $( 'table.wc-orders-list-table' ); if ( 0 !== this.$list_table.length ) { $( document ).on( 'heartbeat-send', this.send_orders_in_list ); $( document ).on( 'heartbeat-tick', this.check_orders_in_list ); } }, refresh_order_lock: function( e, data ) { delete data['wp-refresh-post-lock']; data['wc-refresh-order-lock'] = woocommerce_admin_meta_boxes.post_id; }, check_order_lock: function( e, data ) { var lock_data = data['wc-refresh-order-lock']; if ( ! lock_data || ! lock_data.error ) { // No lock request in heartbeat or lock refreshed ok. return; } if ( wc_order_lock.$lock_dialog.is( ':visible' ) ) { return; } if ( lock_data.error.user_avatar_src ) { wc_order_lock.$lock_dialog.find( '.post-locked-avatar' ).empty().append( $( '', { 'class': 'avatar avatar-64 photo', width: 64, height: 64, alt: '', src: lock_data.error.user_avatar_src, srcset: lock_data.error.user_avatar_src_2x ? lock_data.error.user_avatar_src_2x + ' 2x' : undefined } ) ); } wc_order_lock.$lock_dialog.find( '.currently-editing' ).text( lock_data.error.message ); wc_order_lock.$lock_dialog.show(); wc_order_lock.$lock_dialog.find( '.wp-tab-first' ).trigger( 'focus' ); }, send_orders_in_list: function( e, data ) { data['wc-check-locked-orders'] = wc_order_lock.$list_table.find( 'tr input[name="id[]"]' ).map( function() { return this.value; } ).get(); }, check_orders_in_list: function( e, data ) { var locked_orders = data['wc-check-locked-orders'] || {}; wc_order_lock.$list_table.find( 'tr' ).each( function( i, tr ) { var $tr = $( tr ); var order_id = $tr.find( 'input[name="id[]"]' ).val(); if ( locked_orders[ order_id ] ) { if ( ! $tr.hasClass( 'wp-locked' ) ) { $tr.find( '.check-column checkbox' ).prop( 'checked', false ); $tr.addClass( 'wp-locked' ); } } else { $tr.removeClass( 'wp-locked' ).find( '.locked-info span' ).empty(); } } ); } }; wc_order_lock.init(); } ); // Function to handle selected product export $( function () { const $exportButton = $( 'a.page-title-action[href*="page=product_exporter"]'); // bail out early. if ( !$exportButton.length ) { return; } const originalExportHref = $exportButton.attr( 'href' ); const originalExportText = $exportButton.text(); // Use event delegation on the form containing the list table. $( '#posts-filter' ).on( 'change', '#the-list input[type="checkbox"][name="post[]"], #cb-select-all-1, #cb-select-all-2', function () { // Use a minimal timeout to ensure the checked state is updated in the DOM. setTimeout( function () { const selectedProductIds = $( '#the-list input[type="checkbox"][name="post[]"]:checked' ) .map( function () { return $( this ).val(); } ) .get(); // .get() converts the jQuery object to a standard array. // Update Export button. if ( selectedProductIds.length > 0 ) { // Construct the new href with product_ids and nonce. const url = new URL( originalExportHref ); url.searchParams.set( 'product_ids', selectedProductIds.join(',')); url.searchParams.set( '_wpnonce', woocommerce_admin.nonces.export_selected_products_nonce); const newHref = url.toString(); // Construct the text with the count of selected products. const count = selectedProductIds.length; const buttonText = woocommerce_admin.strings.export_selected_products.replace( '%d', count ); $exportButton.text( buttonText ).attr( 'href', newHref ); } else { $exportButton.text( originalExportText ).attr( 'href', originalExportHref ); } }, 0 ); } ); } ); } )( jQuery, woocommerce_admin );