"use strict";(self.webpackChunkwebpackWcBlocksCartCheckoutFrontendJsonp=self.webpackChunkwebpackWcBlocksCartCheckoutFrontendJsonp||[]).push([[552],{3604:(e,o,t)=>{t.r(o),t.d(o,{default:()=>i});var r=t(1609),c=t(851),s=t(7723),a=t(4656),n=t(5606),l=t(7143),d=t(7594),u=t(6087);const h=({disabled:e,onChange:o,placeholder:t,value:c})=>{const[n,l]=(0,u.useState)(""!==c),[d,h]=(0,u.useState)("");return(0,r.createElement)("div",{className:"wc-block-checkout__add-note"},(0,r.createElement)(a.CheckboxControl,{disabled:e,label:(0,s.__)("Add a note to your order","woocommerce"),checked:n,onChange:e=>{l(e),e?c!==d&&o(d):(o(""),h(c))}}),n&&(0,r.createElement)(a.Textarea,{disabled:e,onTextChange:o,placeholder:t,value:c}))},i=({className:e})=>{const{needsShipping:o}=(0,n.m)(),{isProcessing:t,orderNotes:u}=(0,l.useSelect)((e=>{const o=e(d.checkoutStore);return{isProcessing:o.isProcessing(),orderNotes:o.getOrderNotes()}})),{__internalSetOrderNotes:i}=(0,l.useDispatch)(d.checkoutStore);return(0,r.createElement)(a.FormStep,{id:"order-notes",showStepNumber:!1,className:(0,c.A)("wc-block-checkout__order-notes",e),disabled:t},(0,r.createElement)(h,{disabled:t,onChange:i,placeholder:o?(0,s.__)("Notes about your order, e.g. special notes for delivery.","woocommerce"):(0,s.__)("Notes about your order.","woocommerce"),value:u}))}}}]);