1"use strict";(self.webpackChunktinyurl=self.webpackChunktinyurl||[]).push([[155],{90155(n,e,o){o.r(e),o.d(e,{default:()=>r});var t=o(6804),i=o.n(t),s=o(77063);const a={name:"KioskDomainsDomainZoneManagement",components:{vSelect:i()},props:{domain:{type:[String,Number],required:!0},domainZone:{type:Object,required:!1,default:void 0},zones:{type:Array,required:!0}},setup:function(){return{notifyError:(0,s.A)().notifyError}},data:function(){return{editZone:!1,zoneForm:new SparkForm({zone:void 0})}},computed:{zoneAssigned:function(){var n;return!(null===(n=this.domainZone)||void 0===n||!n.id)},canEditZone:function(){var n=this;return!this.zoneAssigned||this.customZones.some(function(e){return e.id===n.domainZone.id})},customZones:function(){return this.zones.filter(function(n){return null===n.bucket})}},watch:{domainZone:function(){var n;this.zoneForm.zone=null===(n=this.domainZone)||void 0===n?void 0:n.zone_id}},created:function(){var n;this.zoneForm.zone=null===(n=this.domainZone)||void 0===n?void 0:n.zone_id},methods:{saveZone:function(){var n=this;this.domainZone&&this.zoneForm.zone&&this.zoneForm.zone.toLowerCase()!==this.domainZone.zone_id.toLowerCase()&&(confirm("Zone name is not the same as domain. Are you sure to assign it?")||(this.editZone=!1));var e=this.$apiUrl("kiosk/domains/{domain}/zone",{domain:this.domain});(this.zoneForm.zone?Spark.patch(e,this.zoneForm):Spark.delete(e,this.zoneForm)).then(function(){n.$emit("updated"),n.editZone=!1}).catch(function(e){n.notifyError({text:e.message||n.$t("something_went_wrong")})})},bucketName:function(n){return{1:"Good",2:"Questionable",3:"Bad"}[n]||"Custom"}}};const r=(0,o(14486).A)(a,function(){var n=this,e=n._self._c;return e("div",{staticClass:"card"},[e("div",{staticClass:"card-header"},[n._v("\n Cloudflare Zone\n "),n.canEditZone?e("button",{staticClass:"btn btn-outline-dark btn-sm",on:{click:function(e){n.editZone=!n.editZone}}},[e("i",{staticClass:"fa fa-edit"})]):n._e()]),n._v(" "),e("div",{staticClass:"card-body"},[n.editZone?[e("b",[n._v("Zone:")]),n._v(" "),e("div",[e("v-select",{class:{"is-invalid":n.zoneForm.errors.has("zone")},attrs:{label:"zone_name",reduce:function(n){return n.zone_id},options:n.customZones,disabled:n.zoneForm.busy,searchable:!0,clearable:!0},model:{value:n.zoneForm.zone,callback:function(e){n.$set(n.zoneForm,"zone",e)},expression:"zoneForm.zone"}}),n._v(" "),e("div",{staticClass:"invalid-feedback",attrs:{role:"alert"}},[n._v("\n "+n._s(n.zoneForm.errors.get("zone"))+"\n ")])],1),n._v(" "),e("div",{staticClass:"btn-group float-right"},[e("button",{staticClass:"btn btn-outline-secondary",on:{click:function(e){n.editZone=!1}}},[n._v("\n Cancel\n ")]),n._v(" "),e("button",{staticClass:"btn btn-outline-primary",on:{click:n.saveZone}},[n.zoneForm.busy?e("i",{staticClass:"fa fa-spinner fa-spin"}):e("i",{staticClass:"fa fa-check"}),n._v("\n Apply\n ")])])]:n.zoneAssigned?[e("p",[e("b",[n._v("Name:")]),n._v(" "+n._s(n.domainZone.zone_name||"-"))]),n._v(" "),e("p",[e("b",[n._v("ID:")]),n._v(" "+n._s(n.domainZone.zone_id||"-"))]),n._v(" "),e("p",[e("b",[n._v("Bucket:")]),n._v(" "+n._s(n.bucketName(n.domainZone.bucket)))])]:[e("i",{staticClass:"fa fa-warning"}),n._v(" Not assigned\n ")]],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.