{"version":3,"file":"../woocommerce-307.min.js","sources":["woocommerce-307.js"],"sourcesContent":["/**\n * WooCommerce Script\n * \n * Replaces the original WooCommerce `woocommerce.js`.\n */\n\n/* global Cookies */\njQuery( function( $ ) {\n\t// Orderby\n\t$( '.woocommerce-ordering' ).on( 'change', 'select.orderby', function() {\n\t\t$( this ).closest( 'form' ).trigger( 'submit' );\n\t});\n\n\t// Target quantity inputs on product pages\n\t$( 'input.qty:not(.product-quantity input.qty)' ).each( function() {\n\t\tvar min = parseFloat( $( this ).attr( 'min' ) );\n\n\t\tif ( min >= 0 && parseFloat( $( this ).val() ) < min ) {\n\t\t\t$( this ).val( min );\n\t\t}\n\t});\n\n\tvar noticeID   = $( '.woocommerce-store-notice' ).data( 'noticeId' ) || '',\n\t\tcookieName = 'store_notice' + noticeID;\n\n\t// Check the value of that cookie and show/hide the notice accordingly\n\tif ( 'hidden' === Cookies.get( cookieName ) ) {\n\t\t$( '.woocommerce-store-notice' ).hide();\n\t} else {\n\t\t$( '.woocommerce-store-notice' ).show();\n\t}\n\n\t// Set a cookie and hide the store notice when the dismiss button is clicked\n\t$( '.woocommerce-store-notice__dismiss-link' ).on( 'click', function( event ) {\n\t\tCookies.set( cookieName, 'hidden', { path: '/' } );\n\t\t$( '.woocommerce-store-notice' ).hide();\n\t\tevent.preventDefault();\n\t});\n\n\t// CHANGE: Remove \"Make form field descriptions toggle on focus.\"\n\n\t$( '.woocommerce-input-wrapper' ).on( 'click', function( event ) {\n\t\tevent.stopPropagation();\n\t} );\n\n\t// CHANGE: Remove \"Make form field descriptions toggle on focus.\"\n\n\t// Common scroll to element code.\n\t$.scroll_to_notices = function( scrollElement ) {\n\t\tif ( scrollElement.length ) {\n\t\t\t$( 'html, body' ).animate( {\n\t\t\t\tscrollTop: ( scrollElement.offset().top - 100 )\n\t\t\t}, 1000 );\n\t\t}\n\t};\n\n\t// CHANGE: Extract password visibility icon code into a function.\n\tvar handlePasswordVisibility = function() {\n\t\t// Show password visibility hover icon on woocommerce forms\n\t\t// CHANGE: Only wrap password inputs if they aren't already wrapped.\n\t\t$( '.woocommerce form .woocommerce-Input[type=\"password\"]' ).each( function() {\n\t\t\tif ( 0 === $( this ).closest( '.password-input' ).length ) {\n\t\t\t\t$( this ).wrap( '<span class=\"password-input\"></span>' );\n\t\t\t}\n\t\t} );\n\t\t\n\t\t// Add 'password-input' class to the password wrapper in checkout page.\n\t\t// CHANGE: Only wrap password inputs if they aren't already wrapped.\n\t\t$( $( '.woocommerce form input' ).filter(':password') ).each( function() {\n\t\t\tif ( 0 === $( this ).closest( '.password-input' ).length ) {\n\t\t\t\t$( this ).parent('span').addClass('password-input');\n\t\t\t}\n\t\t} );\n\n\t\t// CHANGE: Only add the password visibility icon if it doesn't already exist.\n\t\t$( '.password-input' ).each( function() {\n\t\t\tif ( 0 === $( this ).find( '.show-password-input' ).length ) {\n\t\t\t\t$( this ).append( '<span class=\"show-password-input\"></span>' );\n\t\t\t}\n\t\t} );\n\n\t\t// CHANGE: Extracted show password click handler into a reusable function.\n\t}\n\thandlePasswordVisibility();\n\t// CHANGE: END - Extract password visibility icon code into a function.\n\n\t// CHANGE: Also run password visibility icon code after replacing checkout fragments.\n\t$( document.body ).on( 'updated_checkout', handlePasswordVisibility );\n\n\t// CHANGE: Extract show password click handler into a reusable function.\n\tvar handleShowPasswordClick = function( e ) {\n\t\tif ( $( this ).hasClass( 'display-password' ) ) {\n\t\t\t$( this ).removeClass( 'display-password' );\n\t\t} else {\n\t\t\t$( this ).addClass( 'display-password' );\n\t\t}\n\t\tif ( $( this ).hasClass( 'display-password' ) ) {\n\t\t\t$( this ).siblings( ['input[type=\"password\"]'] ).prop( 'type', 'text' );\n\t\t} else {\n\t\t\t$( this ).siblings( 'input[type=\"text\"]' ).prop( 'type', 'password' );\n\t\t}\n\t}\n\t// CHANGE: END - Extract show password click handler into a reusable function.\n\t// CHANGE: Handle captured show password click handler button click.\n\t$( document.body ).on( 'click', '.show-password-input', handleShowPasswordClick );\n});\n"],"names":["jQuery","$","on","this","closest","trigger","each","min","parseFloat","attr","val","handlePasswordVisibility","length","wrap","filter","parent","addClass","find","append","cookieName","data","Cookies","get","hide","show","event","set","path","preventDefault","stopPropagation","scroll_to_notices","scrollElement","animate","scrollTop","offset","top","document","body","e","hasClass","removeClass","siblings","prop"],"mappings":"AAOAA,OAAQ,SAAUC,GAEjBA,EAAG,uBAAwB,EAAEC,GAAI,SAAU,iBAAkB,WAC5DD,EAAGE,IAAK,EAAEC,QAAS,MAAO,EAAEC,QAAS,QAAS,CAC/C,CAAC,EAGDJ,EAAG,4CAA6C,EAAEK,KAAM,WACvD,IAAIC,EAAMC,WAAYP,EAAGE,IAAK,EAAEM,KAAM,KAAM,CAAE,EAElC,GAAPF,GAAYC,WAAYP,EAAGE,IAAK,EAAEO,IAAI,CAAE,EAAIH,GAChDN,EAAGE,IAAK,EAAEO,IAAKH,CAAI,CAErB,CAAC,EAqC8B,SAA3BI,IAGHV,EAAG,uDAAwD,EAAEK,KAAM,WAC7D,IAAML,EAAGE,IAAK,EAAEC,QAAS,iBAAkB,EAAEQ,QACjDX,EAAGE,IAAK,EAAEU,KAAM,sCAAuC,CAEzD,CAAE,EAIFZ,EAAGA,EAAG,yBAA0B,EAAEa,OAAO,WAAW,CAAE,EAAER,KAAM,WACxD,IAAML,EAAGE,IAAK,EAAEC,QAAS,iBAAkB,EAAEQ,QACjDX,EAAGE,IAAK,EAAEY,OAAO,MAAM,EAAEC,SAAS,gBAAgB,CAEpD,CAAE,EAGFf,EAAG,iBAAkB,EAAEK,KAAM,WACvB,IAAML,EAAGE,IAAK,EAAEc,KAAM,sBAAuB,EAAEL,QACnDX,EAAGE,IAAK,EAAEe,OAAQ,2CAA4C,CAEhE,CAAE,CAGH,CA5DA,IACCC,EAAa,gBADGlB,EAAG,2BAA4B,EAAEmB,KAAM,UAAW,GAAK,IAInE,WAAaC,QAAQC,IAAKH,CAAW,EACzClB,EAAG,2BAA4B,EAAEsB,KAAK,EAEtCtB,EAAG,2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