File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/product-button-frontend.js.tar
httpdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/product-button-frontend.js0000644 00000033433 15154712164 0036561 0 ustar 00 var/www/vhosts/uyarreklam.com.tr (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[74,79],{104:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return c})),n.d(e,"b",(function(){return s}));const r=window.CustomEvent||null,o=(t,{bubbles:e=!1,cancelable:n=!1,element:o,detail:c={}})=>{if(!r)return;o||(o=document.body);const s=new r(t,{bubbles:e,cancelable:n,detail:c});o.dispatchEvent(s)},c=({preserveCartData:t=!1})=>{o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},s=(t,e,n=!1,r=!1)=>{if("function"!=typeof jQuery)return()=>{};const c=()=>{o(e,{bubbles:n,cancelable:r})};return jQuery(document).on(t,c),()=>jQuery(document).off(t,c)}},119:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=t=>"number"==typeof t},120:function(t,e,n){"use strict";n.d(e,"b",(function(){return r}));const r=()=>window.performance&&window.performance.getEntriesByType("navigation").length?window.performance.getEntriesByType("navigation")[0].type:"";e.a=r},149:function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return l}));var r=n(84),o=(n(14),n(2)),c=n(22),s=n(29);const a=t=>{const e=Object.keys(o.defaultAddressFields),n=Object(r.a)(e,{},t.country),c=Object.assign({},t);return n.forEach((({key:e="",hidden:n=!1})=>{n&&((t,e)=>t in e)(e,t)&&(c[e]="")})),c},i=t=>{if(0===Object.values(t).length)return null;const e="string"==typeof s.i[t.country]?Object(c.decodeEntities)(s.i[t.country]):"",n="object"==typeof s.j[t.country]&&"string"==typeof s.j[t.country][t.state]?Object(c.decodeEntities)(s.j[t.country][t.state]):t.state,r=[];r.push(t.postcode.toUpperCase()),r.push(t.city),r.push(n),r.push(e);return r.filter(Boolean).join(", ")||null},l=t=>!!t.city&&!!t.country},19:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return c}));var r=n(37);const o=t=>!Object(r.a)(t)&&t instanceof Object&&t.constructor===Object;function c(t,e){return o(t)&&e in t}},28:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=t=>"string"==typeof t},287:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError},288:function(t,e,n){"use strict";function r(t){return t.toLowerCase()}n.d(e,"a",(function(){return s}));var o=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],c=/[^A-Z0-9]+/gi;function s(t,e){void 0===e&&(e={});for(var n=e.splitRegexp,s=void 0===n?o:n,i=e.stripRegexp,l=void 0===i?c:i,u=e.transform,d=void 0===u?r:u,p=e.delimiter,b=void 0===p?" ":p,f=a(a(t,s,"$1\0$2"),l,"\0"),_=0,m=f.length;"\0"===f.charAt(_);)_++;for(;"\0"===f.charAt(m-1);)m--;return f.slice(_,m).split("\0").map(d).join(b)}function a(t,e,n){return e instanceof RegExp?t.replace(e,n):e.reduce((function(t,e){return t.replace(e,n)}),t)}},291:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(287),o=n(288);function c(t,e){return void 0===e&&(e={}),function(t,e){return void 0===e&&(e={}),Object(o.a)(t,Object(r.a)({delimiter:"."},e))}(t,Object(r.a)({delimiter:"-"},e))}},293:function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(4),o=n.n(r),c=n(19),s=n(28),a=n(291),i=n(131);function l(t={}){const e={};return Object(i.getCSSRules)(t,{selector:""}).forEach((t=>{e[t.key]=t.value})),e}function u(t,e){return t&&e?`has-${Object(a.a)(e)}-${t}`:""}const d=t=>{const e=(t=>{const e=Object(c.a)(t)?t:{style:{}};let n=e.style;return Object(s.a)(n)&&(n=JSON.parse(n)||{}),Object(c.a)(n)||(n={}),{...e,style:n}})(t),n=function(t){var e,n,r,s,a,i,d;const{backgroundColor:p,textColor:b,gradient:f,style:_}=t,m=u("background-color",p),v=u("color",b),y=function(t){if(t)return`has-${t}-gradient-background`}(f),g=y||(null==_||null===(e=_.color)||void 0===e?void 0:e.gradient);return{className:o()(v,y,{[m]:!g&&!!m,"has-text-color":b||(null==_||null===(n=_.color)||void 0===n?void 0:n.text),"has-background":p||(null==_||null===(r=_.color)||void 0===r?void 0:r.background)||f||(null==_||null===(s=_.color)||void 0===s?void 0:s.gradient),"has-link-color":Object(c.a)(null==_||null===(a=_.elements)||void 0===a?void 0:a.link)?null==_||null===(i=_.elements)||void 0===i||null===(d=i.link)||void 0===d?void 0:d.color:void 0}),style:l({color:(null==_?void 0:_.color)||{}})}}(e),r=function(t){var e;const n=(null===(e=t.style)||void 0===e?void 0:e.border)||{};return{className:function(t){var e;const{borderColor:n,style:r}=t,c=n?u("border-color",n):"";return o()({"has-border-color":!!n||!(null==r||null===(e=r.border)||void 0===e||!e.color),[c]:!!c})}(t),style:l({border:n})}}(e),a=function(t){var e;return{className:void 0,style:l({spacing:(null===(e=t.style)||void 0===e?void 0:e.spacing)||{}})}}(e),i=(t=>{const e=Object(c.a)(t.style.typography)?t.style.typography:{},n=Object(s.a)(e.fontFamily)?e.fontFamily:"";return{className:t.fontFamily?`has-${t.fontFamily}-font-family`:n,style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight,letterSpacing:e.letterSpacing,lineHeight:e.lineHeight,textDecoration:e.textDecoration,textTransform:e.textTransform}}})(e);return{className:o()(i.className,n.className,r.className,a.className),style:{...i.style,...n.style,...r.style,...a.style}}}},37:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=t=>null===t},373:function(t,e){},403:function(t,e,n){"use strict";n.r(e),n.d(e,"Block",(function(){return v}));var r=n(0),o=n(4),c=n.n(o),s=n(1),a=n(73),i=n(404),l=n(293),u=n(22),d=n(29),p=n(2),b=n(59),f=n(144);n(373);const _=({product:t,className:e,style:n})=>{const{id:o,permalink:l,add_to_cart:b,has_options:f,is_purchasable:_,is_in_stock:m}=t,{dispatchStoreEvent:v}=Object(a.a)(),{cartQuantity:y,addingToCart:g,addToCart:E}=Object(i.a)(o),O=Number.isFinite(y)&&y>0,h=!f&&_&&m,C=Object(u.decodeEntities)((null==b?void 0:b.description)||""),w=O?Object(s.sprintf)(/* translators: %s number of products in cart. */
Object(s._n)("%d in cart","%d in cart",y,"woocommerce"),y):Object(u.decodeEntities)((null==b?void 0:b.text)||Object(s.__)("Add to cart","woocommerce")),j=h?"button":"a",S={};return h?S.onClick=async()=>{await E(),v("cart-add-item",{product:t});const{cartRedirectAfterAdd:e}=Object(p.getSetting)("productsSettings");e&&(window.location.href=d.c)}:(S.href=l,S.rel="nofollow",S.onClick=()=>{v("product-view-link",{product:t})}),Object(r.createElement)(j,{...S,"aria-label":C,disabled:g,className:c()(e,"wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button",{loading:g,added:O}),style:n},w)},m=({className:t,style:e})=>Object(r.createElement)("button",{className:c()("wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder",t),style:e,disabled:!0}),v=t=>{const{className:e,textAlign:n}=t,o=Object(l.a)(t),{parentClassName:s}=Object(b.useInnerBlockLayoutContext)(),{product:a}=Object(b.useProductDataContext)();return Object(r.createElement)("div",{className:c()(e,"wp-block-button","wc-block-components-product-button",{[`${s}__product-add-to-cart`]:s,[`align-${n}`]:n})},a.id?Object(r.createElement)(_,{product:a,style:o.style,className:o.className}):Object(r.createElement)(m,{style:o.style,className:o.className}))};e.default=Object(f.withProductDataContext)(v)},404:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(0),o=n(5),c=n(3),s=n(22),a=n(72);const i=(t,e)=>{const n=t.find((({id:t})=>t===e));return n?n.quantity:0},l=t=>{const{addItemToCart:e}=Object(o.useDispatch)(c.CART_STORE_KEY),{cartItems:n,cartIsLoading:l}=Object(a.a)(),{createErrorNotice:u,removeNotice:d}=Object(o.useDispatch)("core/notices"),[p,b]=Object(r.useState)(!1),f=Object(r.useRef)(i(n,t));return Object(r.useEffect)((()=>{const e=i(n,t);e!==f.current&&(f.current=e)}),[n,t]),{cartQuantity:Number.isFinite(f.current)?f.current:0,addingToCart:p,cartIsLoading:l,addToCart:(n=1)=>(b(!0),e(t,n).then((()=>{d("add-to-cart")})).catch((t=>{u(Object(s.decodeEntities)(t.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})})).finally((()=>{b(!1)})))}}},57:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(0);n(5);const o=Object(r.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>({})}),c=()=>Object(r.useContext)(o)},72:function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r=n(55),o=n.n(r),c=n(0),s=n(3),a=n(5),i=n(22),l=n(149),u=n(57),d=n(120),p=n(104);const b=t=>{const e=null==t?void 0:t.detail;e&&e.preserveCartData||Object(a.dispatch)(s.CART_STORE_KEY).invalidateResolutionForStore()},f=t=>{(null!=t&&t.persisted||"back_forward"===Object(d.b)())&&Object(a.dispatch)(s.CART_STORE_KEY).invalidateResolutionForStore()},_=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},v={...m,email:""},y={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:s.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},g=t=>Object.fromEntries(Object.entries(t).map((([t,e])=>[t,Object(i.decodeEntities)(e)]))),E={cartCoupons:s.EMPTY_CART_COUPONS,cartItems:s.EMPTY_CART_ITEMS,cartFees:s.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,crossSellsProducts:s.EMPTY_CART_CROSS_SELLS,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:y,cartIsLoading:!0,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:v,shippingAddress:m,shippingRates:s.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentMethods:s.EMPTY_PAYMENT_METHODS,paymentRequirements:s.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},receiveCartContents:()=>{},extensions:s.EMPTY_EXTENSIONS},O=(t={shouldSelect:!0})=>{const{isEditor:e,previewData:n}=Object(u.a)(),r=null==n?void 0:n.previewCart,{shouldSelect:i}=t,d=Object(c.useRef)();Object(c.useEffect)((()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),(null===(t=window.wcBlocksStoreCartListeners)||void 0===t?void 0:t.count)>0)return void window.wcBlocksStoreCartListeners.count++;var t;document.body.addEventListener("wc-blocks_added_to_cart",b),document.body.addEventListener("wc-blocks_removed_from_cart",b),window.addEventListener("pageshow",f);const e=Object(p.b)("added_to_cart","wc-blocks_added_to_cart"),n=Object(p.b)("removed_from_cart","wc-blocks_removed_from_cart");window.wcBlocksStoreCartListeners.count=1,window.wcBlocksStoreCartListeners.remove=()=>{document.body.removeEventListener("wc-blocks_added_to_cart",b),document.body.removeEventListener("wc-blocks_removed_from_cart",b),window.removeEventListener("pageshow",f),e(),n()}})(),_)),[]);const y=Object(a.useSelect)(((t,{dispatch:n})=>{if(!i)return E;if(e)return{cartCoupons:r.coupons,cartItems:r.items,crossSellsProducts:r.cross_sells,cartFees:r.fees,cartItemsCount:r.items_count,cartItemsWeight:r.items_weight,cartNeedsPayment:r.needs_payment,cartNeedsShipping:r.needs_shipping,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:r.totals,cartIsLoading:!1,cartErrors:s.EMPTY_CART_ERRORS,billingData:v,billingAddress:v,shippingAddress:m,extensions:s.EMPTY_EXTENSIONS,shippingRates:r.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:r.has_calculated_shipping,paymentRequirements:r.paymentRequirements,receiveCart:"function"==typeof(null==r?void 0:r.receiveCart)?r.receiveCart:()=>{},receiveCartContents:"function"==typeof(null==r?void 0:r.receiveCartContents)?r.receiveCartContents:()=>{}};const o=t(s.CART_STORE_KEY),c=o.getCartData(),a=o.getCartErrors(),u=o.getCartTotals(),d=!o.hasFinishedResolution("getCartData"),p=o.isCustomerDataUpdating(),{receiveCart:b,receiveCartContents:f}=n(s.CART_STORE_KEY),_=g(c.billingAddress),y=c.needsShipping?g(c.shippingAddress):_,O=c.fees.length>0?c.fees.map((t=>g(t))):s.EMPTY_CART_FEES;return{cartCoupons:c.coupons.length>0?c.coupons.map((t=>({...t,label:t.code}))):s.EMPTY_CART_COUPONS,cartItems:c.items,crossSellsProducts:c.crossSells,cartFees:O,cartItemsCount:c.itemsCount,cartItemsWeight:c.itemsWeight,cartNeedsPayment:c.needsPayment,cartNeedsShipping:c.needsShipping,cartItemErrors:c.errors,cartTotals:u,cartIsLoading:d,cartErrors:a,billingData:Object(l.a)(_),billingAddress:Object(l.a)(_),shippingAddress:Object(l.a)(y),extensions:c.extensions,shippingRates:c.shippingRates,isLoadingRates:p,cartHasCalculatedShipping:c.hasCalculatedShipping,paymentRequirements:c.paymentRequirements,receiveCart:b,receiveCartContents:f}}),[i]);return d.current&&o()(d.current,y)||(d.current=y),d.current}},84:function(t,e,n){"use strict";var r=n(2),o=n(1),c=n(119),s=n(28),a=n(29);const i=t=>{const e={};return void 0!==t.label&&(e.label=t.label),void 0!==t.required&&(e.required=t.required),void 0!==t.hidden&&(e.hidden=t.hidden),void 0===t.label||t.optionalLabel||(e.optionalLabel=Object(o.sprintf)(/* translators: %s Field label. */
Object(o.__)("%s (optional)","woocommerce"),t.label)),t.priority&&(Object(c.a)(t.priority)&&(e.index=t.priority),Object(s.a)(t.priority)&&(e.index=parseInt(t.priority,10))),t.hidden&&(e.required=!1),e},l=Object.entries(a.e).map((([t,e])=>[t,Object.entries(e).map((([t,e])=>[t,i(e)])).reduce(((t,[e,n])=>(t[e]=n,t)),{})])).reduce(((t,[e,n])=>(t[e]=n,t)),{});e.a=(t,e,n="")=>{const o=n&&void 0!==l[n]?l[n]:{};return t.map((t=>({key:t,...r.defaultAddressFields[t]||{},...o[t]||{},...e[t]||{}}))).sort(((t,e)=>t.index-e.index))}}}]);