(()=>{var e,t,o,r={9129:(e,t,o)=>{"use strict";const r=window.wp.blocks;var n=o(7871),s=o(7082);const c=JSON.parse('{"name":"woocommerce/order-confirmation-create-account","version":"1.0.0","title":"Account Creation","description":"Allow customers to create an account after their purchase.","category":"woocommerce","keywords":["WooCommerce"],"attributes":{"customerEmail":{"type":"string","default":""},"nonceToken":{"type":"string","default":""},"align":{"type":"string","default":"wide"},"className":{"type":"string","default":""},"hasDarkControls":{"type":"boolean","default":false},"lock":{"type":"object","default":{"remove":true}}},"supports":{"multiple":false,"inserter":false,"html":false,"lock":false,"align":["wide","full"],"color":{"background":true,"text":true,"button":true},"spacing":{"padding":true,"margin":true,"__experimentalDefaultControls":{"margin":false,"padding":false}}},"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}');var a=o(7723),i=o(4921);const l=window.wp.blockEditor,d=window.wc.wcSettings,m=window.wp.components;o(8177);const u={adminUrl:"",countries:[],countryData:{},currency:{code:"USD",precision:2,symbol:"$",symbolPosition:"left",decimalSeparator:".",priceFormat:"%1$s%2$s",thousandSeparator:","},currentUserId:0,currentUserIsAdmin:!1,homeUrl:"",locale:{siteLocale:"en_US",userLocale:"en_US",weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},orderStatuses:[],placeholderImgSrc:"",siteTitle:"",storePages:[],wcAssetUrl:"",wcVersion:"",wpLoginUrl:"",wpVersion:""},p="object"==typeof window.wcSettings?window.wcSettings:{},w={...u,...p};w.currency={...u.currency,...w.currency},w.locale={...u.locale,...w.locale},w.adminUrl,w.countries,w.currentUserIsAdmin,w.homeUrl,w.locale,w.orderStatuses,w.placeholderImgSrc;const h=w.siteTitle,g=(w.storePages,w.wcAssetUrl,w.wcVersion,w.wpLoginUrl,w.wpVersion,w.currency);g.code,g.symbol,g.thousandSeparator,g.decimalSeparator,g.precision,g.symbol,g.symbolPosition,g.symbol,g.symbolPosition;var f=o(6087),_=o(6874),b=(o(6882),o(790));const y=(0,f.forwardRef)((e,t)=>{const{className:o,children:r,variant:n="contained",removeTextWrap:s=!1,...c}=e,a=(0,i.A)("wc-block-components-button","wp-element-button",o,n);if("href"in e)return(0,b.jsx)(_.$,{render:(0,b.jsx)("a",{ref:t,href:e.href,children:(0,b.jsx)("div",{className:"wc-block-components-button__text",children:r})}),className:a,...c});const l=s?e.children:(0,b.jsx)("div",{className:"wc-block-components-button__text",children:e.children});return(0,b.jsx)(_.$,{ref:t,className:a,...c,children:l})});var k=o(9491),v=o(3558);o(6713);const x=[(0,a.__)("Too weak","woocommerce"),(0,a.__)("Weak","woocommerce"),(0,a.__)("Medium","woocommerce"),(0,a.__)("Strong","woocommerce"),(0,a.__)("Very strong","woocommerce")],S=e=>void 0===window.zxcvbn?(0,v.Bi)(e,[{id:0,value:x[0],minDiversity:0,minLength:0},{id:1,value:x[1],minDiversity:1,minLength:4},{id:2,value:x[2],minDiversity:2,minLength:8},{id:3,value:x[3],minDiversity:4,minLength:12},{id:4,value:x[4],minDiversity:4,minLength:20}]).id:window.zxcvbn(e).score,j=({password:e="",onChange:t})=>{const o=(0,k.useInstanceId)(j,"woocommerce-password-strength-meter");let r=-1;e.length>0&&(r=S(e));const n=function(e,t){const o=(0,f.useRef)();return(0,f.useEffect)(()=>{o.current===e||(o.current=e)},[e,t]),o.current}(r);return(0,f.useEffect)(()=>{r!==n&&t&&t(r)},[r,n,t]),(0,b.jsxs)("div",{id:o,className:(0,i.A)("wc-block-components-password-strength",{hidden:-1===r}),children:[(0,b.jsx)("label",{htmlFor:o+"-meter",className:"screen-reader-text",children:(0,a.__)("Password strength","woocommerce")}),(0,b.jsx)("meter",{id:o+"-meter",className:"wc-block-components-password-strength__meter",min:0,max:4,value:r>-1?r:0,children:x[r]??""}),!!x[r]&&(0,b.jsxs)("div",{id:o+"-result",className:"wc-block-components-password-strength__result",children:[(0,b.jsx)("span",{className:"screen-reader-text","aria-live":"polite",children:(0,a.sprintf)(/* translators: %s: Password strength */ /* translators: %s: Password strength */
(0,a.__)("Password strength: %1$s (%2$d characters long)","woocommerce"),x[r],e.length)})," ",(0,b.jsx)("span",{"aria-hidden":!0,children:x[r]})]})]})},E=(0,d.getSetting)("wcBlocksConfig",{pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),O=(E.pluginUrl,E.pluginUrl,d.STORE_PAGES.shop,d.STORE_PAGES.checkout,d.STORE_PAGES.checkout,d.STORE_PAGES.privacy?.permalink),P=(d.STORE_PAGES.privacy,d.STORE_PAGES.terms?.permalink),T=(d.STORE_PAGES.terms,d.STORE_PAGES.cart,d.STORE_PAGES.cart,d.STORE_PAGES.myaccount?.permalink?d.STORE_PAGES.myaccount.permalink:(0,d.getSetting)("wpLoginUrl","/wp-login.php"),(0,d.getSetting)("localPickupEnabled",!1),(0,d.getSetting)("shippingMethodsExist",!1),(0,d.getSetting)("shippingEnabled",!0),(0,d.getSetting)("countries",{})),C=(0,d.getSetting)("countryData",{}),A={...Object.fromEntries(Object.keys(C).filter(e=>!0===C[e].allowBilling).map(e=>[e,T[e]||""])),...Object.fromEntries(Object.keys(C).filter(e=>!0===C[e].allowShipping).map(e=>[e,T[e]||""]))},D=(Object.fromEntries(Object.keys(A).map(e=>[e,C[e].states||{}])),Object.fromEntries(Object.keys(A).map(e=>[e,C[e].locale||{}])),{address:["first_name","last_name","company","address_1","address_2","city","postcode","country","state","phone"],contact:["email"],order:[]}),N=((0,d.getSetting)("addressFieldsLocations",D).address,(0,d.getSetting)("addressFieldsLocations",D).contact,(0,d.getSetting)("addressFieldsLocations",D).order,(0,d.getSetting)("additionalOrderFields",{}),(0,d.getSetting)("additionalContactFields",{}),(0,d.getSetting)("additionalAddressFields",{}),window.wc.blocksComponents),I=window.wp.data,U=window.wc.wcBlocksData,L=P?(0,b.jsx)("a",{href:P,target:"_blank",rel:"noreferrer",children:(0,a.__)("Terms","woocommerce")}):(0,b.jsx)("span",{children:(0,a.__)("Terms","woocommerce")}),R=O?(0,b.jsx)("a",{href:O,target:"_blank",rel:"noreferrer",children:(0,a.__)("Privacy Policy","woocommerce")}):(0,b.jsx)("span",{children:(0,a.__)("Privacy Policy","woocommerce")}),B=({isLoading:e,password:t,setPassword:o})=>(0,b.jsx)("div",{children:(0,b.jsx)(N.ValidatedTextInput,{disabled:e,type:"password",label:(0,a.__)("Password","woocommerce"),className:"wc-block-components-address-form__password",value:t,required:!0,errorId:"account-password",customValidityMessage:e=>{if(e.valueMissing||e.badInput||e.typeMismatch)return(0,a.__)("Please enter a valid password","woocommerce")},customValidation:e=>!(S(e.value)<2&&(e.setCustomValidity((0,a.__)("Please create a stronger password","woocommerce")),1)),onChange:e=>o(e),feedback:(0,b.jsx)(j,{password:t})})}),M=({attributes:e,isEditor:t})=>{const[o,r]=(0,f.useState)(!1),[n,s]=(0,f.useState)(""),c=(0,I.useSelect)(e=>e(U.validationStore).getValidationError("account-password"),[]),l=e?.customerEmail||(t?"customer@email.com":""),m=e?.nonceToken||"",u=(0,d.getSetting)("registrationGeneratePassword",!1),p=!u&&!n;return l?(0,b.jsxs)("form",{className:"wc-block-order-confirmation-create-account-form",id:"create-account",method:"POST",action:"#create-account",onSubmit:e=>{c?e.preventDefault():r(!0)},children:[!u&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{children:(0,f.createInterpolateElement)((0,a.__)("Set a password for <email/>","woocommerce"),{email:(0,b.jsx)("strong",{children:l})})}),(0,b.jsx)(B,{isLoading:o,password:n,setPassword:s})]}),(0,b.jsxs)(y,{className:(0,i.A)("wc-block-order-confirmation-create-account-button",{"wc-block-order-confirmation-create-account-button--loading":o}),type:"submit",disabled:!!c||p||o,children:[!!o&&(0,b.jsx)(N.Spinner,{}),(0,a.__)("Create account","woocommerce")]}),(0,b.jsx)("input",{type:"hidden",name:"email",value:l}),(0,b.jsx)("input",{type:"hidden",name:"password",value:n}),(0,b.jsx)("input",{type:"hidden",name:"create-account",value:"1"}),(0,b.jsx)("input",{type:"hidden",name:"_wpnonce",value:m}),(0,b.jsx)("div",{className:"wc-block-order-confirmation-create-account-description",children:(0,b.jsxs)("p",{children:[u&&(0,b.jsxs)(b.Fragment,{children:[(0,f.createInterpolateElement)((0,a.__)("Check your email at <email/> for the link to set up an account password.","woocommerce"),{email:(0,b.jsx)(b.Fragment,{children:l})})," "]}),(0,f.createInterpolateElement)((0,a.__)("By creating an account you agree to our <terms/> and <privacy/>.","woocommerce"),{terms:L,privacy:R})]})})]}):null},F=[["core/heading",{level:3,content:(0,a.sprintf)(/* translators: %s: site name */ /* translators: %s: site name */
(0,a.__)("Create an account with %s","woocommerce"),h)}],["core/list",{className:"is-style-checkmark-list"},[["core/list-item",{content:(0,a.__)("Faster future purchases","woocommerce")}],["core/list-item",{content:(0,a.__)("Securely save payment info","woocommerce")}],["core/list-item",{content:(0,a.__)("Track orders & view shopping history","woocommerce")}]]]];(0,r.registerBlockType)(c,{apiVersion:3,icon:{src:(0,b.jsx)(n.A,{icon:s.A,className:"wc-block-editor-components-block-icon"})},attributes:{...c.attributes},edit:({attributes:e,setAttributes:t})=>{const o=(0,i.A)("wc-block-order-confirmation-create-account",{"has-dark-controls":e.hasDarkControls}),r=(0,l.useBlockProps)({className:o});if(!(0,d.getSetting)("delayedAccountCreationEnabled",!0))return null;const n=(0,d.getSetting)("registrationGeneratePassword",!0);return(0,b.jsxs)("div",{...r,children:[(0,b.jsx)(l.InnerBlocks,{allowedBlocks:["core/heading","core/paragraph","core/list","core/list-item","core/image"],template:F,templateLock:!1}),(0,b.jsx)(m.Disabled,{children:(0,b.jsx)(M,{isEditor:!0})}),!n&&(0,b.jsx)(l.InspectorControls,{children:(0,b.jsx)(m.__experimentalToolsPanel,{label:(0,a.__)("Style","woocommerce"),resetAll:()=>{t({hasDarkControls:!1})},children:(0,b.jsx)(m.__experimentalToolsPanelItem,{hasValue:()=>!0===e.hasDarkControls,label:(0,a.__)("Dark mode inputs","woocommerce"),onDeselect:()=>t({hasDarkControls:!1}),isShownByDefault:!0,children:(0,b.jsx)(m.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Dark mode inputs","woocommerce"),help:(0,a.__)("Inputs styled specifically for use on dark background colors.","woocommerce"),checked:e.hasDarkControls,onChange:()=>t({hasDarkControls:!e.hasDarkControls})})})})}),(0,b.jsx)(l.InspectorControls,{children:(0,b.jsxs)(m.PanelBody,{children:[(0,b.jsx)("p",{children:(0,a.__)("Configure this feature in your store settings.","woocommerce")}),(0,b.jsx)(m.ExternalLink,{href:`${d.ADMIN_URL}admin.php?page=wc-settings&tab=account`,children:(0,a.__)("Manage account settings","woocommerce")})]})})]})},save:()=>(0,b.jsx)("div",{...l.useBlockProps.save(),children:(0,b.jsx)(l.InnerBlocks.Content,{})})})},6882:()=>{},6713:()=>{},8177:()=>{},1609:e=>{"use strict";e.exports=window.React},790:e=>{"use strict";e.exports=window.ReactJSXRuntime},9491:e=>{"use strict";e.exports=window.wp.compose},6087:e=>{"use strict";e.exports=window.wp.element},7723:e=>{"use strict";e.exports=window.wp.i18n},5573:e=>{"use strict";e.exports=window.wp.primitives}},n={};function s(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e](o,o.exports,s),o.exports}s.m=r,e=[],s.O=(t,o,r,n)=>{if(!o){var c=1/0;for(d=0;d<e.length;d++){for(var[o,r,n]=e[d],a=!0,i=0;i<o.length;i++)(!1&n||c>=n)&&Object.keys(s.O).every(e=>s.O[e](o[i]))?o.splice(i--,1):(a=!1,n<c&&(c=n));if(a){e.splice(d--,1);var l=r();void 0!==l&&(t=l)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[o,r,n]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},o=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var n=Object.create(null);s.r(n);var c={};t=t||[null,o({}),o([]),o(o)];for(var a=2&r&&e;"object"==typeof a&&!~t.indexOf(a);a=o(a))Object.getOwnPropertyNames(a).forEach(t=>c[t]=()=>e[t]);return c.default=()=>e,s.d(n,c),n},s.d=(e,t)=>{for(var o in t)s.o(t,o)&&!s.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.j=5932,(()=>{var e={5932:0};s.O.j=t=>0===e[t];var t=(t,o)=>{var r,n,[c,a,i]=o,l=0;if(c.some(t=>0!==e[t])){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);if(i)var d=i(s)}for(t&&t(o);l<c.length;l++)n=c[l],s.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return s.O(d)},o=globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var c=s.O(void 0,[94],()=>s(9129));c=s.O(c),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["order-confirmation-create-account"]=c})();