PageSourceSearch

https://www.graf-von-faber-castell.com/dist/FC.Ecom/modules/ProductReviewRatingForm.47e7d93a.js

js graf-von-faber-castell.com collected 2026-10-02 18:40:05 UTC 5,513 bytes, 1 lines download raw bytes

1"use strict";(self["FC.EcomwebpackJsonp"]=self["FC.EcomwebpackJsonp"]||[]).push([[8591],{45477:(e,t,o)=>{o.r(t),o.d(t,{default:()=>c});var n=o(65638),r=(o(71913),o(98530)),i=function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function c(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,c)}s((n=n.apply(e,t||[])).next())}))},a=function(e,t){var o,n,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,n&&(r=2&i[0]?n.return:i[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,i[1])).done)return r;switch(n=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{o=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};const c=new(function(){function e(e){var t=this;this.container=n(e),this.dialog=document.querySelector("#write-review-modal"),this.successDialog=document.querySelector("#send-review-success-modal"),this.dialog.addEventListener("close",(function(){t.clearFormErrors(),t.closeDialog()})),this.successDialog.addEventListener("close",(function(){t.closeDialog()}));var o=this.dialog.showModal;this.dialog.showModal=function(){o.call(t.dialog),t.openDialog()};var r=this.successDialog.showModal;this.successDialog.showModal=function(){r.call(t.successDialog),t.openDialog()},n(".btn--primary",this.container).click((function(e){return t.sendReview(t.container,e)})),n(".close-modal, .modal-close",this.container).click((function(e){t.dialog.close()})),n(".close-modal, .modal-close",this.successDialog).click((function(e){t.successDialog.close()})),this.clickOutside(this.dialog),this.clickOutside(this.successDialog);var i=this.successDialog.querySelector('form[data-module="AddToNewsletter"]');i&&i.addEventListener("submit",(function(e){var o=n(i).validate();console.log(o.valid(),"newsletterFormValidation.valid()"),o.valid()&&t.successDialog.close()}))}return e.prototype.openDialog=function(){document.body.classList.add("lock-screen"),document.querySelector("html").classList.add("lock-screen")},e.prototype.closeDialog=function(){document.body.classList.remove("lock-screen"),document.querySelector("html").classList.remove("lock-screen")},e.prototype.clickOutside=function(e){e.addEventListener("click",(function(t){if(t.target===e){var o=e.getBoundingClientRect();(t.detail>0&&t.clientY<o.top||t.clientY>o.bottom||t.clientX<o.left||t.clientX>o.right)&&e.close()}}))},e.prototype.sendReview=function(e,t){var o=this;if(t.preventDefault(),"False"!=this.container.attr("data-dynamic")){var r={rating:n("input[name=rating-input-radio]:checked",this.container).val(),name:n("<div/>").html(n("input[name=name]",this.container).val()).text(),headline:n("<div/>").html(n("input[name=headline]",this.container).val()).text(),text:n("<div/>").html(n("textarea[name=review]",this.container).val()).text(),productSku:document.querySelector("[data-product-id]").dataset.productId};n("#review-form").valid()&&this.writeReviewAjax(r).then((function(e){if(200===e)o.dialog.close(),o.clearFormErrors(),o.resetForm(),o.showSuccessModal();else{var t=n("#review-form-technical-error",o.container);t.text(t.attr("data-message"))}})).finally(this.removeLoader)}else{this.startLoader();setTimeout((function(){o.dialog.close(),o.showSuccessModal(),o.removeLoader()}),1e3)}},e.prototype.writeReviewAjax=function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,r.default.client.post(r.default.getProductsEndpoint()+"/reviews",e)];case 1:return[2,o.sent().status];case 2:return t=o.sent(),console.error("Error retrieving review information:",t),[3,3];case 3:return[2]}}
1))}))},e.prototype.showSuccessModal=function(){this.successDialog.showModal()},e.prototype.ieFixRefreshFunction=function(){var e="refreshElement";this.container.addClass(e),this.container.removeClass(e)},e.prototype.getAjaxUrl=function(e){return this.startLoader(),e+(e.indexOf("?")>=0?"&":"?")+"ajax_context="+window.location.pathname},e.prototype.startLoader=function(){this.container.append('<div class="ajax-loader"></div>')},e.prototype.removeLoader=function(){n(".ajax-loader").remove()},e.prototype.resetForm=function(){var e=n("#review-form",this.container);e.find('input:not([type="radio"])').val(""),e.find(".field.focused").removeClass("focused"),e.find("textarea").val(""),e.find('input[name="AcceptLegal"]').prop("checked",!1),e.find(".rating #rating-input-radio-5").prop("checked",!0).trigger("change")},e.prototype.clearFormErrors=function(){n("#review-form",this.container).validate().resetForm(),n(".field.error",this.container).removeClass("error"),n(".input.error",this.container).removeClass("error")},e}())(".review-form-modal")}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.