@kvass/widgets 1.8.57 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/finn.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import{Z as inject,q as defineComponent,r as ref,c as createElementBlock,o as openBlock,j as createVNode,w as withCtx,v as unref,a as createBaseVNode,R as normalizeProps,S as guardReactiveProps,m as mergeProps,d as createCommentVNode,F as Fragment,e as createBlock,_ as _export_sfc,b as computed,i as onMounted,l as renderList,C as createTextVNode,t as toDisplayString,n as normalizeClass,J as mergeModels,K as useModel,z as withDirectives,V as createSlots,E as watch,g as renderSlot,a9 as useId,ad as resolveDirective,L as toRef,ae as withKeys,a1 as onUnmounted,af as KeepAlive,D as onBeforeUnmount,ac as onBeforeMount,f as resolveDynamicComponent,X as provide,p as defineCustomElement}from"./_plugin-vue_export-helper.js";import{C as Ce,e as ep,H as Ho,d as uB,j as eB,_ as _r,I as If,q as qe,p as pC,z as zo,m as CB,J as JL,f as fB,i as ix,a as iy,h as hB,w as wB,x as xB,r as gB,k as kB,u as ud,Z as ZL,s as sB}from"./index.es2.js";import{u as useCurrentElement}from"./index2.js";import{V as Vt,b as bt,M as Mt,f as floatingUi}from"./style.js";import{e as toCurrency,C as Clone,h as hasDiff,u as uploadFunction,i as Diff}from"./index.js";import{n as nbMessages}from"./nb_NO.js";const PropsInjectionKey=Symbol("props");function _isPlaceholder(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function _curry1(e){return function t(a){return arguments.length===0||_isPlaceholder(a)?t:e.apply(this,arguments)}}function _curry2(e){return function t(a,r){switch(arguments.length){case 0:return t;case 1:return _isPlaceholder(a)?t:_curry1(function(i){return e(a,i)});default:return _isPlaceholder(a)&&_isPlaceholder(r)?t:_isPlaceholder(a)?_curry1(function(i){return e(i,r)}):_isPlaceholder(r)?_curry1(function(i){return e(a,i)}):e(a,r)}}}function _curry3(e){return function t(a,r,i){switch(arguments.length){case 0:return t;case 1:return _isPlaceholder(a)?t:_curry2(function(n,s){return e(a,n,s)});case 2:return _isPlaceholder(a)&&_isPlaceholder(r)?t:_isPlaceholder(a)?_curry2(function(n,s){return e(n,r,s)}):_isPlaceholder(r)?_curry2(function(n,s){return e(a,n,s)}):_curry1(function(n){return e(a,r,n)});default:return _isPlaceholder(a)&&_isPlaceholder(r)&&_isPlaceholder(i)?t:_isPlaceholder(a)&&_isPlaceholder(r)?_curry2(function(n,s){return e(n,s,i)}):_isPlaceholder(a)&&_isPlaceholder(i)?_curry2(function(n,s){return e(n,r,s)}):_isPlaceholder(r)&&_isPlaceholder(i)?_curry2(function(n,s){return e(a,n,s)}):_isPlaceholder(a)?_curry1(function(n){return e(n,r,i)}):_isPlaceholder(r)?_curry1(function(n){return e(a,n,i)}):_isPlaceholder(i)?_curry1(function(n){return e(a,r,n)}):e(a,r,i)}}}function _has(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function _isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}var mergeWithKey=_curry3(function(t,a,r){var i={},n;a=a||{},r=r||{};for(n in a)_has(n,a)&&(i[n]=_has(n,r)?t(n,a[n],r[n]):a[n]);for(n in r)_has(n,r)&&!_has(n,i)&&(i[n]=r[n]);return i}),mergeDeepWithKey=_curry3(function e(t,a,r){return mergeWithKey(function(i,n,s){return _isObject(n)&&_isObject(s)?e(t,n,s):t(i,n,s)},a,r)}),mergeDeepRight=_curry2(function(t,a){return mergeDeepWithKey(function(r,i,n){return n},t,a)});async function fetch$1(e,t={}){return fetch(e,mergeDeepRight({headers:{Accept:"application/json","Content-Type":"application/json"},credentials:"include"},t)).then(r=>{if(!r.ok)throw r;return r})}function SSE(e){const t=new TextDecoder,a=[],r=s=>t.decode(s).split(`
2
- `).map(l=>{if(l)return JSON.parse(l.replace("data: ",""))}).filter(Boolean),i=e.body.getReader(),n=(s,l)=>a.filter(o=>o.event===s).forEach(o=>o.callback(l));return i.read().then(function s({done:l,value:o}){return l?n("finished"):(r(o).forEach(f=>n(f.event,f.payload)),i.read().then(s))}),{on:(s,l)=>{a.push({event:s,callback:l})},cancel:()=>{i.cancel()}}}function useAPI(e){const t=inject(PropsInjectionKey),a=y=>new URL(`${t.tenant}/api/integration/${t.integrationId}/callbacks/${y}`);return{getAds:y=>{const p=a("data");return y&&p.searchParams.append("id",y),fetch$1(p.toString(),{method:"GET",headers:{authorization:`Bearer ${t.token}`}}).then(x=>x.json())},navigateView:(y,p)=>{const x=a(y);x.searchParams.append("token",t.token),x.searchParams.append("project",t.project),p&&x.searchParams.append("id",p),e.value.dispatchEvent(new CustomEvent("action",{detail:{type:"navigate",value:{name:"form",query:{target:x.toString()}}},bubbles:!0,composed:!0}))},remove:y=>{const p=a("unpublish");return p.searchParams.append("id",y),fetch$1(p.toString(),{method:"DELETE",headers:{authorization:`Bearer ${t.token}`}}).catch(x=>{throw console.error(x),x})},publish:async(y,p={})=>{const{preview:x=!1,publish:k=!0}=p,g=a("publish"),S=await fetch$1(g.toString(),{method:"POST",cache:"no-cache",keepalive:!0,headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({data:y,preview:x,publish:k})});return SSE(S)},unpublish:y=>{const p=a("unpublish");return p.searchParams.append("id",y),fetch$1(p.toString(),{method:"POST",headers:{authorization:`Bearer ${t.token}`}})},navigateProjectStep:y=>{e.value.dispatchEvent(new CustomEvent("action",{detail:{type:"navigate",value:{name:"project-edit",params:{id:t.project,step:y}}},bubbles:!0,composed:!0}))},getUnits:()=>{const y=a("units");return fetch$1(y.toString(),{method:"GET",headers:{authorization:`Bearer ${t.token}`}}).then(p=>p.json())},fields:y=>{const p=a("fields");return fetch$1(p.toString(),{method:"POST",headers:{authorization:`Bearer ${t.token}`},body:JSON.stringify({type:y.type,units:y.units.map(x=>x.id)})}).then(x=>x.json())}}}const _sfc_main$k=defineComponent({__name:"Options.ce",props:{item:{type:Object}},emits:["refetch"],setup(e,{emit:t}){const a=useCurrentElement(),r=useAPI(a),i=t,n=ref(),s=ref(),l=ref(),o=(u,y)=>{sessionStorage.setItem("k-finn-step",y?"preview":"publish"),r.navigateView("mutate",u)},f=u=>{sessionStorage.setItem("k-finn-step","ad"),r.navigateView("mutate",u)};return(u,y)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(unref(ep),{teleport:!1,closeOnOutsideClick:!0,variant:"prompt",ref_key:"removedialog",ref:s,class:"remove-dialog",title:"Du er i ferd med å slette annonsen"},{trigger:withCtx(({triggerProps:p})=>[createVNode(unref(Ce),mergeProps({style:{display:"none"}},p),null,16)]),default:withCtx(({descriptionProps:p})=>[createBaseVNode("div",normalizeProps(guardReactiveProps(p))," Du er i ferd med å slette din Finn-annonse. Vi gjør oppmerksom på at annonsen avsluttes i sin helhet, du vil eventuelt miste resterende betalt periode hos Finn. Er du sikker? ",16)]),actions:withCtx(({close:p})=>[createVNode(unref(Ce),{label:"Nei, ta meg tilbake",onClick:p},null,8,["onClick"]),createVNode(unref(Ce),{label:"Ja, jeg ønsker å slette",variant:"primary",promise:n.value,onSuccess:()=>{p(),i("refetch")},onClick:y[0]||(y[0]=()=>n.value=unref(r).remove(u.item.id))},null,8,["promise","onSuccess"])]),_:1},512),createVNode(unref(ep),{teleport:!1,closeOnOutsideClick:!0,variant:"prompt",ref_key:"unpublishdialog",ref:l,class:"unpublish-dialog",title:"Du er i ferd med å avpublisere annonsen"},{trigger:withCtx(({triggerProps:p})=>[createVNode(unref(Ce),mergeProps({style:{display:"none"}},p),null,16)]),default:withCtx(({descriptionProps:p})=>[createBaseVNode("div",normalizeProps(guardReactiveProps(p))," Du er i ferd med å avpublisere din Finn-annonse. Vi gjør oppmerksom på at perioden for annonsen vil fortsette å løpe til utløpsdato. ",16)]),actions:withCtx(({close:p})=>[createVNode(unref(Ce),{label:"Nei, ta meg tilbake",onClick:p},null,8,["onClick"]),createVNode(unref(Ce),{label:"Ja, jeg ønsker å avpublisere",variant:"primary",promise:n.value,onSuccess:()=>{p(),i("refetch")},onClick:y[1]||(y[1]=()=>n.value=unref(r).unpublish(u.item.id))},null,8,["promise","onSuccess"])]),_:1},512),createVNode(unref(Ho),{label:"Endre",keepOpen:"",teleport:!1,class:"options"},{default:withCtx(()=>[createVNode(unref(Ce),{iconRight:"fa-pro-light:pen",label:"Rediger",onClick:y[2]||(y[2]=()=>f(u.item.id)),variant:"tertiary"}),u.item.code?(openBlock(),createElementBlock(Fragment,{key:0},[!u.item.publishedAt||u.item.preview?(openBlock(),createBlock(unref(Ce),{key:0,iconRight:"fa-pro-light:arrow-right",label:"Publiser",onClick:y[3]||(y[3]=()=>o(u.item.id,u.item.preview)),variant:"tertiary"})):createCommentVNode("",!0),u.item.publishedAt?(openBlock(),createBlock(unref(Ce),{key:1,iconRight:"fa-pro-light:play-pause",label:"Avpubliser",onClick:y[4]||(y[4]=()=>{l.value.open()}),variant:"tertiary"})):createCommentVNode("",!0)],64)):createCommentVNode("",!0),createVNode(unref(Ce),{"data-type":"delete",class:"options__delete",variant:"danger",label:"Slett",iconRight:"fa-pro-light:trash-xmark",onClick:y[5]||(y[5]=()=>{s.value.open()})})]),_:1})],64))}}),_style_0$e=".k-button.options__delete{color:var(--k-button-danger-background, var(--k-ui-color-danger));background-color:var(--k-button-danger-text, white)}.k-button.options__delete:focus,.k-button.options__delete:active,.k-button.options__delete:hover{color:var(--k-button-danger-text, white)}.unpublish-dialog,.remove-dialog{--k-dialog-min-width: 400px;--k-dialog-max-width: 600px}",Options=_export_sfc(_sfc_main$k,[["styles",[_style_0$e]]]),_sfc_main$j=defineComponent({__name:"Dashboard.ce",setup(e){const t=useCurrentElement(),a=useAPI(t),r=ref([]),i=ref(!1),n=computed(()=>[{id:"name",label:"Kampanjenavn"},{id:"status",label:"Status"},{id:"published",label:"Publisert"},{id:"insight",label:""},{id:"url",label:""},{id:"edit",label:""}]),s=f=>f.code?f.publishedAt?f.preview?{label:"Utkast - Forhåndsvisning",variant:"info"}:{label:"Aktiv",variant:"success"}:{label:"Avpublisert",variant:"danger"}:{label:"Utkast",variant:"neutral"},l=f=>{if(!f.code||!f.publishedAt||f.preview)return"-";const u={year:"numeric",month:"numeric",day:"numeric"};return new Date(f.publishedAt).toLocaleString("nb-NO",u)};ref();const o=()=>{i.value=!0,a.getAds().then(f=>{r.value=f}).finally(()=>{i.value=!1})};return onMounted(()=>{o()}),(f,u)=>(openBlock(),createBlock(unref(pC),{class:"ads",title:"Dine Finn-annonser",subtitle:"Her får du en oversikt over dine Finn-annonser.",variant:"prompt",appearance:"shadow"},{default:withCtx(()=>[r.value.length&&!i.value?(openBlock(),createBlock(unref(uB),{key:0,items:r.value,columns:n.value},{name:withCtx(({item:y})=>[createTextVNode(toDisplayString(y.name),1)]),status:withCtx(({item:y})=>[createVNode(unref(eB),mergeProps(s(y),{appearance:"filled"}),null,16)]),published:withCtx(({item:y})=>[createTextVNode(toDisplayString(l(y)),1)]),url:withCtx(({item:y})=>[y.url?(openBlock(),createElementBlock(Fragment,{key:0},[y.units.some(p=>p.url)?(openBlock(),createBlock(unref(Ho),{key:0,label:"Se annonser"},{default:withCtx(()=>[createVNode(unref(Ce),{variant:"tertiary",iconRight:"fa-pro-light:arrow-up-right-from-square",label:"Prosjektannonse",target:"_blank",is:"a",href:y.url},null,8,["href"]),(openBlock(!0),createElementBlock(Fragment,null,renderList(y.units,p=>(openBlock(),createBlock(unref(Ce),{variant:"tertiary",label:`${p.name}`,target:"_blank",is:"a",href:p.url,iconRight:"fa-pro-light:arrow-up-right-from-square"},null,8,["label","href"]))),256))]),_:2},1024)):(openBlock(),createBlock(unref(Ce),{key:1,iconRight:"fa-pro-light:arrow-up-right-from-square",label:"Se annonse",target:"_blank",is:"a",href:y.url},null,8,["href"]))],64)):createCommentVNode("",!0)]),insight:withCtx(({item:y})=>[!y.preview&&y.statistics?(openBlock(),createBlock(unref(Ce),{key:0,iconRight:"fa-pro-light:arrow-up-right-from-square",label:"Se innsikt",target:"_blank",is:"a",href:y.statistics},null,8,["href"])):createCommentVNode("",!0)]),edit:withCtx(({item:y})=>[(openBlock(),createBlock(Options,{item:y,onRefetch:u[0]||(u[0]=()=>o()),key:y.id},null,8,["item"]))]),_:1},8,["items","columns"])):createCommentVNode("",!0),i.value?(openBlock(),createBlock(unref(_r),{key:1,direction:"column",align:"center"},{default:withCtx(()=>[createVNode(unref(If),{size:"large"})]),_:1})):createCommentVNode("",!0),!i.value&&!r.value.length?(openBlock(),createBlock(unref(_r),{key:2,direction:"column",align:"center",class:"ads__empty"},{default:withCtx(()=>[createVNode(unref(qe),{icon:"fa-pro-thin:face-sleeping"}),u[1]||(u[1]=createBaseVNode("div",null,"Fant ingen annonser",-1))]),_:1,__:[1]})):createCommentVNode("",!0)]),_:1}))}}),_style_0$d=".ads .k-datatable{position:initial}.ads__empty{font-size:1rem}.ads__empty svg{padding-block:var(--k-ui-spacing);opacity:var(--k-ui-opacity-faded);font-size:5rem}",Dashboard=_export_sfc(_sfc_main$j,[["styles",[_style_0$d]]]),_sfc_main$i=defineComponent({__name:"Tooltip.ce",props:{src:{type:String},content:{type:String}},setup(e){return(t,a)=>(openBlock(),createBlock(unref(Vt),{container:!1},{popper:withCtx(()=>[t.content?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass({"k-mb-sm":t.src})},toDisplayString(t.content),3)):createCommentVNode("",!0),t.src?(openBlock(),createBlock(unref(zo),{key:1,class:"tooltip__image",src:t.src,width:"100%",size:"cover","aspect-ratio":"16/9"},null,8,["src"])):createCommentVNode("",!0)]),default:withCtx(()=>[createVNode(unref(qe),{icon:"material-symbols:question-mark",class:"v-popper__icon"})]),_:1}))}}),_style_0$c=".tooltip__image{border-radius:var(--k-ui-rounding)}",Tooltip=_export_sfc(_sfc_main$i,[["styles",[_style_0$c]]]),houseBuildingTypes=["detached","flat","semidetached","terraced","leisure","fourPlex","chainLinkedHouse","boatBerth","boathouse"],Categories=[{type:"ESTATE_PLANNED",label:"Kommer for salg",sublabel:"Nye boliger, kommer for salg",group:"Nybygg",disabled:e=>{if(!e.length)return!1;const t=["draft","upcoming"];return!e.some(a=>a.saleType==="sale"&&t.includes(a.status.value))},disabledReason:'Du må ha enheter merket som "kommer for salg".'},{type:"ESTATE_PROJECT",label:"Boliger",sublabel:"Nye boliger til salgs",group:"Nybygg",unitType:"ESTATE_PROJECT_UNIT",disabled:e=>{if(!e.length)return!0;const t=houseBuildingTypes.filter(a=>a!=="leisure");return!e.some(a=>a.saleType==="sale"&&t.includes(a.propertyType.value))},disabledReason:"Du må ha boligtypeenheter til salgs"},{type:"ESTATE_PROJECT_SINGLE",label:"Enkelt enhet",sublabel:"Nye boliger til salgs enkelt enhet",group:"Nybygg",disabled:e=>{if(!e.length)return!1;const t=houseBuildingTypes;return!e.some(a=>a.saleType==="sale"&&t.includes(a.propertyType.value))},disabledReason:"Du må ha boligtypeenheter eller hytteenheter til salgs."},{type:"ESTATE_PROJECT_LEISURE",label:"Hytter",sublabel:"Nye boliger til salgs hytte",group:"Nybygg",unitType:"ESTATE_PROJECT_UNIT_LEISURE",disabled:e=>{if(!e.length)return!0;const t=["leisure"];return!e.some(a=>a.saleType==="sale"&&t.includes(a.propertyType.value))},disabledReason:"Du må ha hytteenheter til salgs"},{type:"ESTATE_BUSINESS_SALE",label:"Til salgs",sublabel:"Næringseiendommer til salgs",group:"Næring",disabled:e=>{if(!e.length)return!1;const t=houseBuildingTypes;return!e.some(a=>a.saleType==="sale"&&!t.includes(a.propertyType.value))},disabledReason:"Du må ha flere enheter til salgs enn bare boligtyper og hytter"},{type:"ESTATE_BUSINESS_RENT",label:"Til leie",sublabel:"Næringseiendommer til leie",group:"Næring",disabled:e=>e.length?!e.some(t=>t.saleType==="rent"):!1,disabledReason:"Du må ha enheter til leie"},{type:"PLOT_SALE",label:"Tomt/Fritidstomt",sublabel:"Boligtomt/Fritidstomt til salgs",group:"Tomter",disabled:e=>{if(!e.length)return!1;const t=["plot","leisurePlot"];return!e.some(a=>a.saleType==="sale"&&t.includes(a.propertyType.value))},disabledReason:"Du må ha tomteenheter eller fritidstomter til salgs"},{type:"ESTATE_RENT",label:"Bruktbolig",sublabel:"Bolig til leie",group:"Leie",disabled:e=>e.length?!e.some(t=>t.saleType==="rent"):!1,disabledReason:"Du må ha enheter til leie"}];CB.setLabels(nbMessages);const _hoisted_1$3={class:"category__label"},_hoisted_2$1={class:"category__sublabel"},_hoisted_3={class:"category__group"},_hoisted_4={class:"category__label"},_hoisted_5={class:"category__sublabel"},_sfc_main$h=defineComponent({__name:"Type.ce",props:mergeModels({onNext:{type:null},onPrev:{type:null},units:{type:Array}},{modelValue:{default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=useCurrentElement(),a=useAPI(t),r=inject(PropsInjectionKey),i=e,n=useModel(e,"modelValue"),s=computed(()=>{const C=Categories.reduce((R,F)=>(R[F.group]||(R[F.group]=[]),R[F.group].push(F),R),{});return Object.entries(C).map(([R,F])=>({group:R,items:F}))}),l=computed(()=>Categories.find(C=>C.type===n.value.type)),o=computed(()=>[{id:"name",label:"Navn",sort:!0},{id:"type",label:"Enhetstype",sort:!0},{id:"status",label:"Status",sort:!0},{id:"price",label:"Pris",sort:!0}]),f=C=>{switch(C){case"upcoming":return"info";case"sale":return"success";case"reserved":return"warning";case"sold":return"danger";default:return"neutral"}};function u(C){return C.disabled}const y=()=>{i.onNext()},p=ref({name:1}),x=computed(()=>i.units.sort((C,M)=>{let[R]=Object.keys(p.value),[F]=Object.values(p.value);const G=P=>R==="status"?P[R].label:R==="type"?P.propertyType.label:P[R],O=G(C),N=G(M),U=F<0,L=!isNaN(O),z=!isNaN(N);return L&&z?U?N-O:O-N:typeof O=="string"&&typeof N=="string"?U?N.localeCompare(O,"nb-NO",{numeric:!0,sensitivity:"base"}):O.localeCompare(N,"nb-NO",{numeric:!0,sensitivity:"base"}):0})),k=computed({get(){return x.value.filter(C=>n.value.units.some(M=>M.id===C.id))},set(C){n.value.units=C.map(M=>{const{price:R,propertyType:F,status:G,disabled:O,saleType:N,disabledReason:U,...L}=M;return{fields:{},...L}})}}),g=computed(()=>o.value.filter(C=>C.sort).map(C=>C.id)),S=computed(()=>{const C={name:"required",type:"required"};return l.value?.type==="ESTATE_PROJECT_SINGLE"&&n.value.units.length?{units:"size:1",...C}:["ESTATE_PROJECT","ESTATE_PROJECT_LEISURE"].includes(l.value?.type||"")?{units:"min:1",...C}:C}),c=computed(()=>({name:"Internt navn",type:"Annonse-kategori",units:"enhet"})),d=computed(()=>({min:`Du må minimum velge :min :attribute når "${Categories.find(C=>C.type==="ESTATE_PROJECT")?.label}" eller "${Categories.find(C=>C.type==="ESTATE_PROJECT_LEISURE")?.label}" er valgt som annonse-kategori`,size:`Du kan kun velge :size :attribute når "${Categories.find(C=>C.type==="ESTATE_PROJECT_SINGLE")?.label}" er valgt som annonse-kategori`})),m=JL({rules:S,labels:c,data:n,customMessages:d}),{bind:b}=m,E=ref();return onMounted(()=>{const C=E.value?.$el;if(!C)return;let M=C.querySelectorAll('[data-scope="checkbox"][data-part="root"][data-disabled]');const R=x.value.filter(F=>F.disabled);M.forEach((F,G)=>{const O=R[G].disabledReason;bt(F,{container:!1,triggers:["hover","focus"],content:O,placements:"auto",preventOverflow:!0},null)})}),(C,M)=>(openBlock(),createBlock(unref(pC),{class:"type",title:"Grunnlag for Finn-annonsen",variant:"prompt",appearance:"shadow",subtitle:"Definer annonsen sitt interne navn, annonse-kategorien definerer hvor den plasseres på Finn."},{default:withCtx(()=>[createVNode(unref(fB),{columns:"2",gap:"4rem 2rem"},{default:withCtx(()=>[createVNode(unref(ix),normalizeProps(guardReactiveProps(unref(b)("name"))),{label:withCtx(()=>[M[5]||(M[5]=createBaseVNode("span",null,"Internt navn på Finn-annonse ",-1)),createVNode(Tooltip,{content:"Det interne navnet gjør det lettere å finne annonsen i oversikten over Finn-annonsene på prosjektet, spesielt hvis du planlegger å ha flere annonser på samme prosjekt!"})]),default:withCtx(()=>[createVNode(unref(iy),{modelValue:n.value.name,"onUpdate:modelValue":M[0]||(M[0]=R=>n.value.name=R)},null,8,["modelValue"])]),_:1},16),createVNode(unref(ix),mergeProps(unref(b)("type"),{help:"Dette legger annonsen på riktig boligtype på Finn"}),{label:withCtx(()=>[M[6]||(M[6]=createBaseVNode("span",null," Velg annonse-kategori ",-1)),createVNode(Tooltip,{content:"En annonse-kategori gjør det mulig å bestemme ønsket plass i Finn for din type annonse. Dersom du for eksempel skal leie ut en bolig kan du benytte bolig til leie. Annonsen vil deretter plasseres på bolig til leie på Finn."})]),default:withCtx(()=>[createVNode(unref(Ho),{teleport:!1,disabled:!!unref(r).id,label:"Velg...",class:"category"},createSlots({default:withCtx(({close:R})=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(s.value,F=>(openBlock(),createElementBlock(Fragment,null,[createBaseVNode("div",_hoisted_3,toDisplayString(F.group),1),(openBlock(!0),createElementBlock(Fragment,null,renderList(F.items,G=>withDirectives((openBlock(),createBlock(unref(Ce),{variant:"tertiary",onClick:()=>{n.value.type=G.type,R()},disabled:G.disabled(C.units)},{default:withCtx(()=>[createVNode(unref(_r),{class:"category__label-wrapper"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_4,toDisplayString(G.label),1),createBaseVNode("div",_hoisted_5,toDisplayString(G.sublabel),1)]),_:2},1024)]),_:2},1032,["onClick","disabled"])),[[unref(Mt),{content:G.disabledReason,disabled:!G.disabled(C.units),container:!1}]])),256))],64))),256))]),_:2},[l.value?{name:"trigger",fn:withCtx(()=>[createVNode(unref(_r),{class:"category__label-wrapper"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$3,toDisplayString(l.value.label),1),createBaseVNode("div",_hoisted_2$1,toDisplayString(l.value.sublabel),1)]),_:1})]),key:"0"}:void 0]),1032,["disabled"])]),_:1},16),x.value.length?(openBlock(),createBlock(unref(ix),{key:0,label:"Velg hvilke enheter du vil publisere i Finn-annonse",class:"k-grid-span-full"},{default:withCtx(()=>[createVNode(unref(hB),{is:"div",appearance:"indicator",treshhold:200,class:"table-scroller"},{default:withCtx(()=>[createVNode(unref(uB),{ref_key:"unitTable",ref:E,sticky:!0,sortableBy:g.value,sortBy:p.value,"onUpdate:sortBy":M[1]||(M[1]=R=>p.value=R),columns:o.value,items:x.value,selected:k.value,"onUpdate:selected":M[2]||(M[2]=R=>k.value=R),isDisabled:u},{name:withCtx(({item:R})=>[createTextVNode(toDisplayString(R.name),1)]),type:withCtx(({item:R})=>[createTextVNode(toDisplayString(R.propertyType.label),1)]),status:withCtx(({item:R})=>[createVNode(unref(eB),{appearance:"filled",variant:f(R.status.value),rounded:!0},{default:withCtx(()=>[createTextVNode(toDisplayString(R.status.label),1)]),_:2},1032,["variant"])]),price:withCtx(({item:R})=>[createTextVNode(toDisplayString(unref(toCurrency)(R.price)),1)]),_:1},8,["sortableBy","sortBy","columns","items","selected"])]),_:1})]),_:1})):createCommentVNode("",!0)]),_:1})]),actions:withCtx(()=>[createVNode(unref(Ce),{label:"Avbryt",variant:"secondary",onClick:M[3]||(M[3]=()=>unref(a).navigateView("dashboard"))}),withDirectives(createVNode(unref(Ce),{label:"Neste",variant:"primary","icon-right":"fa-pro-solid:arrow-right",disabled:!unref(m).passes.value,onClick:M[4]||(M[4]=()=>y())},null,8,["disabled"]),[[unref(Mt),{content:Object.entries(unref(m).errors.value.errors).map(([R,F])=>F).flat().join(`
2
+ `).map(l=>{if(l)return JSON.parse(l.replace("data: ",""))}).filter(Boolean),i=e.body.getReader(),n=(s,l)=>a.filter(o=>o.event===s).forEach(o=>o.callback(l));return i.read().then(function s({done:l,value:o}){return l?n("finished"):(r(o).forEach(f=>n(f.event,f.payload)),i.read().then(s))}),{on:(s,l)=>{a.push({event:s,callback:l})},cancel:()=>{i.cancel()}}}function useAPI(e){const t=inject(PropsInjectionKey),a=y=>new URL(`${t.tenant}/api/integration/${t.integrationId}/callbacks/${y}`);return{getAds:y=>{const p=a("data");return y&&p.searchParams.append("id",y),fetch$1(p.toString(),{method:"GET",headers:{authorization:`Bearer ${t.token}`}}).then(x=>x.json())},navigateView:(y,p)=>{const x=a(y);x.searchParams.append("token",t.token),x.searchParams.append("project",t.project),p&&x.searchParams.append("id",p),e.value.dispatchEvent(new CustomEvent("action",{detail:{type:"navigate",value:{name:"form",query:{target:x.toString()}}},bubbles:!0,composed:!0}))},remove:y=>{const p=a("unpublish");return p.searchParams.append("id",y),fetch$1(p.toString(),{method:"DELETE",headers:{authorization:`Bearer ${t.token}`}}).catch(x=>{throw console.error(x),x})},publish:async(y,p={})=>{const{preview:x=!1,publish:k=!0}=p,g=a("publish"),S=await fetch$1(g.toString(),{method:"POST",cache:"no-cache",keepalive:!0,headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({data:y,preview:x,publish:k})});return SSE(S)},unpublish:y=>{const p=a("unpublish");return p.searchParams.append("id",y),fetch$1(p.toString(),{method:"POST",headers:{authorization:`Bearer ${t.token}`}})},navigateProjectStep:y=>{e.value.dispatchEvent(new CustomEvent("action",{detail:{type:"navigate",value:{name:"project-edit",params:{id:t.project,step:y}}},bubbles:!0,composed:!0}))},getUnits:()=>{const y=a("units");return fetch$1(y.toString(),{method:"GET",headers:{authorization:`Bearer ${t.token}`}}).then(p=>p.json())},fields:y=>{const p=a("fields");return fetch$1(p.toString(),{method:"POST",headers:{authorization:`Bearer ${t.token}`},body:JSON.stringify({type:y.type,units:y.units.map(x=>x.id)})}).then(x=>x.json())}}}const _sfc_main$k=defineComponent({__name:"Options.ce",props:{item:{type:null}},emits:["refetch"],setup(e,{emit:t}){const a=useCurrentElement(),r=useAPI(a),i=t,n=ref(),s=ref(),l=ref(),o=(u,y)=>{sessionStorage.setItem("k-finn-step",y?"preview":"publish"),r.navigateView("mutate",u)},f=u=>{sessionStorage.setItem("k-finn-step","ad"),r.navigateView("mutate",u)};return(u,y)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(unref(ep),{teleport:!1,closeOnOutsideClick:!0,variant:"prompt",ref_key:"removedialog",ref:s,class:"remove-dialog",title:"Du er i ferd med å slette annonsen"},{trigger:withCtx(({triggerProps:p})=>[createVNode(unref(Ce),mergeProps({style:{display:"none"}},p),null,16)]),default:withCtx(({descriptionProps:p})=>[createBaseVNode("div",normalizeProps(guardReactiveProps(p))," Du er i ferd med å slette din Finn-annonse. Vi gjør oppmerksom på at annonsen avsluttes i sin helhet, du vil eventuelt miste resterende betalt periode hos Finn. Er du sikker? ",16)]),actions:withCtx(({close:p})=>[createVNode(unref(Ce),{label:"Nei, ta meg tilbake",onClick:p},null,8,["onClick"]),createVNode(unref(Ce),{label:"Ja, jeg ønsker å slette",variant:"primary",promise:n.value,onSuccess:()=>{p(),i("refetch")},onClick:y[0]||(y[0]=()=>n.value=unref(r).remove(u.item.id))},null,8,["promise","onSuccess"])]),_:1},512),createVNode(unref(ep),{teleport:!1,closeOnOutsideClick:!0,variant:"prompt",ref_key:"unpublishdialog",ref:l,class:"unpublish-dialog",title:"Du er i ferd med å avpublisere annonsen"},{trigger:withCtx(({triggerProps:p})=>[createVNode(unref(Ce),mergeProps({style:{display:"none"}},p),null,16)]),default:withCtx(({descriptionProps:p})=>[createBaseVNode("div",normalizeProps(guardReactiveProps(p))," Du er i ferd med å avpublisere din Finn-annonse. Vi gjør oppmerksom på at perioden for annonsen vil fortsette å løpe til utløpsdato. ",16)]),actions:withCtx(({close:p})=>[createVNode(unref(Ce),{label:"Nei, ta meg tilbake",onClick:p},null,8,["onClick"]),createVNode(unref(Ce),{label:"Ja, jeg ønsker å avpublisere",variant:"primary",promise:n.value,onSuccess:()=>{p(),i("refetch")},onClick:y[1]||(y[1]=()=>n.value=unref(r).unpublish(u.item.id))},null,8,["promise","onSuccess"])]),_:1},512),createVNode(unref(Ho),{label:"Endre",keepOpen:"",teleport:!1,class:"options"},{default:withCtx(()=>[createVNode(unref(Ce),{iconRight:"fa-pro-light:pen",label:"Rediger",onClick:y[2]||(y[2]=()=>f(u.item.id)),variant:"tertiary"}),u.item.code?(openBlock(),createElementBlock(Fragment,{key:0},[!u.item.publishedAt||u.item.preview?(openBlock(),createBlock(unref(Ce),{key:0,iconRight:"fa-pro-light:arrow-right",label:"Publiser",onClick:y[3]||(y[3]=()=>o(u.item.id,u.item.preview)),variant:"tertiary"})):createCommentVNode("",!0),u.item.publishedAt?(openBlock(),createBlock(unref(Ce),{key:1,iconRight:"fa-pro-light:play-pause",label:"Avpubliser",onClick:y[4]||(y[4]=()=>{l.value.open()}),variant:"tertiary"})):createCommentVNode("",!0)],64)):createCommentVNode("",!0),createVNode(unref(Ce),{"data-type":"delete",class:"options__delete",variant:"danger",label:"Slett",iconRight:"fa-pro-light:trash-xmark",onClick:y[5]||(y[5]=()=>{s.value.open()})})]),_:1})],64))}}),_style_0$e=".k-button.options__delete{color:var(--k-button-danger-background, var(--k-ui-color-danger));background-color:var(--k-button-danger-text, white)}.k-button.options__delete:focus,.k-button.options__delete:active,.k-button.options__delete:hover{color:var(--k-button-danger-text, white)}.unpublish-dialog,.remove-dialog{--k-dialog-min-width: 400px;--k-dialog-max-width: 600px}",Options=_export_sfc(_sfc_main$k,[["styles",[_style_0$e]]]),_sfc_main$j=defineComponent({__name:"Dashboard.ce",setup(e){const t=useCurrentElement(),a=useAPI(t),r=ref([]),i=ref(!1),n=computed(()=>[{id:"name",label:"Kampanjenavn"},{id:"status",label:"Status"},{id:"published",label:"Publisert"},{id:"insight",label:""},{id:"url",label:""},{id:"edit",label:""}]),s=f=>f.code?f.publishedAt?f.preview?{label:"Utkast - Forhåndsvisning",variant:"info"}:{label:"Aktiv",variant:"success"}:{label:"Avpublisert",variant:"danger"}:{label:"Utkast",variant:"neutral"},l=f=>{if(!f.code||!f.publishedAt||f.preview)return"-";const u={year:"numeric",month:"numeric",day:"numeric"};return new Date(f.publishedAt).toLocaleString("nb-NO",u)};ref();const o=()=>{i.value=!0,a.getAds().then(f=>{r.value=f}).finally(()=>{i.value=!1})};return onMounted(()=>{o()}),(f,u)=>(openBlock(),createBlock(unref(pC),{class:"ads",title:"Dine Finn-annonser",subtitle:"Her får du en oversikt over dine Finn-annonser.",variant:"prompt",appearance:"shadow"},{default:withCtx(()=>[r.value.length&&!i.value?(openBlock(),createBlock(unref(uB),{key:0,items:r.value,columns:n.value},{name:withCtx(({item:y})=>[createTextVNode(toDisplayString(y.name),1)]),status:withCtx(({item:y})=>[createVNode(unref(eB),mergeProps(s(y),{appearance:"filled"}),null,16)]),published:withCtx(({item:y})=>[createTextVNode(toDisplayString(l(y)),1)]),url:withCtx(({item:y})=>[y.url?(openBlock(),createElementBlock(Fragment,{key:0},[y.units.some(p=>p.url)?(openBlock(),createBlock(unref(Ho),{key:0,label:"Se annonser"},{default:withCtx(()=>[createVNode(unref(Ce),{variant:"tertiary",iconRight:"fa-pro-light:arrow-up-right-from-square",label:"Prosjektannonse",target:"_blank",is:"a",href:y.url},null,8,["href"]),(openBlock(!0),createElementBlock(Fragment,null,renderList(y.units,p=>(openBlock(),createBlock(unref(Ce),{variant:"tertiary",label:`${p.name}`,target:"_blank",is:"a",href:p.url,iconRight:"fa-pro-light:arrow-up-right-from-square"},null,8,["label","href"]))),256))]),_:2},1024)):(openBlock(),createBlock(unref(Ce),{key:1,iconRight:"fa-pro-light:arrow-up-right-from-square",label:"Se annonse",target:"_blank",is:"a",href:y.url},null,8,["href"]))],64)):createCommentVNode("",!0)]),insight:withCtx(({item:y})=>[!y.preview&&y.statistics?(openBlock(),createBlock(unref(Ce),{key:0,iconRight:"fa-pro-light:arrow-up-right-from-square",label:"Se innsikt",target:"_blank",is:"a",href:y.statistics},null,8,["href"])):createCommentVNode("",!0)]),edit:withCtx(({item:y})=>[(openBlock(),createBlock(Options,{item:y,onRefetch:u[0]||(u[0]=()=>o()),key:y.id},null,8,["item"]))]),_:1},8,["items","columns"])):createCommentVNode("",!0),i.value?(openBlock(),createBlock(unref(_r),{key:1,direction:"column",align:"center"},{default:withCtx(()=>[createVNode(unref(If),{size:"large"})]),_:1})):createCommentVNode("",!0),!i.value&&!r.value.length?(openBlock(),createBlock(unref(_r),{key:2,direction:"column",align:"center",class:"ads__empty"},{default:withCtx(()=>[createVNode(unref(qe),{icon:"fa-pro-thin:face-sleeping"}),u[1]||(u[1]=createBaseVNode("div",null,"Fant ingen annonser",-1))]),_:1,__:[1]})):createCommentVNode("",!0)]),_:1}))}}),_style_0$d=".ads .k-datatable{position:initial}.ads__empty{font-size:1rem}.ads__empty svg{padding-block:var(--k-ui-spacing);opacity:var(--k-ui-opacity-faded);font-size:5rem}",Dashboard=_export_sfc(_sfc_main$j,[["styles",[_style_0$d]]]),_sfc_main$i=defineComponent({__name:"Tooltip.ce",props:{src:{type:String},content:{type:String}},setup(e){return(t,a)=>(openBlock(),createBlock(unref(Vt),{container:!1},{popper:withCtx(()=>[t.content?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass({"k-mb-sm":t.src})},toDisplayString(t.content),3)):createCommentVNode("",!0),t.src?(openBlock(),createBlock(unref(zo),{key:1,class:"tooltip__image",src:t.src,width:"100%",size:"cover","aspect-ratio":"16/9"},null,8,["src"])):createCommentVNode("",!0)]),default:withCtx(()=>[createVNode(unref(qe),{icon:"material-symbols:question-mark",class:"v-popper__icon"})]),_:1}))}}),_style_0$c=".tooltip__image{border-radius:var(--k-ui-rounding)}",Tooltip=_export_sfc(_sfc_main$i,[["styles",[_style_0$c]]]),houseBuildingTypes=["detached","flat","semidetached","terraced","leisure","fourPlex","chainLinkedHouse","boatBerth","boathouse"],Categories=[{type:"ESTATE_PLANNED",label:"Kommer for salg",sublabel:"Nye boliger, kommer for salg",group:"Nybygg",disabled:e=>{if(!e.length)return!1;const t=["draft","upcoming"];return!e.some(a=>a.saleType==="sale"&&t.includes(a.status.value))},disabledReason:'Du må ha enheter merket som "kommer for salg".'},{type:"ESTATE_PROJECT",label:"Boliger",sublabel:"Nye boliger til salgs",group:"Nybygg",unitType:"ESTATE_PROJECT_UNIT",disabled:e=>{if(!e.length)return!0;const t=houseBuildingTypes.filter(a=>a!=="leisure");return!e.some(a=>a.saleType==="sale"&&t.includes(a.propertyType.value))},disabledReason:"Du må ha boligtypeenheter til salgs"},{type:"ESTATE_PROJECT_SINGLE",label:"Enkelt enhet",sublabel:"Nye boliger til salgs enkelt enhet",group:"Nybygg",disabled:e=>{if(!e.length)return!1;const t=houseBuildingTypes;return!e.some(a=>a.saleType==="sale"&&t.includes(a.propertyType.value))},disabledReason:"Du må ha boligtypeenheter eller hytteenheter til salgs."},{type:"ESTATE_PROJECT_LEISURE",label:"Hytter",sublabel:"Nye boliger til salgs hytte",group:"Nybygg",unitType:"ESTATE_PROJECT_UNIT_LEISURE",disabled:e=>{if(!e.length)return!0;const t=["leisure"];return!e.some(a=>a.saleType==="sale"&&t.includes(a.propertyType.value))},disabledReason:"Du må ha hytteenheter til salgs"},{type:"ESTATE_BUSINESS_SALE",label:"Til salgs",sublabel:"Næringseiendommer til salgs",group:"Næring",disabled:e=>{if(!e.length)return!1;const t=houseBuildingTypes;return!e.some(a=>a.saleType==="sale"&&!t.includes(a.propertyType.value))},disabledReason:"Du må ha flere enheter til salgs enn bare boligtyper og hytter"},{type:"ESTATE_BUSINESS_RENT",label:"Til leie",sublabel:"Næringseiendommer til leie",group:"Næring",disabled:e=>e.length?!e.some(t=>t.saleType==="rent"):!1,disabledReason:"Du må ha enheter til leie"},{type:"PLOT_SALE",label:"Tomt/Fritidstomt",sublabel:"Boligtomt/Fritidstomt til salgs",group:"Tomter",disabled:e=>{if(!e.length)return!1;const t=["plot","leisurePlot"];return!e.some(a=>a.saleType==="sale"&&t.includes(a.propertyType.value))},disabledReason:"Du må ha tomteenheter eller fritidstomter til salgs"},{type:"ESTATE_RENT",label:"Bruktbolig",sublabel:"Bolig til leie",group:"Leie",disabled:e=>e.length?!e.some(t=>t.saleType==="rent"):!1,disabledReason:"Du må ha enheter til leie"}];CB.setLabels(nbMessages);const _hoisted_1$3={class:"category__label"},_hoisted_2$1={class:"category__sublabel"},_hoisted_3={class:"category__group"},_hoisted_4={class:"category__label"},_hoisted_5={class:"category__sublabel"},_sfc_main$h=defineComponent({__name:"Type.ce",props:mergeModels({onNext:{type:null},onPrev:{type:null},units:{type:Array}},{modelValue:{default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=useCurrentElement(),a=useAPI(t),r=inject(PropsInjectionKey),i=e,n=useModel(e,"modelValue"),s=computed(()=>{const C=Categories.reduce((R,F)=>(R[F.group]||(R[F.group]=[]),R[F.group].push(F),R),{});return Object.entries(C).map(([R,F])=>({group:R,items:F}))}),l=computed(()=>Categories.find(C=>C.type===n.value.type)),o=computed(()=>[{id:"name",label:"Navn",sort:!0},{id:"type",label:"Enhetstype",sort:!0},{id:"status",label:"Status",sort:!0},{id:"price",label:"Pris",sort:!0}]),f=C=>{switch(C){case"upcoming":return"info";case"sale":return"success";case"reserved":return"warning";case"sold":return"danger";default:return"neutral"}};function u(C){return C.disabled}const y=()=>{i.onNext()},p=ref({name:1}),x=computed(()=>i.units.sort((C,M)=>{let[R]=Object.keys(p.value),[F]=Object.values(p.value);const G=P=>R==="status"?P[R].label:R==="type"?P.propertyType.label:P[R],O=G(C),N=G(M),U=F<0,L=!isNaN(O),z=!isNaN(N);return L&&z?U?N-O:O-N:typeof O=="string"&&typeof N=="string"?U?N.localeCompare(O,"nb-NO",{numeric:!0,sensitivity:"base"}):O.localeCompare(N,"nb-NO",{numeric:!0,sensitivity:"base"}):0})),k=computed({get(){return x.value.filter(C=>n.value.units.some(M=>M.id===C.id))},set(C){n.value.units=C.map(M=>{const{price:R,propertyType:F,status:G,disabled:O,saleType:N,disabledReason:U,...L}=M;return{fields:{},...L}})}}),g=computed(()=>o.value.filter(C=>C.sort).map(C=>C.id)),S=computed(()=>{const C={name:"required",type:"required"};return l.value?.type==="ESTATE_PROJECT_SINGLE"&&n.value.units.length?{units:"size:1",...C}:["ESTATE_PROJECT","ESTATE_PROJECT_LEISURE"].includes(l.value?.type||"")?{units:"min:1",...C}:C}),c=computed(()=>({name:"Internt navn",type:"Annonse-kategori",units:"enhet"})),d=computed(()=>({min:`Du må minimum velge :min :attribute når "${Categories.find(C=>C.type==="ESTATE_PROJECT")?.label}" eller "${Categories.find(C=>C.type==="ESTATE_PROJECT_LEISURE")?.label}" er valgt som annonse-kategori`,size:`Du kan kun velge :size :attribute når "${Categories.find(C=>C.type==="ESTATE_PROJECT_SINGLE")?.label}" er valgt som annonse-kategori`})),m=JL({rules:S,labels:c,data:n,customMessages:d}),{bind:b}=m,E=ref();return onMounted(()=>{const C=E.value?.$el;if(!C)return;let M=C.querySelectorAll('[data-scope="checkbox"][data-part="root"][data-disabled]');const R=x.value.filter(F=>F.disabled);M.forEach((F,G)=>{const O=R[G].disabledReason;bt(F,{container:!1,triggers:["hover","focus"],content:O,placements:"auto",preventOverflow:!0},null)})}),(C,M)=>(openBlock(),createBlock(unref(pC),{class:"type",title:"Grunnlag for Finn-annonsen",variant:"prompt",appearance:"shadow",subtitle:"Definer annonsen sitt interne navn, annonse-kategorien definerer hvor den plasseres på Finn."},{default:withCtx(()=>[createVNode(unref(fB),{columns:"2",gap:"4rem 2rem"},{default:withCtx(()=>[createVNode(unref(ix),normalizeProps(guardReactiveProps(unref(b)("name"))),{label:withCtx(()=>[M[5]||(M[5]=createBaseVNode("span",null,"Internt navn på Finn-annonse ",-1)),createVNode(Tooltip,{content:"Det interne navnet gjør det lettere å finne annonsen i oversikten over Finn-annonsene på prosjektet, spesielt hvis du planlegger å ha flere annonser på samme prosjekt!"})]),default:withCtx(()=>[createVNode(unref(iy),{modelValue:n.value.name,"onUpdate:modelValue":M[0]||(M[0]=R=>n.value.name=R)},null,8,["modelValue"])]),_:1},16),createVNode(unref(ix),mergeProps(unref(b)("type"),{help:"Dette legger annonsen på riktig boligtype på Finn"}),{label:withCtx(()=>[M[6]||(M[6]=createBaseVNode("span",null," Velg annonse-kategori ",-1)),createVNode(Tooltip,{content:"En annonse-kategori gjør det mulig å bestemme ønsket plass i Finn for din type annonse. Dersom du for eksempel skal leie ut en bolig kan du benytte bolig til leie. Annonsen vil deretter plasseres på bolig til leie på Finn."})]),default:withCtx(()=>[createVNode(unref(Ho),{teleport:!1,disabled:!!unref(r).id,label:"Velg...",class:"category"},createSlots({default:withCtx(({close:R})=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(s.value,F=>(openBlock(),createElementBlock(Fragment,null,[createBaseVNode("div",_hoisted_3,toDisplayString(F.group),1),(openBlock(!0),createElementBlock(Fragment,null,renderList(F.items,G=>withDirectives((openBlock(),createBlock(unref(Ce),{variant:"tertiary",onClick:()=>{n.value.type=G.type,R()},disabled:G.disabled(C.units)},{default:withCtx(()=>[createVNode(unref(_r),{class:"category__label-wrapper"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_4,toDisplayString(G.label),1),createBaseVNode("div",_hoisted_5,toDisplayString(G.sublabel),1)]),_:2},1024)]),_:2},1032,["onClick","disabled"])),[[unref(Mt),{content:G.disabledReason,disabled:!G.disabled(C.units),container:!1}]])),256))],64))),256))]),_:2},[l.value?{name:"trigger",fn:withCtx(()=>[createVNode(unref(_r),{class:"category__label-wrapper"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$3,toDisplayString(l.value.label),1),createBaseVNode("div",_hoisted_2$1,toDisplayString(l.value.sublabel),1)]),_:1})]),key:"0"}:void 0]),1032,["disabled"])]),_:1},16),x.value.length?(openBlock(),createBlock(unref(ix),{key:0,label:"Velg hvilke enheter du vil publisere i Finn-annonse",class:"k-grid-span-full"},{default:withCtx(()=>[createVNode(unref(hB),{is:"div",appearance:"indicator",treshhold:200,class:"table-scroller"},{default:withCtx(()=>[createVNode(unref(uB),{ref_key:"unitTable",ref:E,sticky:!0,sortableBy:g.value,sortBy:p.value,"onUpdate:sortBy":M[1]||(M[1]=R=>p.value=R),columns:o.value,items:x.value,selected:k.value,"onUpdate:selected":M[2]||(M[2]=R=>k.value=R),isDisabled:u},{name:withCtx(({item:R})=>[createTextVNode(toDisplayString(R.name),1)]),type:withCtx(({item:R})=>[createTextVNode(toDisplayString(R.propertyType.label),1)]),status:withCtx(({item:R})=>[createVNode(unref(eB),{appearance:"filled",variant:f(R.status.value),rounded:!0},{default:withCtx(()=>[createTextVNode(toDisplayString(R.status.label),1)]),_:2},1032,["variant"])]),price:withCtx(({item:R})=>[createTextVNode(toDisplayString(unref(toCurrency)(R.price)),1)]),_:1},8,["sortableBy","sortBy","columns","items","selected"])]),_:1})]),_:1})):createCommentVNode("",!0)]),_:1})]),actions:withCtx(()=>[createVNode(unref(Ce),{label:"Avbryt",variant:"secondary",onClick:M[3]||(M[3]=()=>unref(a).navigateView("dashboard"))}),withDirectives(createVNode(unref(Ce),{label:"Neste",variant:"primary","icon-right":"fa-pro-solid:arrow-right",disabled:!unref(m).passes.value,onClick:M[4]||(M[4]=()=>y())},null,8,["disabled"]),[[unref(Mt),{content:Object.entries(unref(m).errors.value.errors).map(([R,F])=>F).flat().join(`
3
3
  `),disabled:unref(m).passes.value,container:!1}]])]),_:1}))}}),_style_0$b=".type .table-scroller{max-height:650px;position:relative}.type .category__group{font-weight:700;padding-inline:var(--k-ui-spacing-sm);padding-top:var(--k-ui-spacing-xs)}.type .category__label-wrapper{flex-direction:column;gap:var(--k-ui-spacing-xxs);align-items:start}.type .category__sublabel{font-size:var(--k-ui-font-size-sm);opacity:var(--k-ui-opacity-faded)}",StepType=_export_sfc(_sfc_main$h,[["styles",[_style_0$b]]]),_hoisted_1$2={style:{"margin-left":"auto"}},_sfc_main$g=defineComponent({__name:"ExpandableList.ce",props:{modelValue:{type:Array},title:{default:"",type:String},subtitle:{default:"",type:String},limit:{type:Number},template:{type:null}},emits:["update:modelValue","remove"],setup(e,{emit:t}){const a=e,r=t,i=ref(Clone(a.modelValue));watch(()=>a.modelValue,(u,y)=>{hasDiff({value:u},{value:i.value})&&(i.value=Clone(u))},{deep:!0}),watch(()=>[...i.value],(u,y)=>{if(!u.length)return i.value.push(Clone(a.template));u.length===y.length&&r("update:modelValue",u)},{deep:!0});const n=ref([]),s=u=>(n.value[u]||(n.value[u]=useId()),n.value[u]),l=()=>{const u=[...i.value,Clone(a.template)];i.value=u,r("update:modelValue",[...u])},o=u=>{n.value.splice(u,1);const y=[...i.value];y.splice(u,1),i.value=y,r("update:modelValue",[...y]),r("remove",u)},f=(u,y)=>{const p=n.value.splice(u,1)[0];n.value.splice(u+y,0,p);const x=[...i.value],k=x.splice(u,1)[0];x.splice(u+y,0,k),i.value=x,r("update:modelValue",[...x])};return onMounted(()=>{i.value.length||i.value.push(Clone(a.template))}),(u,y)=>(openBlock(),createBlock(unref(wB),{class:"expandable-list",title:u.title,subtitle:u.subtitle},createSlots({actions:withCtx(()=>[renderSlot(u.$slots,"actions",{},()=>[createBaseVNode("span",_hoisted_1$2,toDisplayString(i.value.length)+toDisplayString(u.limit?` / ${u.limit}`:"")+" "+toDisplayString(i.value.length>=2||u.limit?"felter":"felt"),1)])]),default:withCtx(()=>[renderSlot(u.$slots,"before-content"),(openBlock(!0),createElementBlock(Fragment,null,renderList(i.value,(p,x)=>(openBlock(),createElementBlock(Fragment,{key:s(x)},[createVNode(unref(_r),{justify:"end",gap:"4px",class:"expandable-list__actions"},{default:withCtx(()=>[withDirectives(createVNode(unref(Ce),{size:"small",icon:"fa-pro-light:trash",onClick:k=>o(x),class:"expandable-list__remove"},null,8,["onClick"]),[[unref(Mt),{content:"Fjern",container:!1}]]),withDirectives(createVNode(unref(Ce),{size:"small",icon:"fa-pro-light:arrow-up",disabled:x===0,onClick:k=>f(x,-1),class:"expandable-list__move-up"},null,8,["disabled","onClick"]),[[unref(Mt),{content:"Flytt opp",container:!1}]]),withDirectives(createVNode(unref(Ce),{size:"small",icon:"fa-pro-light:arrow-down",disabled:x===i.value.length-1,onClick:k=>f(x,1),class:"expandable-list__move-down"},null,8,["disabled","onClick"]),[[unref(Mt),{content:"Flytt ned",container:!1}]])]),_:2},1024),createVNode(unref(_r),{direction:"column",class:"expandable-list__content"},{default:withCtx(()=>[renderSlot(u.$slots,"default",{item:p,index:x})]),_:2},1024)],64))),128))]),footer:withCtx(()=>[withDirectives(createVNode(unref(Ce),{variant:"tertiary",disabled:u.limit&&i.value.length>=u.limit,onClick:l,icon:"fa-pro-solid:plus",label:"Opprett nytt felt",class:"expandable-list__add"},null,8,["disabled"]),[[unref(Mt),{content:"Maks antall felter lagt til",disabled:!(u.limit&&i.value.length>=u.limit),container:!1}]])]),_:2},[u.$slots.title?{name:"title",fn:withCtx(()=>[renderSlot(u.$slots,"title")]),key:"0"}:void 0]),1032,["title","subtitle"]))}}),_style_0$a=".expandable-list__actions:hover+.expandable-list__content{border-radius:var(--k-ui-rounding-sm);outline:2px dashed var(--k-ui-color-neutral-dark);outline-offset:6px}.expandable-list .k-expandable__footer{--k-expandable-spacing: 0rem}.expandable-list .k-expandable__footer .k-button{width:100%;--k-button-tertiary-background: #eaeaea;padding:1rem;border-top-right-radius:0;border-top-left-radius:0}.expandable-list .k-expandable__footer .k-button__content{flex-direction:column}.expandable-list .k-expandable__footer .k-button__icon{padding:.5rem;color:#fff;background-color:var(--k-ui-color-primary);border-radius:var(--k-ui-rounding-full)}.expandable-list .k-expandable__footer .k-button__icon svg{height:1em;width:1em}",ExpandableList=_export_sfc(_sfc_main$g,[["styles",[_style_0$a]]]),_sfc_main$f=defineComponent({__name:"UnitLinks.ce",props:{modelValue:{type:Object},hasFields:{type:Function},hasField:{type:Function},getIsEditedBind:{type:Function},isEdited:{type:Function},rules:{type:Object},labels:{type:Object},initialUnitField:{type:Object}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){const r=e,i=a,n=ref(Clone(r.modelValue)),s=ref({});watch(()=>r.modelValue,(c,d)=>{hasDiff({value:c},{value:n.value})&&(n.value=Clone(c))},{deep:!0});const l=c=>{const d=["MOREINFO.*.URL","MOREINFO.0.URL","MOREINFO.1.URL","MOREINFO.2.URL","MOREINFO.3.URL"];return Object.fromEntries(Object.entries(c).filter(([m,b])=>d.includes(m)))},o=computed(()=>l(r.rules)),f=computed(()=>l(r.labels)),u=JL({rules:o,labels:f,data:n}),{bind:y}=u,p=ref(),x=c=>hasDiff({value:n.value[c]},{value:r.initialUnitField[c]}),k=(...c)=>r.getIsEditedBind(x(...c)),g=()=>{n.value=Clone(r.modelValue)},S=()=>{i("update:modelValue",Clone(n.value))};return t({open:()=>{p.value.open()},close:()=>{p.value.close()}}),(c,d)=>(openBlock(),createBlock(unref(ep),{ref_key:"linkDialog",ref:p,variant:"prompt",title:"Tilpass enhetens nyttige lenker i Finn-annonsen",subtitle:"Lenker vil være synlig under kontakt informasjon på enhetsannonsen",teleport:!1,closeOnOutsideClick:!1},{trigger:withCtx(({triggerProps:m})=>[createVNode(unref(Ce),{style:{display:"none"}})]),default:withCtx(()=>[c.hasFields("MOREINFO")?(openBlock(),createBlock(ExpandableList,{key:0,limit:4,template:{URL:"",URLTEXT:""},expanded:!0,modelValue:n.value.MOREINFO,"onUpdate:modelValue":d[2]||(d[2]=m=>n.value.MOREINFO=m),onRemove:d[3]||(d[3]=m=>{const b=Object.keys(s.value).reverse().find(E=>E.startsWith("MOREINFO.")&&E.endsWith(".URL")&&s.value[E]);b&&(s.value[b]=!1)})},createSlots({title:withCtx(()=>[d[4]||(d[4]=createBaseVNode("span",null,"Nyttige lenker i Finn-annonsen",-1)),createVNode(Tooltip,{class:"k-ml-xxs",content:"Nyttige lenker vises her i enhetsannonsen. Noen felt er standard og låst av Finn, derfor vises lenken til prosjektsiden alltid automatisk. Du kan fritt legge til egne lenker og lenker til andre nettsteder.",src:"https://assets.kvass.no/67c80a5e92504cdf70aba756"})]),actions:withCtx(()=>[withDirectives(createVNode(unref(qe),{class:normalizeClass(["ad__expandable-list-field-icon",{"ad__expandable-list-field-icon--edited":x("MOREINFO")}]),icon:k("MOREINFO").icon},null,8,["class","icon"]),[[unref(Mt),{content:k("MOREINFO").label,container:!1}]])]),default:withCtx(({item:m,index:b})=>[createVNode(unref(fB),{columns:"2"},{default:withCtx(()=>[createVNode(unref(ix),{label:"URL til nyttig lenke",onBlur:()=>s.value[`MOREINFO.${b}.URL`]=!0,error:s.value[`MOREINFO.${b}.URL`]?Object.entries(unref(u).errors.value.errors).filter(([E,C])=>E===`MOREINFO.${b}.URL`).map(([E,C])=>C).flat().join(`
4
4
  `):void 0},{default:withCtx(()=>[createVNode(unref(iy),{modelValue:m.URL,"onUpdate:modelValue":E=>m.URL=E,suffix:"URL"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["onBlur","error"]),createVNode(unref(ix),{label:"Visningsnavn på lenken på Finn-annonsen"},{default:withCtx(()=>[createVNode(unref(iy),{modelValue:m.URLTEXT,"onUpdate:modelValue":E=>m.URLTEXT=E},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1024)]),_:2},[c.hasFields("ESTATE_EXTERNAL_URL","ESTATE_EXTERNAL_ORDER_URL")?{name:"before-content",fn:withCtx(()=>[createVNode(unref(fB),{columns:"2"},{default:withCtx(()=>[c.hasField("ESTATE_EXTERNAL_URL")?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(unref(ix),{label:"URL til nyttig lenke"},{default:withCtx(()=>[createVNode(unref(iy),{modelValue:c.data.ESTATE_EXTERNAL_URL,"onUpdate:modelValue":d[0]||(d[0]=m=>c.data.ESTATE_EXTERNAL_URL=m),suffix:"URL",disabled:""},null,8,["modelValue"])]),_:1}),createVNode(unref(ix),{label:"Visningsnavn på lenken på Finn-annonsen"},{default:withCtx(()=>[createVNode(unref(iy),{modelValue:"Se prosjektets hjemmeside",disabled:""})]),_:1})],64)):createCommentVNode("",!0),c.hasField("ESTATE_EXTERNAL_ORDER_URL")?(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(unref(ix),{label:"URL til nyttig lenke"},{default:withCtx(()=>[createVNode(unref(iy),{modelValue:c.data.ESTATE_EXTERNAL_ORDER_URL,"onUpdate:modelValue":d[1]||(d[1]=m=>c.data.ESTATE_EXTERNAL_ORDER_URL=m),suffix:"URL",disabled:""},null,8,["modelValue"])]),_:1}),createVNode(unref(ix),{label:"Visningsnavn på lenken på Finn-annonsen"},{default:withCtx(()=>[createVNode(unref(iy),{modelValue:"Bestill salgsoppgave",disabled:""})]),_:1})],64)):createCommentVNode("",!0)]),_:1}),d[5]||(d[5]=createBaseVNode("div",{class:"ad__expandable-list-divider"},null,-1))]),key:"0"}:void 0]),1032,["modelValue"])):createCommentVNode("",!0)]),actions:withCtx(({close:m})=>[createVNode(unref(Ce),{label:"Avbryt",onClick:()=>{g(),m()},variant:"secondary"},null,8,["onClick"]),withDirectives(createVNode(unref(Ce),{disabled:!unref(u).passes.value,label:"Bekreft",onClick:()=>{unref(u).passes&&(S(),m())},variant:"primary"},null,8,["disabled","onClick"]),[[unref(Mt),{content:Object.entries(unref(u).errors.value.errors).map(([b,E])=>E).flat().join(`
5
5
  `),disabled:unref(u).passes.value,container:!1}]])]),_:1},512))}}),_sfc_main$e=defineComponent({__name:"RichTextMultiple.ce",props:mergeModels({expanded:{type:Boolean},title:{type:String},subtitle:{type:String}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=useModel(e,"modelValue");function a(n){/<[a-z][\s\S]*>/i.test(n)||(n=`<p>${n}</p>`);const l=new DOMParser().parseFromString(n,"text/html"),o=[],f=l.querySelectorAll("h3");let u=l.body.firstElementChild,y="";for(;u&&u!==f[0]&&(y+=u.outerHTML,u=u.nextElementSibling,!(!u||!l.body.contains(u))););return y.trim()&&o.push({title:"",content:y}),f.forEach((p,x)=>{const k=p.textContent||"";let g="",S=p.nextElementSibling;for(;S&&S.tagName!=="H3";)g+=S.outerHTML,S=S.nextElementSibling;o.push({title:k,content:g})}),o}const r=computed({get:()=>a(t.value),set:n=>{t.value=n.map(s=>`<h3>${s.title}</h3>${s.content}`).join("")}}),i=(n,s,l)=>{const o=r.value;o.length||o.push({title:"",content:""}),o[s]&&(o[s]={...o[s]||{},[l]:n}),t.value=o.map(({title:f,content:u})=>`<h3>${f}</h3>${u}`).join("")};return(n,s)=>(openBlock(),createBlock(ExpandableList,{expanded:n.expanded,title:n.title,subtitle:n.subtitle,template:{title:"",content:""},modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=l=>r.value=l)},createSlots({default:withCtx(({item:l,index:o})=>[createVNode(unref(ix),{label:"Tittel"},{default:withCtx(()=>[createVNode(unref(iy),{modelValue:l.title,"onUpdate:modelValue":f=>i(f,o,"title")},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),createVNode(unref(ix),{label:"Tekst"},{default:withCtx(()=>[createVNode(unref(xB),{actions:["bold","italic","orderedList","bulletList"],modelValue:l.content,"onUpdate:modelValue":f=>i(f,o,"content"),placeholder:"Skriv her..."},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},[n.$slots.title?{name:"title",fn:withCtx(()=>[renderSlot(n.$slots,"title")]),key:"0"}:void 0,n.$slots.actions?{name:"actions",fn:withCtx(()=>[renderSlot(n.$slots,"actions")]),key:"1"}:void 0]),1032,["expanded","title","subtitle","modelValue"]))}}),_sfc_main$d=defineComponent({__name:"UnitDescription.ce",props:{modelValue:{type:Object},hasFields:{type:Function},hasField:{type:Function},getIsEditedBind:{type:Function},isEdited:{type:Function},rules:{type:Object},labels:{type:Object},initialUnitField:{type:Object}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){const r=e,i=a,n=ref(Clone(r.modelValue)),s=ref();watch(()=>r.modelValue,(S,c)=>{hasDiff({value:S},{value:n.value})&&(n.value=Clone(S))},{deep:!0});const l=S=>{const c=["HEADING"];return Object.fromEntries(Object.entries(S).filter(([d,m])=>c.includes(d)))},o=computed(()=>l(r.rules)),f=computed(()=>l(r.labels)),u=JL({rules:o,labels:f,data:n}),{bind:y}=u,p=S=>hasDiff({value:n.value[S]},{value:r.initialUnitField[S]}),x=(...S)=>r.getIsEditedBind(p(...S)),k=()=>{n.value=Clone(r.modelValue)},g=()=>{i("update:modelValue",Clone(n.value))};return t({open:()=>{s.value.open()},close:()=>s.value.close()}),(S,c)=>(openBlock(),createBlock(unref(ep),{variant:"prompt",title:"Rediger enhet",subtitle:"Rediger beskrivelser og bilder",teleport:!1,closeOnOutsideClick:!1,ref_key:"descriptionDialog",ref:s},{trigger:withCtx(({triggerProps:d})=>[createVNode(unref(Ce),mergeProps({style:{display:"none"}},d),null,16)]),default:withCtx(()=>[createVNode(unref(_r),{direction:"column",gap:"2rem"},{default:withCtx(()=>[S.hasFields("HEADING")?(openBlock(),createBlock(unref(wB),{key:0,expanded:!0,title:"Hovedtittel og undertittel"},{title:withCtx(()=>[c[4]||(c[4]=createBaseVNode("span",null,"Undertittel",-1)),createVNode(Tooltip,{class:"k-ml-xxs",content:"Teksten du skriver her vises som undertittel i annonsen.",src:"https://assets.kvass.no/67c7181792504cdf70aba68d"})]),default:withCtx(()=>[S.hasField("HEADING")?(openBlock(),createBlock(unref(ix),mergeProps({key:0},unref(y)("HEADING"),{label:"Undertittel for enhetsannonsen",class:["ad__field",{"ad__field--edited":p("HEADING")}]}),{default:withCtx(()=>[createVNode(unref(iy),{modelValue:n.value.HEADING,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value.HEADING=d)},{suffix:withCtx(()=>[withDirectives(createVNode(unref(qe),{icon:x("HEADING").icon},null,8,["icon"]),[[unref(Mt),{content:x("HEADING").label,container:!1}]])]),_:1},8,["modelValue"])]),_:1},16,["class"])):createCommentVNode("",!0)]),_:1})):createCommentVNode("",!0),S.hasFields("MEDIA")?(openBlock(),createBlock(unref(wB),{key:1,expanded:!0},{title:withCtx(()=>[c[5]||(c[5]=createBaseVNode("span",null,"Bilder",-1)),createVNode(Tooltip,{class:"k-ml-xxs",content:"Bildene hentes fra enhetssiden. Det første bildet blir forsidebildet i enhetsannonsen.",src:"https://assets.kvass.no/67c8088692504cdf70aba702"})]),actions:withCtx(()=>[withDirectives(createVNode(unref(qe),{class:normalizeClass(["ad__expandable-list-field-icon",{"ad__expandable-list-field-icon--edited":p("MEDIA")}]),icon:x("MEDIA").icon},null,8,["class","icon"]),[[unref(Mt),{content:x("MEDIA").label,container:!1}]])]),default:withCtx(()=>[S.hasField("MEDIA")?(openBlock(),createBlock(unref(gB),{key:0,modelValue:n.value.MEDIA,"onUpdate:modelValue":c[1]||(c[1]=d=>n.value.MEDIA=d),label:"Bilder i enhetsannonsen",dropMessage:"Dra en fil hit eller <b>velg</b> for å laste opp",accept:["image/jpeg","image/png","image/jpg"],upload:unref(uploadFunction),types:["Image"],multiple:!0,sortable:!0,description:!0,placement:"outside",size:"contain",labels:{selectMessage:"Trykk på knappen nedenfor for å laste opp andre filtyper",select:"Velg",cancel:"Avbryt",save:"Bekreft",descriptionPlaceholder:"",image:{createLabel:"Bilde",preview:"",inputLabel:"",error:""}}},null,8,["modelValue","upload"])):createCommentVNode("",!0)]),_:1})):createCommentVNode("",!0),S.hasFields("FLOORPLAN_MEDIA")?(openBlock(),createBlock(unref(wB),{key:2,expanded:!0},{title:withCtx(()=>[c[6]||(c[6]=createBaseVNode("span",null,"Plantegninger",-1)),createVNode(Tooltip,{class:"k-ml-xxs",content:"Plantegninger vises sist i bildegalleriet eller som en egen knapp i galleriet med navnet «Plantegninger». Dette avhenger av hva annonsetypen støtter.",src:"https://assets.kvass.no/67d1501f9b29de28ddec33d9"})]),actions:withCtx(()=>[withDirectives(createVNode(unref(qe),{class:normalizeClass(["ad__expandable-list-field-icon",{"ad__expandable-list-field-icon--edited":p("FLOORPLAN_MEDIA")}]),icon:x("FLOORPLAN_MEDIA").icon},null,8,["class","icon"]),[[unref(Mt),{content:x("FLOORPLAN_MEDIA").label,container:!1}]])]),default:withCtx(()=>[S.hasField("FLOORPLAN_MEDIA")?(openBlock(),createBlock(unref(kB),{key:0,rename:!1,modelValue:n.value.FLOORPLAN_MEDIA,"onUpdate:modelValue":c[2]||(c[2]=d=>n.value.FLOORPLAN_MEDIA=d),label:"Plantegninger i enhetsannonsen",dropMessage:"Dra en fil hit eller <b>velg</b> for å laste opp",accept:["image/jpeg","image/png","image/jpg"],upload:unref(uploadFunction),uploadOptions:{},types:["Image"],multiple:!0,sortable:!0,labels:{delete:"Slett",download:"Last ned",copy:"Kopier lenke"}},null,8,["modelValue","upload"])):createCommentVNode("",!0)]),_:1})):createCommentVNode("",!0),S.hasFields("GENERAL_DESCRIPTION")?(openBlock(),createBlock(_sfc_main$e,{key:3,expanded:!0,modelValue:n.value.GENERAL_DESCRIPTION,"onUpdate:modelValue":c[3]||(c[3]=d=>n.value.GENERAL_DESCRIPTION=d)},{title:withCtx(()=>[c[7]||(c[7]=createBaseVNode("span",null,"Beskrivelse",-1)),createVNode(Tooltip,{class:"k-ml-xxs",content:"Teksten du skriver her vises under beskrivelsen i enhetsannonsen.",src:"https://assets.kvass.no/67c80a5792504cdf70aba732"})]),actions:withCtx(()=>[withDirectives(createVNode(unref(qe),{class:normalizeClass(["ad__expandable-list-field-icon",{"ad__expandable-list-field-icon--edited":p("GENERAL_DESCRIPTION")}]),icon:x("GENERAL_DESCRIPTION").icon},null,8,["class","icon"]),[[unref(Mt),{content:x("GENERAL_DESCRIPTION").label,container:!1}]])]),_:1},8,["modelValue"])):createCommentVNode("",!0)]),_:1})]),actions:withCtx(({close:d})=>[createVNode(unref(Ce),{label:"Avbryt",onClick:()=>{k(),d()},variant:"secondary"},null,8,["onClick"]),withDirectives(createVNode(unref(Ce),{label:"Bekreft",disabled:!unref(u).passes.value,onClick:()=>{unref(u).passes&&(g(),d())},variant:"primary"},null,8,["disabled","onClick"]),[[unref(Mt),{content:Object.entries(unref(u).errors.value.errors).map(([m,b])=>b).flat().join(`