1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6098],{56098:(t,e,r)=>{r.r(e),r.d(e,{default:()=>m});var s=r(22335),i=r(72505),n=r.n(i);function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,s)}return r}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){a(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function a(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var s=r.call(t,e||"default");if("object"!=f(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==f(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var s,i,n,o,u=[],a=!0,l=!1;try{if(n=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;a=!1}else for(;!(a=(s=n.call(r)).done)&&(u.push(s.value),u.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{if(!a&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,s=Array(e);r<e;r++)s[r]=t[r];return s}function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}const b={name:"r-form",props:{url:{required:!1,type:String,description:"url where the form will be posted"},method:{required:!1,type:String,default:"post"},formClass:{required:!1,type:String,default:"form-class"},buttonClass:{required:!1,type:String,default:"btn-lg submit"},formData:{required:!1,type:Object},buttonText:{required:!1,type:String,default:"Submit"},emitBeforeSubmit:{required:!1,type:Boolean,default:!1,description:'If true, we emit the event "aboutToSubmit" with the submit function as a callback that needs to be called by the parent eg: r-audio.vue'},hideSave:{required:!1,type:Boolean,default:!1,description:"Hide the save button"},buttonRight:{required:!1,type:Boolean,default:!1,description:"Display form on right side of form"},submitOnChange:{type:Boolean,required:!1,default:!1,description:"Save on form data change"},useFormData:{type:Boolean,required:!1,default:!1,description:"Use FormData javascript object or just put form data in object if false"},hideFormOnSuccess:{type:Boolean,required:!1,default:!1,description:"When the form is submitted, we don't show the form any longer. This can be used along with our 'submitted_successfully' slot"},submitButtonProps:{type:Object,required:!1,default:function(){return{}},description:"Props used for submit button"},disabled:{type:Boolean,required:!1,default:!1,description:"Disabled save button"},hideFormErrors:{type:Boolean,required:!1,default:!1,description:"Hide redundent errors on form"},useManualSubmittedSuccessfully:{type:Boolean,required:!1,default:!1,description:"Use the manual submitted succesfully flag"},manualSubmittedSuccessfully:{type:Boolean,required:!1,default:!1,description:"Show submitted successfully message (only works if use manual submitted successfully flag is true"},loadOnSubmit:{type:Boolean,required:!1,default:!1,description:"Show loading while submitting"}},data:function(){return{errors:new s.A,base_URL:Laravel.appUrl+"/",has_errors:!1,submitted_successfully:!1,submitting:!1}},methods:{clearErrorsByName:function(t){this.errors.clear(t),this.setHasErrors()}
1,clearErrors:function(t){t.target.dataset.fieldname&&this.clearErrorsByName(t.target.dataset.fieldname),this.clearErrorsByName(t.target.name)},change:function(t){this.clearErrors(t),this.$emit("change",t),this.submitOnChange&&this.submit()},onSuccess:function(t){this.submitted_successfully=!0,this.$emit("onSuccess",t)},onFail:function(t){"object"==f(t)&&(t=t.errors),this.errors.record(t),this.$emit("onFail",this.errors),this.setHasErrors()},submit:function(){var t=this;if(this.submitting=!0,this.$emit("lockForm",this.submitting),this.emitBeforeSubmit)try{this.$emit("aboutToSubmit",function(){t.sendSubmit()})}catch(t){this.submitting=!1,this.$emit("lockForm",this.submitting)}else this.sendSubmit()},setHasErrors:function(){var t=!1;try{t=this.errors.any()}catch(e){t=!1}this.has_errors=t},sendSubmit:function(){var t=this,e=this.formData;if(this.useFormData){e=new FormData;for(var r=0,s=Object.entries(this.formData);r<s.length;r++){var i=l(s[r],2),o=i[0],u=i[1],a=u;"object"!=f(u)||null===u||u instanceof Blob||(a=JSON.stringify(u)),"boolean"==typeof u&&(a=1==u?1:0),e.append(o,a)}}n()({method:this.method,url:this.full_url,data:e}).then(function(e){try{t.onSuccess(e)}catch(e){t.setHasErrors()}}).catch(function(e){t.onFail(e.response.data)}).finally(function(){t.submitting=!1,t.$emit("lockForm",t.submitting)})}},computed:{submit_button_props:function(){return u(u({},this.submitButtonProps),{},{class:"".concat(this.buttonClass," ").concat(this.submitButtonProps.class?this.submitButtonProps.class:""),disabled:this.has_errors||this.disabled||1==this.submitButtonProps.disabled,loading:this.submitting&&this.loadOnSubmit||1==this.submitButtonProps.loading})},show_submitted_successfully:function(){return this.useManualSubmittedSuccessfully?this.manualSubmittedSuccessfully:this.hideFormOnSuccess&&this.submitted_successfully},full_url:function(){return this.base_URL+this.url}},watch:{formData:{deep:!0,handler:function(){this.submitOnChange&&this.submit()}}},mounted:function(){}};const m=(0,r(14486).A)(b,function(){var t=this,e=t._self._c;return e("form",{class:t.formClass,attrs:{enctype:"multipart/form-data"},on:{keydown:function(e){return t.clearErrors(e)},change:function(e){return t.change(e)}}},[t.show_submitted_successfully?[t._t("submitted-successfully",function(){return[t._v(" Thank you for your submission ")]})]:[t._t("default",null,{errors:t.errors,has_errors:t.errors}),t._v(" "),0==t.hideSave?[t._t("submit-button",function(){return[e("div",{staticClass:"flex flex-row w-full py-2 items-center",class:t.buttonRight?"justify-end":""},[t._t("before-submit-button"),t._v(" "),e("r-button",t._b({attrs:{type:"submit",loading:t.submitting},on:{click:t.submit}},"r-button",t.submit_button_props,!1),[t._v(t._s(t.buttonText))])],2)]},{submit:t.submit,buttonClass:t.buttonClass,hasErrors:t.has_errors,disabled:t.disabled,buttonText:t.buttonText}),t._v(" "),t.has_errors&&!t.hideFormErrors?e("div",[e("ul",t._l(t.errors.getErrors(),function(r,s){return e("li",{key:s,staticClass:"error-list-item"},[t._v("\n "+t._s(r)+"\n ")])}),0)]):t._e()]:t._e()]],2)},[],!1,null,null,null).exports}}]);
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.