Crio Bru® Brewed Cacao: Brews Like Coffee, Benefits of Cacao

Posted by:

Category:

Comments:

Post Date:


Crio Bru® Brewed Cacao: Brews Like Coffee, Benefits of Cacao

[] ]]]]>]]> ]]]]>]]> Crio Bru® Brewed Cacao: Brews Like Coffee, Benefits of Cacao ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> `form[action*='/${e}'] input[name='form_type'][value='${t}']`)).join(',');function c(e,t){try{const n=window.sessionStorage;for(const[o,c]of Object.entries(JSON.parse(n.getItem(t))))e.elements[o]&&(e.elements[o].value=c);n.removeItem(t)}catch{}}const s='form_type',r='cptcha';((a,i,m,f,u,d)=>{if(0)return;let l=!1;a[m]=a[m]||{},a[m][f]=a[m][f]||{},a[m][f].q=[],function(a,i,m,f,u,d){const[l,_,p]=function(c,s,r){const a=s?[[e,e],['blogs',n],['comments',n],[e,'customer']]:[],i=c?[[t,'customer_login'],[t,'guest_login'],[t,'recover_customer_password'],[t,'create_customer']]:[],m=[...a,...i],f=o(m),u=o(a.slice(0,3)),d=r&&o(m.filter((([e,t])=>r.includes(t)))),l=e=>()=>e?[...document.querySelectorAll(e)].map((e=>e.form)):[];return[l(f),l(u),l(d)]}(!0,!0,d),E=e=>{const t=e.target,n=t instanceof HTMLFormElement?t:t&&t.form;return n&&l().find((e=>n===e))};a.addEventListener('submit',(e=>{E(e)&&e.preventDefault()}));const T=(e,t)=>{m(e,t.some((t=>t===e))),e.dataset[r]=!0};for(const e of['focusin','change'])a.addEventListener(e,(e=>{const t=E(e);t&&!t.dataset[r]&&T(t,_())}));const g=i.get('form_key'),v=i.get(s),h=g&&v,y=d&&d.length;(y||h)&&a.addEventListener('DOMContentLoaded',(()=>{const e=_();if(h)for(const t of e)t.elements[s].value===v&&c(t,g);if(y)for(const t of p())T(t,e)}))}(i,new URLSearchParams(a.location.search),((e,t)=>{const n=a[m][f],o=n.bindForm,c='6LeHG2ApAAAAAO4rPaDW-qVpPKPOBfjbCpzJB9ey',s={infoText:'',privacyText:'',termsText:''};if(o)return o(e,c,t,s);n.q.push([e,c,t,s]),l||(i.body.append(Object.assign(i.createElement('script'),{id:'captcha-provider',async:!0,src:'https://cdn.shopify.com/shopifycloud/storefront-forms-hcaptcha/ce_storefront_forms_captcha_recaptcha.v1.0.5.iife.js'})),l=!0)}),0,0,['guest_login'])})(window,document,'Shopify','ce_forms')}();]]]]]]]]>]]]]]]>]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]]]>]]]]>]]> ]]]]]]>]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]>

BREWS LIKE COFFEE | TASTES LIKE CHOCOLATE

]]]]>]]>

]]]]>]]>

Sold out ]]]]>]]>

]]]]>]]> ]]]]>]]> ]]]]>]]>

]]]]>]]>

Sold out ]]]]>]]>

]]]]>]]> ]]]]>]]> ]]]]>]]>

]]]]>]]>

Sold out ]]]]>]]>

]]]]>]]> ]]]]>]]> ]]]]>]]>

]]]]>]]>

Sold out ]]]]>]]>

]]]]>]]> ]]]]>]]> ]]]]>]]>

]]]]>]]>

Sold out ]]]]>]]>

]]]]>]]> ]]]]>]]> ]]]]>]]>

]]]]>]]>

Sold out ]]]]>]]>

]]]]>]]> ]]]]>]]> ]]]]>]]>

Crio Bru Brewed Cacao is a coffee alternative made with 100% pure ground cacao to give you natural energy without the jitters or caffeine crash. Did we mention it also supports your heart, brain, and bone health? Plus it tastes like smooth and unsweetened, pure dark chocolate.

We've got a product for everyone

]]]]>]]> ]]]]>]]> ]]]]>]]> ]]]]>]]>

99.99% caffeine free, all-day energy, rich in antioxidants and magnesium, theobromine, flavor and aroma of dark chocolate

]]]]>]]>

Caffeine crash, jitters, acidic, steals energy from your future self

Love it or it’s free on orders over $50*

"A cacao-based coffee alternative that’s brimming with a plethora or health benefits."

- As featured in EatThis. NotThat!

]]]]>]]> ]]]]>]]>

Everyone’s favorite chocolatey blend with a hint of Vanilla.

]]]]>]]> ]]]]>]]>

Rich chocolate with a hint of Hazelnut and Butterscotch.

FREQUENTLY ASKED QUESTIONS

IT'S NOT COFFEE | IT'S CACAO: Roasted, ground, and brewed like coffee, Crio Bru Brewed Cacao has flavor and aroma of unsweetened pure dark chocolate. Instead of coffee bean grounds, it's 100% pure ground cacao.

Crio Bru Brewed Cacao has the flavor of 100% pure unsweetened pure dark chocolate. While similar in some respects to coffee, most characterize the taste experience as wonderfully distinctive.

Crio Bru Brewed Cacao is made any way that traditional coffee is brewed. You can brew it in a French Press, coffee machine (gold tone or mesh filter- no paper filters), pour over, etc. Keurig and Espresso machines are among the few options we don't recommend using.

You can also mix our grounds with your coffee grounds before brewing and make a delicious mocha. If desired you can also add your favorite creamer or sweetener. See our brewing guide for more information.

Crio Bru Brewed Cacao is 99.99% caffeine free with 10 mg caffeine per 8 oz cup (similar to a cup of decaf coffee). Brewed Cacao also has theobromine, a naturally occurring stimulant found in cacao that can be longer lasting, milder, and more pleasant than caffeine.

Per 8 oz Cup: Calories 20g; Sugars 0g; Net Carbs 1g; Fiber 2g; Fat 0g; Protein 2g; Sodium 2g; Cholesterol 0g

Ingredients: 100% Pure Ground Cacao Beans (Cocoa Beans).

Some of products such as Caramel Flavored Light Roast have natural flavored oils but do not impact the nutrition panel.

]]]]>]]>

Crio Bru Brewed Cacao is 100% pure unsweetened ground cacao that is brewed like coffee. Hot chocolate is cocoa powder (a processed component of cacao) that dissolves into hot water that also has sugar, milk powder, and additives.  

Love it?
Then keep it and enjoy.

]]]]>]]>

 

DON'T Love it?
Get a refund and return for free*

*Restrictions:
There's only one restriction really: French Presses are non-refundable. If your order includes a French Press, your refund will subtract the value of the French Press or similar equipment ($24.95). Other than that, full refunds are available if you're not totally happy on any "promotion" product on this page.

How it works:
1) Send a request for refund/return to support@criobru.com
2) Send a picture of your opened and unopened bags. Send the product back to us with a free prepaid shipping label that we provide.

