FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surecart
/
packages
/
blocks-next
/
build
/
blocks
/
currency-switcher
Edit File: index.js
!function(){"use strict";var e,t={7005:function(e,t,r){var o=r(1609),n=Symbol.for("react.element"),c=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var o,s={},l=null,u=null;for(o in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)c.call(t,o)&&!a.hasOwnProperty(o)&&(s[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===s[o]&&(s[o]=t[o]);return{$$typeof:n,type:e,key:l,ref:u,props:s,_owner:i.current}}},9255:function(e,t,r){e.exports=r(7005)},6084:function(e,t,r){var o=window.wp.blocks,n=window.wp.primitives,c=r(9255),i=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(n.Path,{d:"M3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zm-1.338 4.877c-.314.22-.412.452-.412.623 0 .171.098.403.412.623.312.218.783.377 1.338.377.825 0 1.605.233 2.198.648.59.414 1.052 1.057 1.052 1.852 0 .795-.461 1.438-1.052 1.852-.41.286-.907.486-1.448.582v.316a.75.75 0 01-1.5 0v-.316a3.64 3.64 0 01-1.448-.582c-.59-.414-1.052-1.057-1.052-1.852a.75.75 0 011.5 0c0 .171.098.403.412.623.312.218.783.377 1.338.377s1.026-.159 1.338-.377c.314-.22.412-.452.412-.623 0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377-.825 0-1.605-.233-2.198-.648-.59-.414-1.052-1.057-1.052-1.852 0-.795.461-1.438 1.052-1.852a3.64 3.64 0 011.448-.582V7.5a.75.75 0 011.5 0v.316c.54.096 1.039.296 1.448.582.59.414 1.052 1.057 1.052 1.852a.75.75 0 01-1.5 0c0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377s-1.026.159-1.338.377z"})}),a=window.wp.i18n,s=window.wp.blockEditor,l=window.wp.components,u=window.wp.coreData;const p={width:"18px",height:"18px",fill:"none"},d={right:React.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:p},React.createElement("polyline",{points:"9 10 4 15 9 20"}),React.createElement("path",{d:"M20 4v7a4 4 0 0 1-4 4H4"})),left:React.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:p},React.createElement("polyline",{points:"15 10 20 15 15 20"}),React.createElement("path",{d:"M4 4v7a4 4 0 0 0 4 4h12"})),"top-left":React.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:p},React.createElement("polyline",{points:"14 9 9 4 4 9"}),React.createElement("path",{d:"M20 20h-7a4 4 0 0 1-4-4V4"})),"top-right":React.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:p},React.createElement("polyline",{points:"10 9 15 4 20 9"}),React.createElement("path",{d:"M4 20h7a4 4 0 0 0 4-4V4"}))};var f=JSON.parse('{"UU":"surecart/currency-switcher"}');(0,o.registerBlockType)(f.UU,{icon:i,edit:function(e){let{attributes:t,setAttributes:r}=e;const{position:o}=t,n=(0,s.useBlockProps)({className:"sc-dropdown"}),{record:c}=(0,u.useEntityRecord)("surecart","store","account");return React.createElement(React.Fragment,null,React.createElement(s.BlockControls,{group:"block"},React.createElement(l.ToolbarDropdownMenu,{icon:d?.[o]||d.right,label:"Select a direction",controls:[{title:(0,a.__)("Bottom Right","surecart"),suffix:(0,a.__)("Right","surecart"),icon:d.left,onClick:()=>r({position:"left"})},{title:(0,a.__)("Bottom Left","surecart"),icon:d.right,onClick:()=>r({position:"right"})},{title:(0,a.__)("Top Right","surecart"),icon:d["top-left"],onClick:()=>r({position:"top-left"})},{title:(0,a.__)("Top Left","surecart"),icon:d["top-right"],onClick:()=>r({position:"top-right"})}]})),React.createElement("div",n,React.createElement("div",{className:"sc-dropdown__trigger sc-button sc-button--standard sc-button--medium sc-button--caret sc-button--has-label sc-button--text"},React.createElement("span",{className:"sc-button__label"},c?.currency?.toUpperCase?.()||(0,a.__)("Currency","surecart")),React.createElement("span",{className:"sc-button__caret"},React.createElement("sc-icon",{name:"chevron-down"})))))}})},1609:function(e){e.exports=window.React}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var c=r[e]={exports:{}};return t[e](c,c.exports,o),c.exports}o.m=t,e=[],o.O=function(t,r,n,c){if(!r){var i=1/0;for(u=0;u<e.length;u++){r=e[u][0],n=e[u][1],c=e[u][2];for(var a=!0,s=0;s<r.length;s++)(!1&c||i>=c)&&Object.keys(o.O).every((function(e){return o.O[e](r[s])}))?r.splice(s--,1):(a=!1,c<i&&(i=c));if(a){e.splice(u--,1);var l=n();void 0!==l&&(t=l)}}return t}c=c||0;for(var u=e.length;u>0&&e[u-1][2]>c;u--)e[u]=e[u-1];e[u]=[r,n,c]},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={1834:0,382:0};o.O.j=function(t){return 0===e[t]};var t=function(t,r){var n,c,i=r[0],a=r[1],s=r[2],l=0;if(i.some((function(t){return 0!==e[t]}))){for(n in a)o.o(a,n)&&(o.m[n]=a[n]);if(s)var u=s(o)}for(t&&t(r);l<i.length;l++)c=i[l],o.o(e,c)&&e[c]&&e[c][0](),e[c]=0;return o.O(u)},r=self.webpackChunk_surecart_blocks_next=self.webpackChunk_surecart_blocks_next||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var n=o.O(void 0,[382],(function(){return o(6084)}));n=o.O(n)}();
Save
Back