3) We give you a full refund (If your order includes a French Press, we will subtract $24.95 from the refund). That's it!

]]]]>]]> {{name}} {{#if variantion }}

{{variation}} {{/if}}

]]]]]]>]]]]>]]> ]]]]]]>]]]]>]]> ]]]]>]]> ]]]]>]]> = 4.0.0"};b.REVISION_CHANGES=o;var p="[object Object]";d.prototype={constructor:d,logger:l["default"],log:l["default"].log,registerHelper:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(f.toString.call(a)===p)f.extend(this.partials,a);else{if("undefined"==typeof b)throw new h["default"]('Attempting to register a partial called "'+a+'" as undefined');this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]},registerDecorator:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple decorators");f.extend(this.decorators,a)}else this.decorators[a]=b},unregisterDecorator:function(a){delete this.decorators[a]}};var q=l["default"].log;b.log=q,b.createFrame=f.createFrame,b.logger=l["default"]},function(a,b){"use strict";function c(a){return k[a]}function d(a){for(var b=1;b",'"':""","'":"'","`":"`","=":"="},l=/[&"'`=]/g,m=/[&"'`=]/,n=Object.prototype.toString;b.toString=n;var o=function(a){return"function"==typeof a};o(/x/)&&(b.isFunction=o=function(a){return"function"==typeof a&&"[object Function]"===n.call(a)}),b.isFunction=o;var p=Array.isArray||function(a);b.isArray=p},function(a,b,c){"use strict";function d(a,b){var c=b&&b.loc,g=void 0,h=void 0;c&&(g=c.start.line,h=c.start.column,a+=" - "+g+":"+h);for(var i=Error.prototype.constructor.call(this,a),j=0;j0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=d.createFrame(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b,c)})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(5),f=c(6),g=d(f);b["default"]=function(a){a.registerHelper("each",function(a,b){function c(b,c,f){j&&(j.key=b,j.index=c,j.first=0===c,j.last=!!f,k&&(j.contextPath=k+b)),i+=d(a[b],{data:j,blockParams:e.blockParams([a[b],b],[k+b,null])})}if(!b)throw new g["default"]("Must pass iterator to #each");var d=b.fn,f=b.inverse,h=0,i="",j=void 0,k=void 0;if(b.data&&b.ids&&(k=e.appendContextPath(b.data.contextPath,b.ids[0])+"."),e.isFunction(a)&&(a=a.call(this)),b.data&&(j=e.createFrame(b.data)),a&&"object"==typeof a)if(e.isArray(a))for(var l=a.length;h1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0])1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function()n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a,unput:function(a){var b=a.length,c=a.split(/(?:rn?|n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:rn?|n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;gb[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:rn?|n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/r?n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if(""===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):""===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(b.yytext=b.yytext.substr(5,b.yyleng-9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(b.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return b.yytext=e(1,2).replace(/"/g,'"'),80;case 32:return b.yytext=e(1,2).replace(/'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return b.yytext=b.yytext.replace(/([]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},a.rules=[/^(?:[^x00]*?(?=({{)))/,/^(?:[^x00]+)/,/^(?:[^x00]{2,}?(?=({{|{{|{{|$)))/,/^(?:{{{{(?=[^/]))/,/^(?:{{{{/[^s!"#%-,./;->@[-^`{-~]+(?=[=}s/.])}}}})/,/^(?:[^x00]*?(?=({{{{)))/,/^(?:[sS]*?--(~)?}})/,/^(?:()/,/^(?:))/,/^(?:{{{{)/,/^(?:}}}})/,/^(?:{{(~)?>)/,/^(?:{{(~)?#>)/,/^(?:{{(~)?#*?)/,/^(?:{{(~)?/)/,/^(?:{{(~)?^s*(~)?}})/,/^(?:{{(~)?s*elses*(~)?}})/,/^(?:{{(~)?^)/,/^(?:{{(~)?s*elseb)/,/^(?:{{(~)?{)/,/^(?:{{(~)?&)/,/^(?:{{(~)?!--)/,/^(?:{{(~)?![sS]*?}})/,/^(?:{{(~)?*?)/,/^(?:=)/,/^(?:..)/,/^(?:.(?=([=~}s/.)|])))/,/^(?:[/.])/,/^(?:s+)/,/^(?:}(~)?}})/,/^(?:(~)?}})/,/^(?:"(["]|[^"])*")/,/^(?:'([']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}s)])))/,/^(?:false(?=([~}s)])))/,/^(?:undefined(?=([~}s)])))/,/^(?:null(?=([~}s)])))/,/^(?:-?[0-9]+(?:.[0-9]+)?(?=([~}s)])))/,/^(?:ass+|)/,/^(?:|)/,/^(?:([^s!"#%-,./;->@[-^`{-~]+(?=([=~}s/.)|]))))/,/^(?:[(]|[^]])*])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=a}function e(a,b,c)function f(a,b,c)!c?/^s*?r?n/:/^s*?(r?nfunction g(a,b,c){var d=a[null==b?0:b+1];if(d&&"ContentStatement"===d.type&&(c||!d.rightStripped)){var e=d.value;d.value=d.value.replace(c?/^s+/:/^[ t]*r?n?/,""),d.rightStripped=d.value!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"ContentStatement"===d.type&&(c||!d.leftStripped)){var e=d.value;return d.value=d.value.replace(c?/s+$/:/[ t]+$/,""),d.leftStripped=d.value!==e,d.leftStripped}}var i=c(1)["default"];b.__esModule=!0;var j=c(39),k=i(j);d.prototype=new k["default"],d.prototype.Program=function(a){var b=!this.options.ignoreStandalone,c=!this.isRootSeen;this.isRootSeen=!0;for(var d=a.body,i=0,j=d.length;i0)throw new q["default"]("Invalid path: "+d,{loc:c});".."===j&&(f++,g+="../")}}return{type:"PathExpression",data:a,depth:f,parts:e,original:d,loc:c}}function j(a,b,c,d,e,f){var g=d.charAt(3)||d.charAt(2),h="{"!==g&&"&"!==g,i=/*/.test(d);return{type:i?"Decorator":"MustacheStatement",path:a,params:b,hash:c,escaped:h,strip:e,loc:this.locInfo(f)}}function k(a,b,c,e){d(a,c),e=this.locInfo(e);var f={type:"Program",body:b,strip:{},loc:e};return{type:"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:f,openStrip:{},inverseStrip:{},closeStrip:{},loc:e}}function l(a,b,c,e,f,g){e&&e.path&&d(a,e);var h=/*/.test(a.open);b.blockParams=a.blockParams;var i=void 0,j=void 0;if(c){if(h)throw new q["default"]("Unexpected inverse block on decorator",c);c.chain&&(c.program.body[0].closeStrip=e.strip),j=c.strip,i=c.program}return f&&(f=i,i=b,b=f),{type:h?"DecoratorBlock":"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:b,inverse:i,openStrip:a.strip,inverseStrip:j,closeStrip:e&&e.strip,loc:this.locInfo(g)}}function m(a,b){if(!b&&a.length){var c=a[0].loc,d=a[a.length-1].loc;c&&d&&(b={source:c.source,start:{line:c.start.line,column:c.start.column},end:{line:d.end.line,column:d.end.column}})}return{type:"Program",body:a,strip:{},loc:b}}function n(a,b,c,e){return d(a,c),{type:"PartialBlockStatement",name:a.path,params:a.params,hash:a.hash,program:b,openStrip:a.strip,closeStrip:c&&c.strip,loc:this.locInfo(e)}}var o=c(1)["default"];b.__esModule=!0,b.SourceLocation=e,b.id=f,b.stripFlags=g,b.stripComment=h,b.preparePath=i,b.prepareMustache=j,b.prepareRawBlock=k,b.prepareBlock=l,b.prepareProgram=m,b.preparePartialBlock=n;var p=c(6),q=o(p)},function(a,b,c){"use strict";function d(){}function e(a,b,c){if(null==a||"string"!=typeof a&&"Program"!==a.type)throw new k["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a,b),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function f(a,b,c){function d(){var d=c.parse(a,b),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}function e(a,b)if(void 0===b&&(b={}),null==a||"string"!=typeof a&&"Program"!==a.type)throw new k["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var f=void 0;return e._setup=function(a),e._child=function(a,b,c,e)(f=d()),f._child(a,b,c,e),e}function g(a,b){if(a===b)return!0;if(l.isArray(a)&&l.isArray(b)&&a.length===b.length){for(var c=0;c0&&(b+=", "+c.join(", "));var d=0;for(var e in this.aliases){var f=this.aliases[e];this.aliases.hasOwnProperty(e)&&f.children&&f.referenceCount>1&&(b+=", alias"+ ++d+"="+e,f.children[0]="alias"+d)}var g=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&g.push("blockParams"),this.useDepths&&g.push("depths");var h=this.mergeSource(b);return a?(g.push(h),Function.apply(this,g)):this.source.wrap(["function(",g.join(","),") {n ",h,"}"])},mergeSource:function(a)this.source.push('return "";'):(a+=", buffer = "+(d?"":this.initializeBuffer()),f?(f.prepend("return buffer + "),g.add(";")):this.source.push("return buffer;")),a&&this.source.prepend("var "+a.substring(2)+(d?"":";n")),this.source.merge(),blockValue:function(a){var b=this.aliasable("helpers.blockHelperMissing"),c=[this.contextName(0)];this.setupHelperArgs(a,0,c);var d=this.popStack();c.splice(1,0,d),this.push(this.source.functionCall(b,"call",c))},ambiguousBlockValue:function(){var a=this.aliasable("helpers.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var c=this.topStack();b.splice(1,0,c),this.pushSource(["if (!",this.lastHelper,") { ",c," = ",this.source.functionCall(a,"call",b),"}"])},appendContent:function(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a},append:function(){if(this.isInline())this.replaceStack(function(a){return[" != null ? ",a,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var a=this.popStack();this.pushSource(["if (",a," != null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c,d)!this.options.compat,lookupBlockParam:function(a,b){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",b,1)},lookupData:function(a,b,c){a?this.pushStackLiteral("container.data(data, "+a+")"):this.pushStackLiteral("data"),this.resolvePath("data",b,0,!0,c)},resolvePath:function(a,b,c,d,e){var g=this;if(this.options.strict||this.options.assumeObjects)return void this.push(f(this.options.strict&&e,this,b,a));for(var h=b.length;c]]]]>]]> {{{table_header}}} {{#if description}} {{{description}}} {{/if}}
{{{requirement_label}}} {{#if show_discount_value}}{{{discount_label}}} {{/if}} {{#if show_discounted_price}}{{{discounted_price_label}}} {{/if}} ]]]]]]]]>]]]]]]>]]]]>]]>
{{{requirement_amount}}} {{#if show_discount_value}}{{{discount_value}}} {{/if}} {{#if show_discounted_price}}{{{discounted_price}}} {{/if}} ]]]]]]]]>]]]]]]>]]]]>]]> {{{table_header}}} {{#if set_prices}} {{#each set_prices}}
{{{../row_set_price_title}}}{{{price}}} {{/each}} {{/if}} ]]]]]]]]>]]]]]]>]]]]>]]>
]]]]>]]>0&&t(document).on("click",i.swatch_selector,function(){g(i)})}function g(i){0!=t(".quantity-breaks-now-wrapper").length&&t(".quantity-breaks-now-wrapper").remove(),b(i)}function y(i,e){var n=[];t.each(window.qb.discount_groups,function(t,i){i.appliesToProduct(window.qb.product.id,window.qb.product_collections)&&n.push(i)}),n.length>1&&E(i.multiple_groups_notice)&&t("div.quantity-breaks-now-wrapper").append(''+i.multiple_groups_notice+""),t.each(n,function(t,n){n.printDiscountTable(i,e)})}function v(i){var e=null;return t.each(window.qb.product.variants,function(t,n){n.id==i&&(e=n)}),e}function w(t){var i=n(t),e=v(i);return null!=e?e.price:null}function b(i){var e=null;e=E(i.table_placement_selector)?t(i.table_placement_selector).first():t(i.form_selector).first(),0==t(".quantity-breaks-now-wrapper").length&&e.after('');var n=w(i);y(i,n)}function T(t,i){function e(t,i){return"undefined"==typeof t?i:t}function n(t,i,n,o)null==t)return 0;t=(t/100).toFixed(i);var r=t.split("."),a=r[0].replace(/(d)(?=(ddd)+(?!d))/g,"$1"+n),s=r[1]?o+r[1]:"";return a+sif("undefined"==typeof t||null==t)return"";if("string"==typeof t&&0==t.length)return"";var o=/{{s*(w+)s*}}/;"string"==typeof t&&(t=t.replace(".",""));var r="";switch(i.match(o)[1]){case"amount":r=n(t,2);break;case"amount_no_decimals":r=n(t,0);break;case"amount_no_decimals_with_comma_separator":r=n(t,0,".",",");break;case"amount_with_comma_separator":r=n(t,2,".",",")}return i.replace(o,r)}function q(t){return Math.round(100*t)+"%"}function D(i,e){setTimeout(function(){t(i.checkout_button_selector).off("click","**"),t("#OffAmazonPaymentsWidgets0").unbind("click#OffAmazonPaymentsWidgets0"),t("#OffAmazonPaymentsWidgets0").unbind("apay-OffAmazonPayments_mec_#OffAmazonPaymentsWidgets0"),t(i.checkout_button_selector).click(function(n)(n.preventDefault(),n.stopPropagation(),x(i,e)))},1e3)}function x(n,o){if(!(t(n.agree_to_terms_selector).length>0&&t(n.agree_to_terms_selector+":checked").length!=t(n.agree_to_terms_selector).length)){t(n.checkout_button_selector).prop("disabled",!0),f(n.checkout_button_selector);var r=o.createDraftOrder();t.ajax({cache:!1,type:"POST",url:e()+"/get_checkout_url?shopify_domain="+i(),data:JSON.stringify(r),dataType:"json",contentType:"application/json; charset=utf-8",success:function(i){if(m(),t(n.checkout_button_selector).prop("disabled",!1),i.invoice_url){var e=i.invoice_url.replace("checkout.shopify.com",n.primary_domain);window.location.href=e}else alert("An error occured, and we're unable to process your order at this time. Please contact customer service for assistance. ")}})}}function P(t,i){i.updateCart(function(){var e=l();if(e.length>0){var n=new O(i,e,t);n.applyDiscounts()}var o=new L(i);h()&&o.updatePage(!1),t.ajax_cart_integration_enabled&&o.initializeAjaxCartObserver(t)})}function M(t,i){if(p()){var e=new L(i);e.setupEnv(t),_(t),b(t)}}function A(t,i){this.message=t,this.amount=i}function k(t,i){this.message=t,this.amount=i}function L(i){var e=this,n=function(i){t("head").append(''),E(i.custom_css)&&t("head").append(''+i.custom_css+"")},o=function(o){if(i.totalDiscount>0||i.hasMinTierWarnings()){var r=u();o&&!r.ajax_cart_integration_enabled||(n(r),d(r),c(r,o),s(r),a(r),i.totalDiscount>0&&D(r,e.cart),t(document).on("change",r.quantity_selector,function(i){i.preventDefault(),t(r.cart_form_selector).submit()}),t(document).on("click",r.quantity_button_selector,function(i){i.preventDefault(),i.stopPropagation(),setTimeout(function(){t(r.cart_form_selector).submit()},250)}))}},r=function(i){var e="",n=9999999;return t.each(i,function(t,i){i.amount"}),E(r)&&(0==t(".qb-discount-log").length?t(e.cart_subtotal_selector).last().append(''+r+""):t(".qb-discount-log").html(r))}},d=function(e){var n=e.money_format;if(i.totalDiscount>0){if(0==t(".qb-original-subtotal").length){var o=''+T(i.originalTotalPrice,n)+''+T(i.totalPrice,n)+"";t(e.cart_subtotal_selector).last().html(o)}else t(".qb-discounted-subtotal").html(T(i.totalPrice,n)),t(".qb-original-subtotal").html(T(i.originalTotalPrice,n));t("#qb-net-order-original-total").css("text-decoration","line-through"),t("#qb-net-order-original-total").text(T(i.originalTotalPrice,n)),t("#qb-net-order-discounted-total").text(T(i.totalPrice,n))}else t(e.cart_subtotal_selector).last().html(T(i.originalTotalPrice,n))},p=function(t,i){var e=["ajaxifyCart","cart-loading","AjaxifyCart","layer-addcart-modal"];if(E(t.mutation_ids)){var n=t.mutation_ids.replace(/ /g,""),o=n.split(",");e=e.concat(o)}return-1!==e.indexOf(i.target.id)},h=function(i,e){var n=["drawer","cart-drawer__item-list","ajaxcart__footer--fixed","cart-item__qty","mm-opened","cart-sidebar","opened","cart-preview"];if(E(i.mutation_classes)){var o=i.mutation_classes.replace(/ /g,""),r=o.split(",");n=n.concat(r)}var a=!1;return t.each(n,function(t,i){"undefined"!=typeof e.target.classList&&e.target.classList.contains(i)&&(a=!0)}),a},f=function(t,i)h(t,i),m=function(t){var e=!1,n=new MutationObserver(function(n){n.forEach(function(n){!e&&f(t,n)&&(setTimeout(function(){i.updateCart(function(){var e=l(),n=new O(i,e,t);n.applyDiscounts();var o=new L(i);o.updatePage(!0)})},250),e=!0)}),e=!1}),o={attributes:!0,childList:!0,characterData:!0,subtree:!0},r=document.body;n.observe(r,o)};this.cart=i,this.setupEnv=n,this.updatePage=o,this.showNextTierOffers=a,this.showMinTierWarnings=s,this.showDiscountLog=c,this.showDiscountedSubtotal=d,this.initializeAjaxCartObserver=m,this.checkMutations=f,this.checkMutationIds=p,this.checkMutationClasses=h}function O(i,e,n){var o=this,r=function(){t.each(o.cart.items,function(t,i){var e=o.findBestDiscountGroup(i);if(e)o.applyDiscountsToItem(i,e);else{var n=o.findLowestMinTierDiscountGroup(i);n&&o.applyMinTierWarningToItem(i,n)}});var i=o.cart.hasDiscountLogEntries(),e=o.cart.hasMinTierWarnings();i&&e&&o.changeMinTierWarningsToNextTierOffers()},a=function(){t.each(o.cart.items,function(t,i){if(""!=i.minTierWarning){var e=i.discountGroup.getMinTier();i.nextTierOffer=e.getNextTierOffer(i,o.cart),i.minTierWarning=""}})},s=function(i){var e=!1,n=0,r=0;return t.each(o.discountGroups,function(t,a){a.appliesToProduct(i.productId,i.collectionIds)&&(n=a.getDiscountAmountForProduct(i,o.cart),n>r&&(e=a,r=n))}),e},u=function(e){var n=!1,r=0,a=0,s=9999999;return t.each(o.discountGroups,function(t,o){o.appliesToProduct(e.productId,e.collectionIds)&&(r=o.getDiscountAmountForProduct(e,i),0==r&&(a=o.getMinTierAmountNeeded(),s>a&&(s=a,n=o)))}),n},c=function(t,i){t.discountGroup=i,t.minTierWarning=i.getMinTierWarning(t)},l=function(t,i){t.discountGroup=i,t.appliedDiscount=i.getAppliedDiscount(t,o.cart),o.cart.totalDiscount+=t.appliedDiscount.total_discount_amount,o.cart.totalPrice-=t.appliedDiscount.total_discount_amount,t.discountLogEntry=i.getDiscountLogEntry(t,o.cart),t.nextTierOffer=i.getNextTierOffer(t,o.cart)},d=function(t,i){return i.length>0?"apply_newest_group"==t.multiple_discount_group_behavior?[i[i.length-1]]:"apply_oldest_group"==t.multiple_discount_group_behavior?[i[0]]:i:i};this.filterDiscountGroups=d,this.discountGroups=d(n,e),this.cart=i,this.findBestDiscountGroup=s,this.findLowestMinTierDiscountGroup=u,this.applyDiscounts=r,this.applyDiscountsToItem=l,this.applyMinTierWarningToItem=c,this.changeMinTierWarningsToNextTierOffers=a}function j(i){var e=this,n=function(){return""!=e.minTierWarning},o=function(){return""!=e.discountLogEntry},r=function(){var i=[];return null!=e.properties&&t.each(Object.keys(e.properties),function(t,n){var o={};o.name=n,o.value=e.properties[n],i.push(o)}),i},a=function(){var t={};return t.title=e.title,t.variant_id=e.variantId,t.product_id=e.productId,t.image=e.image,t.quantity=e.quantity,t.grams=e.grams,t.requires_shipping=e.requiresShipping,t.price=e.price/100,t.properties=e.getLineItemPropertiesArray(),t.applied_discount=e.appliedDiscount,"undefined"!==t.applied_discount.amount&&(t.applied_discount.amount=t.applied_discount.amount),t};this.title=i.title,this.quantity=i.quantity,this.variantId=i.variant_id,this.productId=i.product_id,this.price=i.price,this.giftCard=i.gift_card,this.productTitle=i.product_title,this.variantTitle=i.variant_title,this.variantOptions=i.variant_options,this.originalPrice=i.original_price,this.originalLinePrice=i.original_line_price,this.discountedPrice=i.discounted_price,this.linePrice=i.line_price,this.collectionIds=i.collection_ids,this.properties=i.properties,this.requiresShipping=i.requires_shipping,this.grams=i.grams,this.appliedDiscount={},this.discountGroup=null,this.minTierWarning="",this.nextTierOffer="",this.discountLogEntry="",this.image=i.image,this.handle=i.handle,this.hasMinTierWarning=n,this.hasDiscountLogEntry=o,this.getLineItemHash=a,this.getLineItemPropertiesArray=r}function I(){var i=this,e=function(){var e=[];return t.each(i.items,function(t,i){e.push(i.getLineItemHash())}),e},n=function(){var e=[];return t.each(i.items,function(t,i){E(i.discountLogEntry)&&e.push(i.discountLogEntry)}),e},o=function(){var e=[];return t.each(i.items,function(t,i){E(i.minTierWarning)&&e.push(i.minTierWarning)}),e},r=function(){var e=[];return t.each(i.items,function(t,i){E(i.nextTierOffer)&&e.push(i.nextTierOffer)}),e},a=function(){var e=!1;return t.each(i.items,function(t,i){i.hasMinTierWarning()&&(e=!0)}),e},s=function(){var e=!1;return t.each(i.items,function(t,i){i.hasDiscountLogEntry()&&(e=!0)}),e},u=function(e){i.items=[],t.ajax({cache:!1,type:"GET",url:"https://"+window.location.hostname+"/cart?view=quantity-breaks-now-cart",success:function(n){n=JSON.parse(n),i.originalTotalPrice=n.original_total_price,i.totalDiscount=n.total_discount,i.totalPrice=n.total_price,i.totalWeight=n.total_weight,i.itemCount=n.item_count;var o=[];t.each(n.items,function(t,i){o.push(new j(i))}),i.items=o,e()}})},c=function(){var t={};return t.line_items=JSON.stringify(i.getLineItemsHash()),t};this.items=[],this.originalTotalPrice=0,this.totalDiscount=0,this.totalPrice=0,this.totalWeight=0,this.itemCount=0,this.hasMinTierWarnings=a,this.hasDiscountLogEntries=s,this.updateCart=u,this.getDiscountLogEntries=n,this.getMinTierWarnings=o,this.getNextTierOffers=r,this.getLineItemsHash=e,this.createDraftOrder=c}function C(i,e){var n=function(t){var i=Math.floor(this.discountAmount),e={};return i>t.price&&(i=t.price),e.discount_amount=i,e.total_discount_amount=i*t.quantity,e.value_type="fixed_amount",e.description="Fixed Amount Discount",e.title="Fixed Amount Discount",e.value=i/100,e.amount=i*t.quantity/100,e},o=function(t){var i={};return i.value=Math.floor(100*this.discountPercent),i.discount_amount=Math.floor(Math.floor(t.price*i.value)/100),i.total_discount_amount=Math.floor(Math.floor(t.price*i.value*t.quantity)/100),i.value_type="percentage",i.description="Percentage Discount",i.title="Percentage Discount",i.amount=Math.floor(Math.floor(t.price*i.value*t.quantity)/100)/100,i},r=function(t,i)null==i.originalTotalPrice,a=function(){return this.minCartValue},s=function(){var t=u(),i=t.min_cart_value_warning.replace("{{amount}}",T(this.getAmount(),t.money_format));return new k(i,this.getAmount())},c=function(){var t=u(),i=t.next_tier_offer.replace("{{amount}}",T(this.getAmount(),t.money_format));return new A(i,this.getAmount())},l=function(t,i),d=function(){return this.minCartQuantity},p=function(){var t=u(),i=t.min_cart_quantity_warning.replace("{{amount}}",this.getAmount());return new k(i,this.getAmount())},h=function(){var t=u(),i=t.next_tier_cart_quantity_offer.replace("{{amount}}",this.getAmount());return new A(i,this.getAmount())},f=function(t),m=function(){return this.minLineItemValue},_=function(t){var i=u(),e=i.min_line_item_value_warning.replace("{{amount}}",T(this.getAmount(),i.money_format)).replace("{{product}}",''+t.title+"");return new k(e,this.getAmount())},g=function(t){var i=u(),e=i.next_tier_line_item_value_offer.replace("{{amount}}",T(this.getAmount(),i.money_format)).replace("{{product}}",''+t.title+"");return new A(e,this.getAmount())},y=function(t),v=function(){return this.minLineItemQuantity},w=function(t){var i=u(),e=i.min_line_item_quantity_warning.replace("{{amount}}",this.getAmount()).replace("{{product}}",''+t.title+"");return new k(e,this.getAmount())},b=function(t){var i=u(),e=i.next_tier_line_item_quantity_offer.replace("{{amount}}",this.getAmount()).replace("{{product}}",''+t.title+"");return new A(e,this.getAmount())},D=function(i,e,n){var o="",r="";switch(this.type){case"MinimumCartValueTier":o=T(this.minCartValue,e.money_format);break;case"MinimumCartQuantityTier":o=this.minCartQuantity;break;case"MinimumLineItemQuantityTier":o=this.minLineItemQuantity;break;case"MinimumLineItemValueTier":o=T(this.minLineItemValue,e.money_format)}switch(i.discountType){case"percentage":r=q(this.discountPercent);var a=n*(1-this.discountPercent);a=T(a,e.money_format);break;case"fixed_amount":r=T(this.discountAmount,e.money_format);var a=n-this.discountAmount;0>a&&(a=0),a=T(a,e.money_format)}var s=t("#quantity-breaks-now-discount-tiers-table-row").html(),u={requirement_amount:o,discount_value:r,discounted_price:a,show_discount_value:i.showDiscountValue,show_discounted_price:i.showDiscountedPrice},c=Handlebars.compile(s),l=c(u);t("div.quantity-breaks-now-wrapper #discount-group-"+i.id+" table tbody").append(l)};this.discountAmount=i.discount_amount,this.discountPercent=i.discount_percent,this.discountType=i.discount_type,this.id=i.id,this.minCartValue=i.min_cart_value,this.minLineItemValue=i.min_line_item_value,this.minCartQuantity=i.min_cart_quantity,this.minLineItemQuantity=i.min_line_item_quantity,this.type=e,"MinimumCartValueTier"==this.type?(this.appliesTo=r,this.getAmount=a,this.getMinTierWarning=s,this.getNextTierOffer=c):"MinimumCartQuantityTier"==this.type?(this.appliesTo=l,this.getAmount=d,this.getMinTierWarning=p,this.getNextTierOffer=h):"MinimumLineItemValueTier"==this.type?(this.appliesTo=f,this.getAmount=m,this.getMinTierWarning=_,this.getNextTierOffer=g):(this.appliesTo=y,this.getAmount=v,this.getMinTierWarning=w,this.getNextTierOffer=b),"fixed_amount"==this.discountType?this.getAppliedDiscount=n:this.getAppliedDiscount=o,this.printDiscountTier=D}function W(i){var e=this,n=function(i,n){if(null!=n){var o=null;return t.each(e.discountTiers,function(t,e){e.appliesTo(i,n)&&(o=e)}),o}return e.discountTiers},o=function(i,e){if(V(i)){var n=[];return t.each(i,function(t,i){n.push(new C(i,e))}),n}return[]},r=function(t,i){var n=!1,o=e.getDiscountTier(t,i);return o&&(n=o.getAppliedDiscount(t),n=n.amount),n},a=function(i,n){var o=!1,r=!1;return t.each(e.discountTiers,function(t,e){e.appliesTo(i,n)?o=e:o&&r===!1&&(r=e)}),r},s=function(){return e.discountTiers.length>0?e.discountTiers[0]:!1},c=function(){var t=e.getMinTier();return t?t.getAmount():!1},l=function(i){var n=!1;return t.each(e.products,function(t,e){e.shopify_product_id==i&&(n=!0)}),n},d=function(){return!0},p=function(i,n){var o=!1;return t.each(n,function(i,n){t.each(e.collections,function(t,i){i.shopify_collection_id==n&&(o=!0)})}),o},h=function(i,n){if(e.showDiscountTable){var o="";switch(e.discountTierType){case"MinimumCartValueTier":o=i.minimum_cart_value_label;break;case"MinimumCartQuantityTier":o=i.minimum_cart_quantity_label;break;case"MinimumLineItemQuantityTier":o=i.minimum_line_item_quantity_label;break;case"MinimumLineItemValueTier":o=i.minimum_line_item_value_label}var r=t("#quantity-breaks-now-discount-tiers-table").html(),a={requirement_label:o,discount_label:i.discount_label,table_header:e.title,discount_group_id:e.id,description:e.description,discounted_price_label:i.discounted_price_label,show_discount_value:e.showDiscountValue,show_discounted_price:e.showDiscountedPrice},s=Handlebars.compile(r),u=s(a);t("div.quantity-breaks-now-wrapper").append(u);var c={discountType:e.discountType,id:e.id,showDiscountValue:e.showDiscountValue,showDiscountedPrice:e.showDiscountedPrice};t.each(e.discountTiers,function(t,e){e.printDiscountTier(c,i,n)})}},f=function(t,i){var e=n(t,i);return e.getAppliedDiscount(t)},m=function(t){var i=u(),n="",o=t.appliedDiscount;return n=i.discount_log_text,n=n.replace("{{total_discount_amount}}",T(Math.floor(o.total_discount_amount),i.money_format)),n=n.replace("{{discount_amount}}",T(Math.floor(o.discount_amount),i.money_format)),n=n.replace("{{product_title}}",t.title),n=n.replace("{{discount_group_title}}",e.title),n=n.replace("{{quantity}}",t.quantity),n=n.replace("{{discount_percent}}",q(o.value/100))},_=function(t,i){var e=a(t,i);return e?e.getNextTierOffer(t,i):""},g=function(t){var i=s(t);return i?i.getMinTierWarning(t):""};this.products=i.products||[],this.collections=i.collections||[],this.cartLabel=i.cart_label||"",this.description=i.description||"",this.discountEnabled=i.discount_enabled||!1,this.discountTierType=i.discount_tier_type||"MinimumCartValueTier",this.discountType=i.discount_type||"percentage",this.showDiscountTable=i.show_discount_table||!1,this.showDiscountValue=i.show_discount_value||!1,this.showDiscountedPrice=i.show_discounted_price||!1,this.title=i.title||"",this.groupType=i.type||"all",this.createDiscountTierObjects=o,this.discountTiers=this.createDiscountTierObjects(i.discount_tiers,i.discount_tier_type),this.id=i.id,"ProductDiscount"==this.groupType?this.appliesToProduct=l:"AllDiscount"==this.groupType?this.appliesToProduct=d:"CollectionDiscount"==this.groupType&&(this.appliesToProduct=p),this.getDiscountAmountForProduct=r,this.getDiscountTier=n,this.printDiscountTable=h,this.getMinTier=s,this.getMinTierAmountNeeded=c,this.getNextTier=a,this.getAppliedDiscount=f,this.getDiscountLogEntry=m,this.getNextTierOffer=_,this.getMinTierWarning=g}function N(){return window.qb.discount_groups=[],t.each(c(),function(t,i){i.discount_enabled&&window.qb.discount_groups.push(new W(i))}),!!V(window.qb.discount_groups)}function E(t){return null!=t&&""!=t&&"undefined"!=typeof t}function Q(t){return"undefined"!=typeof t}function V(t){return null!=t&&"undefined"!=typeof t&&t.length>0}function S(){var t=u();if(t&&(""==d()||!t.disable_for_logged_in_customers)){var i=N();if(i){var e=new I;V(window.qb.discount_groups)&&M(t,e),P(t,e)}}}t(document).ready(function(){t.getScript("https://cdnjs.cloudflare.com/ajax/libs/spin.js/2.3.2/spin.min.js"),Q(window.qb)&&"undefined"==typeof window.qb.running&&(window.qb.running=!0,s()?S():a())})};"undefined"==typeof jQuery||parseFloat(jQuery.fn.jquery)<1.7?loadScript("//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js",function(){var t=jQuery.noConflict(!0);myFrontendJavascriptQB(t)}):myFrontendJavascriptQB(jQuery); ]]]]]]]]>]]]]]]>]]]]>]]> ]]]]>]]> ]]]]>]]>]]]]>]]> expiration) { // expired localStorage.removeItem('nvdconfig'); nvd_config = null; prefetch(); } // var tomorrow = new Date(); // tomorrow.setDate(today.getDate()+3); useConsole('Navidium config avaialable in storage'); } else { useConsole('Navidium config not available in storage'); await fetch( `https://app.navidiumapp.com/api/widget-v8.php?shop_url=${nvdShop}` ) .then((res) => res.json()) .then((initialData) => { useConsole(initialData); showWidget = initialData.nvd_show_cart; autoInsurance = initialData.nvd_auto_insurance; let today = new Date() // extract the configuration data let shopConfig = { success: initialData.success, show_on_cart: initialData.nvd_show_cart, show_on_checkout: initialData.nvd_show_checkout, auto_insurance: initialData.nvd_auto_insurance, nvd_name: initialData.nvd_name, product_exclusion: initialData.product_exclusion.split(','), nvd_subtitle: initialData.nvd_subtitle, nvd_description: initialData.nvd_description, nvd_message: initialData.nvd_message, protection_variants: initialData.nvd_variants, min_protection_price: initialData.min_protection_value, max_protection_price: initialData.max_protection_value, protection_type: initialData.nvd_protection_type, protection_percentage: initialData.nvd_protection_type_value, min_protection_variant: initialData.min_variant_id, max_protection_variant: initialData.max_variant_id, expiration: today.setDate(today.getDate() + 3), widget_location: initialData.widget_location, widget_icon : initialData.nvd_widget_icon, learnMore: initialData?.nvd_learn_more, rounding_value: initialData.rounding_value, maxThreshold: initialData.threshold_value, }; // store into localStorage localStorage.setItem('nvdconfig', JSON.stringify(shopConfig)); if (callback) return callback(); }).catch(err => { console.log('%c navidium error', 'color: yellow; background-color: red; font-size: 12px', err); }); } }; const calculateProtection = async (cartTotal, nvdConfig) => { let conversionRate = parseFloat(Shopify.currency.rate); let convertedTotal = cartTotal/ conversionRate; let protectionType = nvdConfig.protection_type; let protectionPercentage = nvdConfig.protection_percentage; let protectionId; let protectionPrice; let minPrice = Number(nvdConfig.min_protection_price); let maxPrice = Number(nvdConfig.max_protection_price); let minId = nvdConfig.min_protection_variant; let maxId = nvdConfig.max_protection_variant; let protectionVariants = nvdConfig.protection_variants; // TODO: check protection type if (protectionType == '1') { // protection is dynamic let ourProtectionPrice = (convertedTotal * protectionPercentage) / 100; ourProtectionPrice = ourProtectionPrice.toFixed(2); // calculate the protection if (ourProtectionPrice maxPrice) { console.log('Our protection price is greater than maximum'); protectionPrice = maxPrice; protectionId = maxId; return { price: protectionPrice, variant_id: protectionId } } else { console.log('calculating protection') function findClosest(arr, target) { let finalOutput = 0.00; let n = arr.length; target = parseFloat(target); let current; for (let i = 0; i = parseFloat(arr[i]) && target <= parseFloat(arr[i + 1])) { finalOutput = arr[i + 1]; break; } else if (target a - b); protectionPrice = findClosest(priceArray, ourProtectionPrice); if (protectionPrice == 0) { return { price: maxPrice, variant_id: maxId } } protectionId = protectionVariants[protectionPrice]; return { price: protectionPrice, variant_id: protectionId } } } else { // protection is static.so hit the api console.log('protection is static'); let apiURL = await fetch(`https://app.navidiumapp.com/api/variant-id-checker-api-march6.php?shop_url=${nvdShop}&price=` + convertedTotal); let data = apiURL.json(); return data; } } const nvd_init = async () => { let shopCurrency = '${{amount}} USD'; console.time('nvd_init'); localStorage.setItem('nvd_running', true); // TODO: check nvd_config in localStorage let shopConfig = localStorage.getItem('nvdconfig') ? JSON.parse(localStorage.getItem('nvdconfig')) : null; // check if shop config data is available in localStorage if (shopConfig) { useConsole('Navidium config avaialable in storage'); } else { // if not available, fetch from server and store in localStorage useConsole('Navidium config not avaialable in storage. Prefetching now'); await prefetch(nvd_init); return; } let cartProtectionVariant = localStorage.getItem('cart_protection') ? localStorage.getItem('cart_protection') : null; let opted_out = JSON.parse(localStorage.getItem('nvd_opted_out')); let showWidget = true; if (shopConfig.show_on_cart == "0") { showWidget = false; } useConsole('showWidget', showWidget); let success = true; if (shopConfig.success == "0") { success = false; } let checked; let nvd_variant; useConsole('in cart protection variant', cartProtectionVariant); // check if widget should be shown and limit did not exceeded if (showWidget == true && success == true) { let cart = await getCartCallback(checkCart); let cartTotal = await cart.total / 100; let currency = await cart.currency; useConsole('after exclusion total price is', cartTotal); // Max threshold let maxThresholdPrice = parseFloat(shopConfig.maxThreshold); maxThresholdPrice = (maxThresholdPrice * parseFloat(Shopify.currency.rate)).toFixed(2); // console.log('%cNVD Max threshold','background:blue;color:#fff;padding:2px 5px; border-radius:10px;',maxThresholdPrice); // End of max threshold let getProtection = await calculateProtection(cartTotal, shopConfig); let variantFromApi = await getProtection.variant_id; let priceFromApi = await getProtection.price; useConsole('apiJson', getProtection); if (cartTotal == 0 || maxThresholdPrice { item.innerHTML = buildWidget( shopConfig, priceFromApi, nvd_variant, checked ? 'checked' : '' ); }); checkWidgetView(); } else { useConsole( 'cart variant and api variant is not same.swapping them now' ); nvd_variant = variantFromApi; // now remove the previous navidium variant from cart if (cartProtectionVariant) { // now add the new protection to the cart if (checked) { useConsole('removing old and adding new protection'); await removeAndAddProtection( cartProtectionVariant, variantFromApi, false ); } } // now append the snippet if (document.querySelector('.nvd-mini')) document.querySelectorAll('.nvd-mini').forEach((item) => { item.innerHTML = buildWidget( shopConfig, priceFromApi, nvd_variant, checked ? 'checked' : '' ); }); checkWidgetView(); } } else { if (checked) { useConsole( 'Protection Not available. Adding now.', cartProtectionVariant, variantFromApi ); nvd_variant = variantFromApi; await addProtection(Number(variantFromApi), 1, false); if (document.querySelector('.nvd-mini')) document.querySelectorAll('.nvd-mini').forEach((item) => { item.innerHTML = buildWidget( shopConfig, priceFromApi, nvd_variant, checked ? 'checked' : '' ); }); checkWidgetView(); } else { nvd_variant = variantFromApi; useConsole('no protection available, just append snippet'); if (document.querySelector('.nvd-mini')) document.querySelectorAll('.nvd-mini').forEach((item) => { item.innerHTML = buildWidget( shopConfig, priceFromApi, nvd_variant, checked ? 'checked' : '' ); }); checkWidgetView(); } } } } else { // when navidium widget is shut off console.log( '%c Navidium Message:widget is shut off or limit reached.Please turn on from your app settings or check you have not exceeded your limit', 'color: yellow; background-color: blue; font-size: 12px' ); } console.timeEnd('nvd_init'); localStorage.setItem('nvd_running', false); updateWidgetPrice(); }; // function to get cart data and pass the data to another callback for processing. const getCartCallback = async (callback) => { let cart = await fetch('/cart.js'); let cartData = await cart.json(); if (callback) return callback(cartData); return cartData; }; // function to check cart items const checkCart = async (cartData, callback = null) => { let currency = await cartData.currency; useConsole('cart in check cart', cartData); if (cartData.items.length != 0) { let items = cartData.items; let total = parseFloat(cartData.total_price); let initialTotal = cartData.total_price; let nvd_counter_array = []; let recheck = false; let dupeVariant; let counter = items.length; let shopConfig = localStorage.getItem('nvdconfig') ? JSON.parse(localStorage.getItem('nvdconfig')) : null; let excludedSKUs = shopConfig.product_exclusion; // if no shop config is found wait and call prefetch if (!shopConfig) { await prefetch(); } useConsole('product exclusion', excludedSKUs); let promises = await items.forEach((item) => { // check for duplicate navidium if (item.handle.includes('navidium-shipping-protection')) { nvd_counter_array.push(item.variant_id); useConsole('protection available in cart'); localStorage.setItem('cart_protection', item.variant_id); total = total - item.final_line_price; useConsole('nvd1', total); if (item.quantity > 1) { useConsole('Found duplicate protection in cart,decreasing now'); recheck = true; dupeVariant = item.variant_id; } else { useConsole('protection duplication test passed'); } } else { counter = counter + item.quantity; excludedSKUs.forEach((sku) => { if (item.sku == sku) { console.log( '%c Navidium Message:Product is excluded', 'color: yellow; background-color: blue; font-size: 16px', item.sku, item.final_price ); // substract the item price from total total = total - item.final_line_price; useConsole('ex1', total); } }); } }); if (recheck == true) { let mutateCart = adjustProtectionQuantity(dupeVariant, 0, false); useConsole('calling checkCart function recursively', mutateCart); getCartCallback(checkCart); } if (nvd_counter_array.length > 1) { console.log( '%cfound more than one variant of navidium protection in cart,removing all now', 'color:red' ); await nvd_counter_array.forEach((item) => { useConsole('removing variant', item); adjustProtectionQuantity(item, 0); localStorage.removeItem('cart_protection'); recheck = false; }); } if (nvd_counter_array.length == 0) { useConsole('No protection available in cart'); localStorage.removeItem('cart_protection'); } if (nvd_counter_array.length == items.length) { useConsole('no items in cart rather than protection'); fetch('/cart/clear.js').then((res) => { useConsole('cart cleared'); location.reload(); localStorage.removeItem('cart_protection'); }); } // if recheck is true and duplicate protection is available call checkCart the function recursively return { total: parseFloat(total), currency: currency, }; } else { return { total: 0, currency: currency, }; } }; // function to add protection to cart const addProtection = async (variantId, quantity = 1, reload = false) => { const id = parseInt(variantId); if (document.querySelectorAll('[name="checkout"]')) document.querySelectorAll('[name="checkout"]').forEach(elem => elem.disabled = true) let cartData; var request = { method: 'POST', headers: { 'Content-Type': 'application/json;', Accept: 'application/json', }, body: JSON.stringify({ id: id, quantity: quantity, }), }; cartData = await fetch('/cart/add.js', request); let cartJson = await cartData.json(); if (cartJson.id) { console.log( '%c Protection added successfully', 'color: white; background-color: green' ); updateLiveCart(null); if (document.querySelectorAll('[name="checkout"]')) document.querySelectorAll('[name="checkout"]').forEach(elem => elem.disabled = false) } else { if (document.querySelectorAll('[name="checkout"]')) document.querySelectorAll('[name="checkout"]').forEach(elem => elem.disabled = false) } console.dir(cartJson); localStorage.setItem('nvd_opted_out', false); localStorage.setItem('cart_protection', variantId); checkWidgetView(); if (reload == true) { location.reload(); } else { return cartJson; } }; // function to remove protection const removeProtection = async (variantId, reload = false) => { if (document.querySelectorAll('[name="checkout"]')) document.querySelectorAll('[name="checkout"]').forEach(elem => elem.disabled = true) var request = { method: 'POST', headers: { 'Content-Type': 'application/json;', Accept: 'application/json', }, body: JSON.stringify({ id: String(variantId), quantity: 0, }), }; cartData = await fetch('/cart/change.js', request); let cartJson = await cartData.json(); localStorage.setItem('nvd_opted_out', true); localStorage.removeItem('cart_protection'); if (cartJson.token) { if (document.querySelectorAll('[name="checkout"]')) document.querySelectorAll('[name="checkout"]').forEach(elem => elem.disabled = false) console.log( '%c Protection removed successfully', 'color: white; background-color: red' ); updateLiveCart(cartJson); } else { if (document.querySelectorAll('[name="checkout"]')) document.querySelectorAll('[name="checkout"]').forEach(elem => elem.disabled = false) } checkWidgetView(); if (reload == true) { location.reload(); } else { return cartJson; } }; // function to update protection variant from cart const adjustProtectionQuantity = async ( variantId, quantity, reload = false ) => { let cartData; var request = { method: 'POST', headers: { 'Content-Type': 'application/json;', Accept: 'application/json', }, body: JSON.stringify({ id: String(variantId), quantity: String(quantity), }), }; cartData = await fetch('/cart/change.js', request); let cartJson = await cartData.json(); console.log( '%cnew cart instance after duplicate protection quantity decrease', 'color:yellow', cartJson ); location.reload(); console.dir(cartJson); updateLiveCart(cartJson); if (reload == true) { location.reload(); } else { return cartJson; } }; let updateWidgetPrice = async () => { useConsole('updating widget price'); let cartData = await fetch('/cart.js').then(res => res.json()); let widget = document.querySelector('#nvd-widget-cart'); if (widget == null) return; let shopCurrency = '${{amount}} USD'; let items = await cartData.items; items.forEach((item) => { useConsole(item); if (item.handle.includes('navidium-shipping-protection')) { useConsole(' updating navidium price') let price = Shopify.formatMoney(item.price, shopCurrency); let priceElem = document.querySelector('.shipping-protection-price'); if (priceElem) priceElem.innerHTML = price; } }); }; // function remove and add protection to cart const removeAndAddProtection = async (remove, add, reload = false) => { if (document.querySelectorAll('[name="checkout"]')) document.querySelectorAll('[name="checkout"]').forEach(elem => elem.disabled = true) const removeRequest = { method: 'POST', headers: { 'Content-Type': 'application/json;', Accept: 'application/json', }, body: JSON.stringify({ id: String(remove), quantity: 0, }), }; const addRequest = { method: 'POST', headers: { 'Content-Type': 'application/json;', Accept: 'application/json', }, body: JSON.stringify({ id: String(add), quantity: 1, }), }; await fetch('/cart/change.js', removeRequest) .then((res) => res.json()) .then((data) => { useConsole('removed and now adding'); fetch('/cart/add.js', addRequest) .then((res) => res.json()) .then((data) => { if (data.id) { console.log( '%c Protection swapped successfully', 'color: white; background-color: green' ); updateLiveCart(null); if (document.querySelectorAll('[name="checkout"]')) document.querySelectorAll('[name="checkout"]').forEach(elem => elem.disabled = false) } localStorage.setItem('nvd_opted_out', false); localStorage.setItem('cart_protection', add); if (reload) { location.reload(); } }).catch(err => { if (document.querySelectorAll('[name="checkout"]')) document.querySelectorAll('[name="checkout"]').forEach(elem => elem.disabled = false) }); }); }; // widget switch on/off listener function const getShippingProtection = async (variantId, price, element) => { if (!element.checked) { useConsole('unchecking and removing protection'); await removeProtection(variantId); } else { useConsole('checked and adding protection'); await addProtection(parseInt(variantId), 1); } setTimeout(()=>{ if(typeof SLIDECART_UPDATE == 'function'){ SLIDECART_UPDATE(); updateLiveCart(); } },2500) }; // function to update subtotal and dom cart item's line id const updateLiveCart = async (cartData = null) => { let cart = cartData; if (cart == null) cart = await getCartCallback(); let shopCurrency = '${{amount}}'; let totalPrice = Shopify.formatMoney(cart.total_price, shopCurrency); let cartItems = cart.items; let totalCount = cart.item_count; let opted_out = Boolean(JSON.parse(localStorage.getItem('nvd_opted_out'))); if(localStorage.getItem('nvd_opted_out') == null){ opted_out = true; } // change the cart item class name here. let lineAttribute = 'data-line'; let quantityPlus = 'qty_plus'; let quantityMinus = 'qty_minus'; let removeItem = '.remove'; let totalElem = document.querySelectorAll('[data-subtotal] span.money'); let cartCountElem = document.querySelectorAll('.cart-count, .floating-cart-bubble'); let cartItemNodes = document.querySelectorAll('.item'); let cartItemsList = Array.from(cartItemNodes); // if not opted out show one less in count console.log('Opted out message',opted_out) if (!opted_out) current_count = totalCount - 1; if (opted_out) current_count = totalCount; if (cart.item_count == 0) current_count = 0; useConsole('current and cart count', current_count, totalCount); if (totalElem) totalElem.forEach((elem) => (elem.innerHTML = totalPrice)); if (cartCountElem) cartCountElem.forEach((elem) => (elem.innerHTML = current_count)); await updateCartLine( lineAttribute, cartItemsList, cartItems, quantityPlus, quantityMinus, removeItem ); }; // function to update the line index in dom cart line items let updateCartLine = async ( lineAttribute, cartItemsList, cartItems, qtyPlus, qtyMinus, rmvItem ) => { useConsole(cartItemsList, lineAttribute); // for every line item in cart dom check with the cart items. await cartItemsList.forEach((item) => { if (item.innerHTML.toString().includes('/products/navidium-shipping-protection') == true) { item.style.display = 'none' } cartItems.forEach((cartItem, index) => { if (item.innerHTML.toString().includes(cartItem.url)) { useConsole(item.querySelector(`[${lineAttribute}]`)); let lineItem = item.querySelectorAll(`[${lineAttribute}]`); let removeItem = item.querySelectorAll(rmvItem); let quantityPlus = item.querySelectorAll(qtyPlus); let quantityMinus = item.querySelectorAll(qtyMinus); if (lineItem) lineItem.forEach((item) => item.setAttribute(lineAttribute, index + 1) ); if (quantityPlus) quantityPlus.forEach((item) => item.setAttribute( 'data-href', `/cart/change?quantity=${cartItem.quantity + 1}&line=${index + 1 }` ) ); if (quantityMinus) quantityMinus.forEach((item) => item.setAttribute( 'data-href', `/cart/change?quantity=${cartItem.quantity - 1}&line=${index + 1 }` ) ); if (removeItem) removeItem.forEach((item) => item.setAttribute( 'href', `/cart/change?line=${index + 1}&quantity=0` ) ); useConsole('line id updated'); } }); }); }; // opt in message toggle function const checkWidgetView = () => { let optedOut = localStorage.getItem('nvd_opted_out'); let selected = document.querySelectorAll('.nvd-selected'); let deselected = document.querySelectorAll('.nvd-dis-selected'); if (optedOut == 'true') { selected.forEach(elem => { elem.style.display = 'none' }) deselected.forEach(elem => { elem.style.display = 'block' }) } else { selected.forEach(elem => { elem.style.display = 'block' }) deselected.forEach(elem => { elem.style.display = 'none' }) } }; // function that will track the widget real time const trackWidget = () => { let nvd_running = localStorage.getItem('nvd_running'); let startTracking = setInterval(() => { let nvdContainer = document.querySelector('.nvd-mini'); let hasWidget; if (nvdContainer) hasWidget = nvdContainer.innerHTML.length; if (hasWidget { let shopCurrency = '${{amount}} USD'; let nvd_name = shopConfig.nvd_name; let nvd_subtitle = shopConfig.nvd_subtitle; let nvd_description = shopConfig.nvd_description; let nvd_message = shopConfig.nvd_message; let protection_price = priceFromApi; let protected_variant = nvd_variant; let widgetIcon = shopConfig.widget_icon; let learnMore = shopConfig.learnMore; let protection_checkbox = checked ? 'checked' : '' let selectedStyle = protection_checkbox ? "'display: block'" : "'display: none'"; let diselectedStyle = protection_checkbox ? "'display: none'" : "'display: block'"; var snippet = ` Navidium icon

${nvd_name}

]]]]>]]> ]]]]>]]> ]]]]>]]> } ]]]]>]]>

]]]]>]]>

{ const nameEQ = name + '='; const ca = document.cookie.split(';'); for (let i = 0; i ]]]]]]>]]]]>]]>


Source

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *


Related

Posts