PageSourceSearch

https://app.praksis.ai/_next/static/chunks/42175-ca1eb26654d7d2f7.js

js praksis.ai collected 2026-10-05 15:26:32 UTC 45,103 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[42175],{68639:function(e,t,n){n.d(t,{f:function(){return s}});var i=n(27573),a=n(87354),l=n(20054),o=n(16273),r=n(17515),d=n(46393);function s(e){let{status:t,onRetry:n}=e,s=(0,d.T)("production");return"idle"===t?null:"saving"===t?(0,i.jsxs)("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",role:"status",children:[(0,i.jsx)(r.Gl,{size:"sm"}),s("savingBoard")]}):"saved"===t?(0,i.jsxs)("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",role:"status",children:[(0,i.jsx)(a.Z,{className:"h-4 w-4"}),s("boardSaved")]}):(0,i.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-status-failed-border bg-status-failed-muted px-2 py-1 text-xs text-status-failed-foreground",role:"alert",children:[(0,i.jsx)(l.Z,{className:"h-4 w-4 shrink-0"}),(0,i.jsx)("span",{children:s("boardSaveFailed")}),(0,i.jsx)(o.z,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:n,children:s("retryBoardSave")})]})}},35257:function(e,t,n){n.d(t,{w:function(){return u}});var i=n(7653),a=n(39455),l=n(39990),o=n(64097),r=n(76782);function d(e,t,n){return"number"!=typeof e.x||"number"!=typeof e.y||"number"!=typeof e.width||"number"!=typeof e.height?null:{x:e.x-t,y:e.y-n,width:e.width,height:e.height,..."number"==typeof e.angle&&0!==e.angle?{rotation:e.angle}:{}}}function s(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function c(e,t,n){return(e.x+e.width/2-t)**2+(e.y+e.height/2-n)**2}function u(e){let[t,n]=(0,i.useState)("idle"),u=(0,i.useRef)(null),h=(0,i.useRef)(null),f=(0,i.useRef)(null),p=(0,i.useRef)(null),v=(0,i.useRef)(!1),m=(0,i.useRef)(!0);(0,i.useEffect)(()=>(m.current=!0,()=>{m.current=!1,p.current&&clearTimeout(p.current)}),[]);let g=(0,i.useCallback)(e=>{u.current=e,h.current=null,f.current=null,m.current&&n("idle")},[]),y=(0,i.useCallback)(async()=>{if(v.current||!h.current||!e)return;let t=h.current;h.current=null,v.current=!0,m.current&&n("saving");try{let i=await (0,a.wN)(e,{snapshot:{elements:t.elements},...t.source?{source:t.source}:{}});u.current=i.source,f.current=null,m.current&&n(h.current?"saving":"saved")}catch(e){var i;f.current=null!==(i=h.current)&&void 0!==i?i:t,h.current=null,m.current&&n("error")}finally{v.current=!1,h.current&&y()}},[e]),k=(0,i.useCallback)(e=>{p.current&&clearTimeout(p.current);let t=u.current;h.current={elements:e,source:t?function(e,t){var n,i,a,u,h;let f=e.filter(e=>e&&!e.isDeleted),p=new Map;t.canvases.forEach((e,t)=>{if((0,r.rO)(e))p.set("".concat(e.id,":frame"),t);else for(let n of((0,l.vK)(e)&&p.set("".concat(e.id,":frame"),t),e.zones))p.set(n.id,t)});let v=t.canvases.findIndex(e=>!(0,r.rO)(e)),m=new Map;for(let e of f){let t;e.id&&("frame"===e.type&&p.has(e.id)?t=p.get(e.id):e.frameId&&p.has(e.frameId)&&(t=p.get(e.frameId)),void 0!==t&&m.set(e.id,t))}let g=new Map;for(let e of f){if(!e.id||"frame"!==e.type)continue;let t=p.get(e.id);void 0!==t&&function(e,t,n){if("number"!=typeof n.x||"number"!=typeof n.y)return;let i="number"==typeof n.width?n.width:0,a="number"==typeof n.height?n.height:0,l=e.get(t);if(!l){e.set(t,{x:n.x,y:n.y,width:i,height:a});return}let o=Math.min(l.x,n.x),r=Math.min(l.y,n.y),d=Math.max(l.x+l.width,n.x+i),s=Math.max(l.y+l.height,n.y+a);e.set(t,{x:o,y:r,width:d-o,height:s-r})}(g,t,e)}if(g.size>1)for(let e of f){if(!e.id||m.has(e.id))continue;let t=function(e,t){let n;if("number"!=typeof t.x||"number"!=typeof t.y)return;let i=t.x+("number"==typeof t.width?t.width:0)/2,a=t.y+("number"==typeof t.height?t.height:0)/2,l=Number.POSITIVE_INFINITY;for(let[t,o]of e){let e=Math.max(o.x-i,0,i-(o.x+o.width)),r=Math.max(o.y-a,0,a-(o.y+o.height)),d=e*e+r*r;d<l&&(l=d,n=t)}return n}(g,e);void 0!==t&&m.set(e.id,t)}for(let e of f){if(!e.id||m.has(e.id)||"arrow"!==e.type&&"line"!==e.type)continue;let t=null===(n=e.startBinding)||void 0===n?void 0:n.elementId,l=null===(i=e.endBinding)||void 0===i?void 0:i.elementId,o=null!==(a=t?m.get(t):void 0)&&void 0!==a?a:l?m.get(l):void 0;void 0!==o&&m.set(e.id,o)}for(let e of f)!(!e.id||m.has(e.id))&&"text"===e.type&&e.containerId&&m.has(e.containerId)&&m.set(e.id,m.get(e.containerId));let y=new Map,k=[];for(let e of f){let t=e.id?m.get(e.id):void 0;if(void 0===t)k.push(e);else{let n=null!==(u=y.get(t))&&void 0!==u?u:[];n.push(e),y.set(t,n)}}if(v>=0){let e=null!==(h=y.get(v))&&void 0!==h?h:[];e.push(...k),y.set(v,e)}return{...t,canvases:t.canvases.map((e,t)=>{var n,i;return(0,r.rO)(e)?function(e,t){var n,i,a,l,r,s,c,u,h;let f=(0,o.W)(e),p=new Set([...f.shapes.map(e=>e.id),...f.bindings.map(e=>e.id)]),v="".concat(e.id,":frame"),m=t.find(e=>e.id===v&&"frame"===e.type),g="number"==typeof(null==m?void 0:m.x)?m.x:0,y="number"==typeof(null==m?void 0:m.y)?m.y:0,k=new Map((null!==(a=null===(n=e.overlay)||void 0===n?void 0:n.elements)&&void 0!==a?a:[]).map(e=>[e.id,e])),x=null!==(l=null===(i=e.overlay)||void 0===i?void 0:i.connections)&&void 0!==l?l:[],b=new Map;for(let e of t)"text"===e.type&&e.containerId&&"string"==typeof e.text&&b.set(e.containerId,e.text);let w=[],M=[];for(let e of t){if(!e.id||!e.type||p.has(e.id)||"text"===e.type&&e.containerId&&p.has(e.containerId))continue;let t=d(e,g,y);
1switch(e.type){case"rectangle":if(!t)break;w.push({...k.get(e.id),id:e.id,type:"note",text:null!==(r=b.get(e.id))&&void 0!==r?r:"",geometry:t});break;case"ellipse":case"diamond":if(!t)break;w.push({...k.get(e.id),id:e.id,type:"shape",shape:"ellipse"===e.type?"ellipse":"rectangle",text:null!==(s=b.get(e.id))&&void 0!==s?s:"",geometry:t});break;case"text":if(e.containerId||!t)break;w.push({...k.get(e.id),id:e.id,type:"text",text:null!==(c=e.text)&&void 0!==c?c:"",geometry:t});break;case"arrow":case"line":{let t=null===(u=e.startBinding)||void 0===u?void 0:u.elementId,n=null===(h=e.endBinding)||void 0===h?void 0:h.elementId;if(!t||!n)break;let i=x.find(e=>e.from===t&&e.to===n),a=b.get(e.id);M.push({...i,from:t,to:n,...a?{label:a}:{},style:"dashed"===e.strokeStyle?"dashed":"line"===e.type?"line":"arrow"})}}}return{...e,overlay:{elements:w,connections:M}}}(e,null!==(n=y.get(t))&&void 0!==n?n:[]):function(e,t){var n,i,a,o,r,u,h,f,p,v,m,g;let y=(0,l.vK)(e),k=y?"".concat(e.id,":frame"):null,x=k?t.find(e=>e.id===k):void 0,b="number"==typeof(null==x?void 0:x.x)?x.x:0,w="number"==typeof(null==x?void 0:x.y)?x.y:0,M=new Set(null!==(n=null==e?void 0:e.zones.map(e=>e.id))&&void 0!==n?n:[]),S=new Set(null!==(i=null==e?void 0:e.zones.map(e=>"".concat(e.id,"__title")))&&void 0!==i?i:[]),z=new Map((null!==(a=null==e?void 0:e.elements)&&void 0!==a?a:[]).map(e=>[e.id,e])),I=new Map((null!==(o=e.connections)&&void 0!==o?o:[]).map(e=>["".concat(e.from,"\0").concat(e.to),e])),W=[],E=new Set;for(let e of t){if("frame"!==e.type||!e.id||M.has(e.id)||e.id===k)continue;E.add(e.id);let t="string"==typeof e.name?e.name.trim():"";W.push({id:e.id,template:"free",...t?{title:t}:{}})}let C=new Set([...M,...E]),_=e=>e&&C.has(e)?e:void 0,A=function(e){if(!e||0===e.zones.length)return()=>({});let t=(0,l.I$)(e).shapes.filter(e=>"zone"===e.kind).map(e=>{var t,n;return{id:e.id,rect:{x:e.x,y:e.y,width:e.width,height:e.height},slots:Array.isArray(n=null===(t=e.meta)||void 0===t?void 0:t.slots)?n.flatMap(e=>{var t;return e&&"object"==typeof e?"string"!=typeof e.id||"number"!=typeof(null===(t=e.rect)||void 0===t?void 0:t.x)||"number"!=typeof e.rect.y||"number"!=typeof e.rect.width||"number"!=typeof e.rect.height?[]:[{id:e.id,rect:e.rect}]:[]}):[]}}),n=new Map(e.elements.map(e=>[e.id,e]));return e=>{let i=e.id?n.get(e.id):void 0,a="number"!=typeof e.x||"number"!=typeof e.y||"number"!=typeof e.width||"number"!=typeof e.height?null:{x:e.x+e.width/2,y:e.y+e.height/2};if(!a)return{...(null==i?void 0:i.zone)?{zone:i.zone}:{},...(null==i?void 0:i.slot)?{slot:i.slot}:{}};let l=t.find(e=>s(e.rect,a.x,a.y));if(!l)return{};let o=l.slots.find(e=>s(e.rect,a.x,a.y)),r=null!=o?o:l.slots.reduce((e,t)=>e?c(t.rect,a.x,a.y)<c(e.rect,a.x,a.y)?t:e:t,void 0);return{zone:l.id,...r?{slot:r.id}:{}}}}(e),H=e=>{let t=_(e.frameId);if(t){let n=A(e);return n.zone===t&&n.slot?{zone:t,slot:n.slot}:{zone:t}}return A(e)},j=e=>{if(!y)return{};let t=d(e,b,w);return t?{geometry:t}:{}},O=new Map;for(let e of t)"text"===e.type&&e.containerId&&"string"==typeof e.text&&O.set(e.containerId,e.text);let T=[],N=[];for(let e of t)if(e.id&&e.type)switch(e.type){case"rectangle":if(C.has(e.id))break;T.push({...z.get(e.id),...H(e),...j(e),id:e.id,type:"note",text:null!==(r=O.get(e.id))&&void 0!==r?r:""});break;case"ellipse":case"diamond":T.push({...z.get(e.id),...H(e),...j(e),id:e.id,type:"shape",shape:"ellipse"===e.type?"ellipse":"rectangle",text:null!==(u=O.get(e.id))&&void 0!==u?u:""});break;case"text":e.containerId||S.has(e.id)||T.push({...z.get(e.id),...H(e),...j(e),id:e.id,type:"text",text:null!==(h=e.text)&&void 0!==h?h:""});break;case"arrow":case"line":{let t=null===(f=e.startBinding)||void 0===f?void 0:f.elementId,n=null===(p=e.endBinding)||void 0===p?void 0:p.elementId;if(t&&n){let i=O.get(e.id),a=I.get("".concat(t,"\0").concat(n));N.push({from:t,to:n,...i?{label:i}:{},...a?a.style?{style:a.style}:{}:{style:"line"===e.type?"line":"arrow"}})}}}return{id:null!==(v=null==e?void 0:e.id)&&void 0!==v?v:"c1",title:null!==(m=null==e?void 0:e.title)&&void 0!==m?m:"Canvas 1",...(null==e?void 0:e.arrange)?{arrange:e.arrange}:{},zones:[...null!==(g=null==e?void 0:e.zones)&&void 0!==g?g:[],...W],elements:T,connections:N}}(e,null!==(i=y.get(t))&&void 0!==i?i:[])})}}(e,t):void 0},p.current=setTimeout(()=>void y(),1e3)},[y]);return{status:t,confirmedSourceRef:u,setConfirmedSource:g,queueSceneSave:k,retry:(0,i.useCallback)(()=>{var e;let t=null!==(e=h.current)&&void 0!==e?e:f.current;t&&(h.current=t,f.current=null,p.current&&clearTimeout(p.current),y())},[y])}}},39455:function(e,t,n){async function i(e){let t=await e.json().catch(()=>({}));if(!e.ok){var n;throw Error(null!==(n=t.error)&&void 0!==n?n:"Request failed (".concat(e.status,")"))}return t}async function a(e,t){let n=new URLSearchParams({workspace_id:e});t&&n.set("folder_id",t);let a=await fetch("/api/boards?".concat(n.toString())),{boards:l}=await i(a);return l}async function l(e){let t=await fetch("/api/boards/".concat(e)),{board:n}=await i(t);return n}async function o(e){let t=await fetch("/api/boards",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),{board:n}=await i(t);return n}async function r(e,t){let n=await fetch("/api/boards/".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),{board:a}=await i(n);return a}
1async function d(e){let t=await fetch("/api/boards/".concat(e),{method:"DELETE"});await i(t)}n.d(t,{L1:function(){return d},SZ:function(){return l},aX:function(){return o},wN:function(){return r},xM:function(){return a}})},64097:function(e,t,n){n.d(t,{W:function(){return h},u:function(){return i}});let i=1.28,a={ink:"#111614",ink2:"#4a534e",ink3:"#8a938d",surface:"#ffffff",line:"#e4e7e4",line2:"#d2d7d3",green:"#0e3b26",greenSoft:"#e8efe9",note:"#f4f5f3",amber:"#8a6d1f",red:"#7a2f3d"};function l(e){return/[WMwm@%]/u.test(e)?1.15:/\s/u.test(e)||/[ilI1.,:;!'|`]/u.test(e)?.35:/[A-ZÆØÅa-zæøå0-9]/u.test(e)?.8:.9}function o(e,t){return[...e].reduce((e,n)=>e+l(n)*t,0)}function r(e,t,n,a,r,d,s,c){var u;let h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:{},f=arguments.length>9&&void 0!==arguments[9]?arguments[9]:{},p=arguments.length>10?arguments[10]:void 0,v=void 0!==c&&void 0!==h.fontSize&&"zone"!==t?function(e,t,n,a,r,d){let s=Math.max(1,t-(r?28:0)),c=Math.max(1,n-(r?12:0));if(d){let t=function(e,t,n){if(o(e,n)<=t)return e;let i=[...e];for(;i.length>0&&o("".concat(i.join("").trimEnd()).concat("…"),n)>t;)i.pop();return"".concat(i.join("").trimEnd()).concat("…")}(e,s,a);return{fontSize:a,text:t,hardWrapped:!1,truncated:t!==e}}for(let t=Math.floor(a);t>=10;t-=1){if(e.split(/\s+/u).some(e=>o(e,t)>s)&&t>10)continue;let n=e.split("\n").map(e=>(function(e,t,n){let i=[],a=!1,o=e;for(;o;){let e=[...o],s=0,c=0,u=-1;for(let i=0;i<e.length;i+=1){var r,d;let a=s+l(null!==(r=e[i])&&void 0!==r?r:"")*n;if(a>t)break;s=a,c=i+1,/\s/u.test(null!==(d=e[i])&&void 0!==d?d:"")&&(u=i)}if(c===e.length){i.push(o);break}let h=u>0?u:Math.max(1,c);u<=0&&(a=!0),i.push(e.slice(0,h).join("").trimEnd()),o=e.slice(h).join("").trimStart()}return{lines:i.length>0?i:[""],hardWrapped:a}})(e,s,t)),a=n.flatMap(e=>e.lines);if(a.length*t*i<=c)return{fontSize:t,text:a.join("\n"),hardWrapped:n.some(e=>e.hardWrapped),truncated:!1}}throw Error("Compiler text does not fit ".concat(t,"x").concat(n," at ").concat(10,"px: ").concat(e.length," chars"))}(c,d,s,h.fontSize,"shape"===t||"note"===t,"title"===n):void 0,m=v?{...h,fontSize:v.fontSize,...v.hardWrapped?{hardWrapped:!0}:{},...v.truncated?{truncated:!0}:{}}:h;return{id:e,kind:t,x:a,y:r,width:d,height:s,...void 0!==c?{text:null!==(u=null==v?void 0:v.text)&&void 0!==u?u:c}:{},...p?{color:p}:{},meta:{role:n,visual:m,...f}}}function d(e,t,n,i,l,o,d){let s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:20,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:{},u=arguments.length>9&&void 0!==arguments[9]?arguments[9]:{};return r(e,"text",t,n,i,l,o,d,{stroke:a.ink,fontSize:s,verticalAlign:"top",...u},c)}function s(e,t,n,i,l,o,d){let s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{},c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:{};return r(e,"shape",t,n,i,l,o,d,{fill:a.surface,stroke:a.line2,strokeWidth:1,roundness:null,fontSize:17,textColor:a.ink,...s},c)}function c(e,t,n,i,l,o,d){let s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};return r(e,"note","panel",t,n,i,l,o,{stroke:a.line,strokeWidth:1,roundness:null,fontSize:16,textColor:a.ink},s,d)}function u(e,t,n,i){let l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:44,o=[],r=Math.min(76,Math.max(48,(620-l)/Math.max(n.length,1))),d=t.reduce((e,t)=>e+t.width,0),c=l+n.length*r,u=[];{let e=64;for(let n of t)u.push(e),e+=n.width}t.forEach((t,n)=>{o.push(s("".concat(e.id,":th:").concat(t.key),"table-header",u[n],220,t.width,l,t.label.toUpperCase(),{fill:a.note,stroke:"transparent",roundness:null,fontSize:14,fontWeight:600,textColor:a.ink2,verticalAlign:"middle"},{field:t.key}))}),n.forEach((n,d)=>{t.forEach((t,c)=>{var h;o.push(s("".concat(e.id,":row:").concat(d,":").concat(t.key),"table-row",u[c],220+l+d*r,t.width,r,null!==(h=n[t.key])&&void 0!==h?h:"",{fill:a.surface,stroke:"transparent",roundness:null,fontSize:t.key===i?17:15,fontWeight:t.key===i?600:400,verticalAlign:"middle"},{field:t.key,row:d}))})});let h=(e,t,n,i,a,l)=>s(e,"divider",t,n,i,a,void 0,{fill:l,stroke:l,strokeWidth:1,roundness:null});o.push(s("".concat(e.id,":table:border"),"divider",64,220,d,c,void 0,{fill:"transparent",stroke:a.line2,strokeWidth:1,roundness:null})),o.push(h("".concat(e.id,":table:hline:header"),64,220+l,d,1,a.line2));for(let t=1;t<n.length;t+=1)o.push(h("".concat(e.id,":table:hline:").concat(t),64,220+l+t*r,d,1,a.line));for(let n=1;n<t.length;n+=1)o.push(h("".concat(e.id,":table:vline:").concat(n),u[n],220,1,c,a.line));return o}function h(e){let t;switch(e.archetype){case"agenda_table":t=u(e,[{key:"tid",label:"Tid",width:180},{key:"punkt",label:"Punkt",width:690},{key:"format",label:"Format",width:330},{key:"eier",label:"Eier",width:272}],e.data.rader,"punkt");break;case"brainstorm":t=function(e){let t=Math.max(e.data.felter.length,1),n=(1472-20*(t-1))/t;return e.data.felter.flatMap((t,i)=>{let l=64+i*(n+20),o=[s("".concat(e.id,":field:").concat(t.id),"panel",l,220,n,620,void 0,{stroke:a.line2,strokeStyle:"dashed"},{fields:["id","tittel","ledetekst","lapper"]}),d("".concat(e.id,":field-title:").concat(t.id),"panel-title",l+18,236,n-36,28,t.tittel,17,{},{fontWeight:700}),...t.ledetekst?[d("".concat(e.id,":lead:").concat(t.id),"instruction",l+18,268,n-36,40,t.ledetekst,14,{},{stroke:a.ink3})]:[]];t.lapper.forEach((i,a)=>{let r=Math.min(210,n-36),d=a%Math.max(1,Math.floor((n-36)/(r+10))),s=Math.floor(a/Math.max(1,Math.floor((n-36)/(r+10))));o.push(c("".concat(e.id,":note:").concat(t.id,":").concat(a),l+18+d*(r+10),320+84*s,r,68,i,"gray",{field:t.id}))});let r=320+84*Math.ceil(t.lapper.length/2);return r+62<=840&&o.push(s("".concat(e.id,":slot:").concat(t.id),"panel",l+18,r,Math.min(210,n-36),58,"Nytt bidrag …",{stroke:a.line2,strokeStyle:"dashed",fill:a.surface,fontSize:14},{emptySlot:!0})),o})}(e);break;case"cluster":t=function(e){let t=Math.max(e.data.klynger.length,1),n=(1472-20*(t-1))/t;return e.data.klynger.flatMap((t,i)=>{let l=64+i*(n+20),o=t.vinner?a.green:a.line2;return[s("".concat(e.id,":cluster:").concat(t.id),"panel",l,220,n,620,void 0,{stroke:o,strokeWidth:t.vinner?2:1},{fields:["id","navn","lapper","antall","vinner"],winner:t.vinner}),d("".concat(e.id,":cluster-title:").concat(t.id),"panel-title",l+18,238,n-100,28,t.navn,18,{},{fontWeight:700,stroke:t.vinner?a.green:a.ink}),s("".concat(e.id,":cluster-count:").concat(t.id),"status",l+n-78,232,60,32,String(t.antall),{fill:a.note,stroke:a.line,fontSize:14}),...t.lapper.map((i,a)=>c("".concat(e.id,":cluster-note:").concat(t.id,":").concat(a),l+18,292+78*a,n-36,62,i,t.vinner?"green":"gray",{cluster:t.id}))]})}(e);break;case"matrix":t=function(e){let t=[s("".concat(e.id,":axis-x"),"axis",154,770,1342,2,void 0,{fill:a.ink2,stroke:a.ink2,roundness:null},{fields:["akse_x.lav","akse_x.hoy"]}),s("".concat(e.id,":axis-y"),"axis",154,240,2,530,void 0,{fill:a.ink2,stroke:a.ink2,roundness:null},{fields:["akse_y.lav","akse_y.hoy"]}),d("".concat(e.id,":x-low"),"axis",154,782,250,28,e.data.akse_x.lav,14,{},{stroke:a.ink2,fontWeight:600}),d("".concat(e.id,":x-high"),"axis",1246,782,250,28,e.data.akse_x.hoy,14,{},{stroke:a.ink2,fontWeight:600,textAlign:"right"}),d("".concat(e.id,":y-high"),"axis",64,240,80,40,e.data.akse_y.hoy,14,{},{stroke:a.ink2,fontWeight:600}),d("".concat(e.id,":y-low"),"axis",64,730,80,40,e.data.akse_y.lav,14,{},{stroke:a.ink2,fontWeight:600})];return e.data.kvadranter.forEach((n,i)=>{t.push(s("".concat(e.id,":quadrant:").concat(n.id),"quadrant",154+i%2*1342/2,240+Math.floor(i/2)%2*530/2,671,265,n.tittel.toUpperCase(),{fill:a.surface,stroke:a.line,strokeStyle:"dashed",roundness:null,fontSize:13,textAlign:"right"},{fields:["id","tittel"]}))}),e.data.punkter.forEach((n,i)=>
1{let l=154+1192*Math.max(0,Math.min(1,n.x)),o=240+(1-Math.max(0,Math.min(1,n.y)))*478;t.push(s("".concat(e.id,":point:").concat(i),"data-point",l,o,150,52,n.etikett,{fill:a.surface,stroke:a.green,strokeWidth:2,fontSize:15,fontWeight:600},{fields:["etikett","x","y","kvadrant"],quadrant:n.kvadrant}))}),t}(e);break;case"timeline":t=function(e){let t=[s("".concat(e.id,":track"),"timeline-track",124,520,1352,3,void 0,{fill:a.line2,stroke:a.line2,roundness:null})],n=e.data.faser;return n.forEach((i,l)=>{let o=1352/Math.max(n.length,1);t.push(d("".concat(e.id,":phase:").concat(i.id),"panel-title",124+l*o,564,o,66,"".concat(i.navn.toUpperCase(),"\n").concat(i.start,"–").concat(i.slutt),14,{fields:["id","navn","start","slutt"]},{stroke:a.ink3,textAlign:"center",fontWeight:600}))}),e.data.milepaeler.forEach((n,i)=>{let l=124+(i+1)/(e.data.milepaeler.length+1)*1352;t.push(s("".concat(e.id,":milestone-dot:").concat(i),"milestone",l-9,512,18,18,void 0,{fill:a.surface,stroke:a.green,strokeWidth:3,roundness:99,shape:"ellipse"}),d("".concat(e.id,":milestone:").concat(i),"milestone",l-110,408,220,100,"".concat(n.milepael,"\n").concat(n.dato," \xb7 ").concat(n.eier),15,{fields:["milepael","dato","eier","fase"],phase:n.fase},{textAlign:"center",fontWeight:600}))}),t}(e);break;case"lanes":t=function(e){let t=e.data.laner,n=620/Math.max(t.length,1);return t.flatMap((t,i)=>{let l=220+i*n,o=e.data.tiltak.filter(e=>e.lane===t.id);return[s("".concat(e.id,":lane:").concat(t.id),"lane",64,l,1472,n,void 0,{stroke:a.line,roundness:null},{fields:["id","navn","eier"]}),s("".concat(e.id,":lane-head:").concat(t.id),"panel-title",64,l,230,n,"".concat(t.navn,"\nEier: ").concat(t.eier),{fill:a.note,stroke:a.line,roundness:null,fontSize:16,fontWeight:700},{lane:t.id}),...o.map((i,a)=>c("".concat(e.id,":lane-action:").concat(t.id,":").concat(a),324+250*a,l+24,225,Math.min(76,n-48),"".concat(i.tiltak,"\n").concat(i.eier),"gray",{fields:["tiltak","lane","eier"],lane:t.id}))]})}(e);break;case"vote":t=function(e){let t=e.data.alternativer,n=Math.min(90,(620-12*Math.max(t.length-1,0))/Math.max(t.length,1));return t.map((t,i)=>s("".concat(e.id,":vote:").concat(i),"vote-row",224,220+i*(n+12),1152,n,"#".concat(t.rang,"   ").concat(t.alternativ,"                                      ").concat("●".repeat(Math.min(t.stemmer,12)),"  ").concat(t.stemmer),{fill:t.vinner?a.greenSoft:a.surface,stroke:t.vinner?a.green:a.line,strokeWidth:t.vinner?2:1,fontSize:18,fontWeight:t.vinner?700:600},{fields:["alternativ","stemmer","rang","vinner"],winner:t.vinner}))}(e);break;case"canvas_grid":t=function(e){let t=Math.max(1,Math.ceil(e.data.felter.length/2)),n=(620-16*Math.max(t-1,0))/t;return[s("".concat(e.id,":hero"),"hero",64,220,430,620,"".concat(e.data.hero.tittel.toUpperCase(),"\n\n").concat(e.data.hero.konklusjon),{fill:a.greenSoft,stroke:a.green,strokeWidth:2,fontSize:20,fontWeight:700},{fields:["hero.tittel","hero.konklusjon"]}),...e.data.felter.flatMap((t,i)=>{let l=510+i%2*521,o=220+Math.floor(i/2)*(n+16);return[s("".concat(e.id,":canvas-field:").concat(t.id),"panel",l,o,505,n,void 0,{fill:a.surface,stroke:a.line2},{fields:["id","tittel","ledetekst","innhold"]}),d("".concat(e.id,":canvas-title:").concat(t.id),"panel-title",l+18,o+16,469,24,t.tittel,16,{},{fontWeight:700}),d("".concat(e.id,":canvas-lead:").concat(t.id),"instruction",l+18,o+46,469,36,t.ledetekst,13,{},{stroke:a.ink3}),...t.innhold.map((n,i)=>c("".concat(e.id,":canvas-note:").concat(t.id,":").concat(i),l+18,o+90+58*i,469,48,n,"gray",{field:t.id,definedSlot:i}))]})]}(e);break;case"swot":t=[["styrker","STYRKER",e.data.styrker,a.green],["svakheter","SVAKHETER",e.data.svakheter,a.red],["muligheter","MULIGHETER",e.data.muligheter,a.amber],["trusler","TRUSLER",e.data.trusler,a.ink3]].map((t,n)=>{let[i,l,o,r]=t;return s("".concat(e.id,":swot:").concat(i),"panel",64+n%2*744,220+318*Math.floor(n/2),728,302,"".concat(l,"\n\n").concat(o.map(e=>"▪ ".concat(e)).join("\n")),{fill:a.surface,stroke:r,strokeWidth:2,fontSize:17,fontWeight:500},{field:i,meaningColor:r})});break;case"comparison":t=function(e){let t=[{key:"kriterium",label:"Kriterium",width:1472-240*e.data.alternativer.length},...e.data.alternativer.map((e,t)=>
1({key:"option_".concat(t),label:"".concat(e.alternativ).concat(e.vinner?" \xb7 VINNER":""),width:240}))],n=e.data.kriterier.map(t=>({kriterium:t.kriterium,...Object.fromEntries(e.data.alternativer.map((e,n)=>{var i,a;return["option_".concat(n),String(null!==(a=null===(i=e.scorer.find(e=>e.kriterium===t.id))||void 0===i?void 0:i.score)&&void 0!==a?a:"—")]}))}));n.push({kriterium:"TOTAL",...Object.fromEntries(e.data.alternativer.map((e,t)=>["option_".concat(t),String(e.total)]))});let i=e.data.alternativer.findIndex(e=>e.vinner),l="option_".concat(i);return u(e,t,n,void 0,56).map(e=>{var t,n,i,o,r;let d=(null===(t=e.meta)||void 0===t?void 0:t.field)===l,s=null!==(r=null===(n=e.meta)||void 0===n?void 0:n.visual)&&void 0!==r?r:{};return{...e,meta:{...e.meta,visual:d?{...s,fill:a.greenSoft,stroke:a.green,strokeWidth:2,fontWeight:700}:s,winnerColumn:d,fields:(null===(i=e.meta)||void 0===i?void 0:i.role)==="table-row"?["kriterier","scorer","total","vinner"]:null===(o=e.meta)||void 0===o?void 0:o.fields}}})}(e);break;case"empathy_map":t=function(e){let t=e.data.felter,n=t.filter((e,t)=>t%2==0),i=t.filter((e,t)=>t%2==1),l=(t,n,i,l)=>{let o=(620-16*Math.max(l-1,0))/Math.max(l,1),r=220+n*(o+16);return[s("".concat(e.id,":empathy:").concat(t.felt,":").concat(n),"panel",i,r,555,o,void 0,{fill:a.surface,stroke:a.line2},{fields:["felt","utsagn"]}),d("".concat(e.id,":empathy-title:").concat(n),"panel-title",i+18,r+16,519,24,t.felt.toUpperCase(),15,{},{fontWeight:700}),...t.utsagn.map((a,l)=>c("".concat(e.id,":empathy-note:").concat(n,":").concat(l),i+18,r+54+52*l,519,44,a,"gray",{field:t.felt,definedSlot:l}))]};return[...n.flatMap((e,t)=>l(e,t,64,n.length)),s("".concat(e.id,":persona"),"persona",635,220,330,620,"◯\n\n".concat(e.data.persona.navn,"\n").concat(e.data.persona.beskrivelse),{fill:a.greenSoft,stroke:a.green,strokeWidth:2,fontSize:21,fontWeight:700,textAlign:"center"},{fields:["persona.navn","persona.beskrivelse"]}),...i.flatMap((e,t)=>l(e,t,981,i.length))]}(e);break;case"decision_log":t=u(e,[{key:"beslutning",label:"Beslutning",width:490},{key:"begrunnelse",label:"Begrunnelse",width:430},{key:"eier",label:"Eier",width:190},{key:"frist",label:"Frist",width:170},{key:"status",label:"Status",width:192}],e.data.beslutninger,"beslutning");break;case"action_plan":t=u(e,[{key:"tiltak",label:"Tiltak",width:580},{key:"eier",label:"Eier",width:220},{key:"frist",label:"Frist",width:210},{key:"suksesskriterium",label:"Suksesskriterium",width:462}],e.data.tiltak,"tiltak");break;case"retro":t=function(e){let t=Math.max(e.data.kolonner.length,1),n=(1472-18*(t-1))/t,i=["green","pink","yellow"];return e.data.kolonner.flatMap((t,l)=>{let o=64+l*(n+18);return[s("".concat(e.id,":retro:").concat(t.id),"panel",o,220,n,620,void 0,{stroke:a.line2},{fields:["id","tittel","innslag"]}),d("".concat(e.id,":retro-title:").concat(t.id),"panel-title",o+18,238,n-36,28,"".concat(t.tittel.toUpperCase()," \xb7 ").concat(t.innslag.length),16,{},{fontWeight:700}),...t.innslag.map((a,r)=>{var d;return c("".concat(e.id,":retro-item:").concat(t.id,":").concat(r),o+18,290+82*r,n-36,66,"".concat(a.tekst,"     ").concat("●".repeat(Math.min(a.stemmer,8))," ").concat(a.stemmer),null!==(d=i[l%i.length])&&void 0!==d?d:"gray",{fields:["tekst","stemmer"],column:t.id})})]})}(e);break;case"parking":t=u(e,[{key:"tema",label:"Tema",width:680},{key:"tilbake_til",label:"Tilbake til",width:396},{key:"nar",label:"N\xe5r",width:396}],e.data.rader,"tema")}let n="".concat(e.id,":frame"),i=[...function(e){let{frame:t}=e;return[r("".concat(e.id,":frame"),"zone","frame",0,0,1600,900,e.title,{fill:a.surface,stroke:a.line2,strokeWidth:1,roundness:null}),s("".concat(e.id,":bg"),"panel",0,0,1600,900,void 0,{fill:a.surface,stroke:a.surface,strokeWidth:0,roundness:null}),d("".concat(e.id,":eyebrow"),"eyebrow",64,48,1050,24,t.eyebrow.toUpperCase(),15,{},{stroke:a.green,fontWeight:600}),d("".concat(e.id,":title"),"title",64,78,1080,48,t.title,32,{},{fontWeight:700}),d("".concat(e.id,":instruction"),"instruction",64,132,1050,42,t.instruction,18,{},{stroke:a.ink2}),d("".concat(e.id,":meta"),"meta",1210,60,326,70,"".concat(t.meta.primary,"\n").concat(t.meta.secondary),16,{fields:["primary","secondary"]},{stroke:a.ink2,textAlign:"right",fontWeight:500}),s("".concat(e.id,":divider"),"divider",64,190,1472,1,void 0,{fill:a.line,stroke:a.line,roundness:null})]}(e),...t].map(e=>e.id===n?e:{...e,parentId:n});return{canvasId:e.id,width:1600,height:900,shapes:i,bindings:[],meta:{archetype:e.archetype,aspectRatio:"16:9"}}}}
1,39990:function(e,t,n){n.d(t,{uH:function(){return r.u},I$:function(){return u},vK:function(){return c}});let i={canvasPadding:64,zoneGap:48,zoneW:520,zoneH:420,zoneHeader:48,zonePadding:16,slotHeader:24,slotInset:6,noteW:160,noteH:96,noteGap:12};function a(e){return{x:e.x+i.slotInset,y:e.y+i.slotHeader,width:Math.max(i.noteW,e.width-2*i.slotInset),height:Math.max(i.noteH,e.height-i.slotHeader-i.slotInset)}}function l(e,t){let n=Math.max(1,Math.floor((e.width+i.noteGap)/(i.noteW+i.noteGap))),a=[];for(let l=0;l<t;l++){let t=l%n,o=Math.floor(l/n);a.push({x:e.x+t*(i.noteW+i.noteGap),y:e.y+o*(i.noteH+i.noteGap)})}return a}var o=n(76782),r=n(64097);let d={"matrix-2x2":{id:"matrix-2x2",name:"2\xd72-matrise",description:"Effekt vs. innsats",base:"matrix",axes:{x:{low:"Lav innsats",high:"H\xf8y innsats"},y:{low:"Lav effekt",high:"H\xf8y effekt"}},slots:[{id:"quick-wins",label:"Quick wins",at:["low","high"]},{id:"big-bets",label:"Store satsinger",at:["high","high"]},{id:"fill-ins",label:"Fyll-inn",at:["low","low"]},{id:"avoid",label:"Unng\xe5",at:["high","low"]}],defaults:{note_color:"yellow"}},eisenhower:{id:"eisenhower",name:"Eisenhower-matrise",description:"Haster vs. viktig",base:"matrix",axes:{x:{low:"Ikke haster",high:"Haster"},y:{low:"Ikke viktig",high:"Viktig"}},slots:[{id:"do",label:"Gj\xf8r n\xe5",at:["high","high"]},{id:"plan",label:"Planlegg",at:["low","high"]},{id:"delegate",label:"Deleger",at:["high","low"]},{id:"drop",label:"Drop",at:["low","low"]}]},columns:{id:"columns",name:"Kolonner",description:"Generiske kolonner (instans angir kolonnene)",base:"columns",columns:[]},"stop-start-continue":{id:"stop-start-continue",name:"Stop / Start / Continue",base:"columns",columns:[{id:"stop",label:"Stop"},{id:"start",label:"Start"},{id:"continue",label:"Continue"}]},"t-chart":{id:"t-chart",name:"T-skjema",description:"Fordeler/ulemper, n\xe5/fremtid",base:"columns",columns:[{id:"left",label:"Venstre"},{id:"right",label:"H\xf8yre"}]},grid:{id:"grid",name:"Rutenett",description:"N\xd7M (instans angir rad/kolonne-labels via slots)",base:"grid",slots:[]},stack:{id:"stack",name:"Bunke",description:"Id\xe9myldringsb\xf8tte",base:"stack",slots:[{id:"main",label:""}]},lanes:{id:"lanes",name:"Baner",description:"Journey map, roadmap-faser (instans angir banene)",base:"lanes",lanes:[]},clusters:{id:"clusters",name:"Klynger",description:"Affinitetssortering",base:"free"},freeform:{id:"freeform",name:"Fritt omr\xe5de",base:"free"}},s="__free__";function c(e){return"free"===e.arrange&&0===e.zones.length&&e.elements.length>0&&e.elements.some(e=>void 0!==e.geometry)}function u(e){var t,n,u,h,f,p,v,m;let g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,o.rO)(e)){let i=(0,r.W)(e),a=e.overlay;if(!(null==a?void 0:a.elements.length)&&!(null==a?void 0:null===(t=a.connections)||void 0===t?void 0:t.length))return i;let l="".concat(e.id,":frame"),o=i.shapes.find(e=>e.id===l);if(!o)throw Error("Archetype canvas ".concat(e.id," has no normative frame"));let d=new Set(i.shapes.map(e=>e.id)),s=new Set,c=a.elements.map(e=>{if(d.has(e.id)||s.has(e.id))throw Error("Overlay element id collides with normative content: ".concat(e.id));s.add(e.id);let{x:t,y:n,width:i,height:a,rotation:r}=e.geometry;if(t<0||n<0||t+i>o.width||n+a>o.height)throw Error("Overlay element ".concat(e.id," is outside archetype frame bounds"));return{id:e.id,kind:e.type,x:t,y:n,width:i,height:a,parentId:l,text:e.text,color:e.color,meta:{style:e.style,shape:e.shape,...void 0===r?{}:{rotation:r},overlay:!0}}}),u=new Set([...d,...s]),h=(null!==(n=a.connections)&&void 0!==n?n:[]).map(e=>{var t;if(!u.has(e.from)||!u.has(e.to))throw Error("Overlay connection ".concat(e.from," → ").concat(e.to," references missing content"));return{id:"".concat(e.from,"__").concat(e.to),from:e.from,to:e.to,label:e.label,style:null!==(t=e.style)&&void 0!==t?t:"arrow"}});return{...i,shapes:[...i.shapes,...c],bindings:[...i.bindings,...h]}}if(c(e))return function(e){var t;let n="".concat(e.id,":frame"),i=new Set,a=[],l=[{id:n,kind:"zone",x:0,y:0,width:1600,height:900,text:e.title,meta:{base:"free",custom:!0}}];for(let t of e.elements){let e=t.geometry;if(!e)throw Error("Custom canvas element ".concat(t.id," has no explicit geometry"));if(i.has(t.id)||t.id===n)throw Error("Custom canvas element id collides: ".concat(t.id));i.add(t.id);let o={x:e.x,y:e.y,width:e.width,height:e.height};if([o.x,o.y,o.width,o.height].some(e=>e%4!=0))throw Error("Custom canvas element ".concat(t.id," is not aligned to the 4 px grid"));if(o.x<0||o.y<0||o.width<("text"===t.type?80:120)||o.height<("text"===t.type?24:64)||o.x+o.width>1600||o.y+o.height>900)throw Error("Custom canvas element ".concat(t.id," violates readability or 1600\xd7900 frame bounds"));let r=a.find(e=>{var t;return(t=e.rect).x<o.x+o.width&&t.x+t.width>o.x&&t.y<o.y+o.height&&t.y+t.height>o.y});if(r)throw Error("Custom canvas elements overlap: ".concat(r.id,", ").concat(t.id));a.push({id:t.id,rect:o}),l.push({id:t.id,kind:t.type,...o,parentId:n,text:t.text,color:t.color,meta:{style:t.style,shape:t.shape,custom:!0,...void 0===e.rotation?{}:{rotation:e.rotation}}})}let o=(null!==(t=e.connections)&&void 0!==t?t:[]).map(e=>{var t;if(!i.has(e.from)||!i.has(e.to))throw Error("Custom canvas connection ".concat(e.from," → ").concat(e.to," references missing content"));return{id:"".concat(e.from,"__").concat(e.to),from:e.from,to:e.to,label:e.label,style:null!==(t=e.style)&&void 0!==t?t:"arrow"}});return{canvasId:e.id,width:1600,height:900,shapes:l,bindings:o,meta:{aspectRatio:"16:9",custom:!0}}}(e);let y=[],k=[],x=null!==(u=e.arrange)&&void 0!==u?u:"grid",b=function(e,t){let n="row"===t?Math.max(1,e):"column"===t?1:Math.max(1,Math.ceil(Math.sqrt(e))),a=[];for(let l=0;l<e;l++){let e="column"===t?0:l%n,o="row"===t?0:Math.floor(l/n);a.push({x:i.canvasPadding+e*(i.zoneW+i.zoneGap),y:i.canvasPadding+o*(i.zoneH+i.zoneGap),width:i.zoneW,height:i.zoneH})}return a}(e.zones.length,x),w=new Map;
1for(let t of(e.zones.forEach((e,t)=>{var n,a,l,o,r,s,c,u,h;let f=b[t];if(!f)return;let p=(a=e.template,{...s=null!==(r=null!==(o=null==(l=g.templates)?void 0:l[a])&&void 0!==o?o:d[a])&&void 0!==r?r:{id:a,name:a,base:"free"},axes:null!==(c=e.axes)&&void 0!==c?c:s.axes,columns:null!==(u=e.columns)&&void 0!==u?u:s.columns,lanes:null!==(h=e.lanes)&&void 0!==h?h:s.lanes}),v=function(e,t){var n,a,l,o,r,d,s,c,u,h,f,p,v;let m={x:e.x+i.zonePadding,y:e.y+i.zoneHeader,width:e.width-2*i.zonePadding,height:e.height-i.zoneHeader-i.zonePadding},g=[];switch(t.base){case"matrix":{let e=m.width/2,i=m.height/2;for(let l of null!==(n=t.slots)&&void 0!==n?n:[]){let[t,n]=null!==(a=l.at)&&void 0!==a?a:["low","low"],o="high"===t?1:0,r="high"===n?0:1;g.push({id:l.id,label:l.label,rect:{x:m.x+o*e,y:m.y+r*i,width:e,height:i}})}break}case"columns":{let e=null!==(l=t.columns)&&void 0!==l?l:[],n=Math.max(1,e.length),i=m.width/n;0===e.length?g.push({id:"main",label:"",rect:m}):e.forEach((e,t)=>{g.push({id:e.id,label:e.label,rect:{x:m.x+t*i,y:m.y,width:i,height:m.height}})});break}case"lanes":{let e=null!==(o=t.lanes)&&void 0!==o?o:[],n=Math.max(1,e.length),i=m.height/n;0===e.length?g.push({id:"main",label:"",rect:m}):e.forEach((e,t)=>{g.push({id:e.id,label:e.label,rect:{x:m.x,y:m.y+t*i,width:m.width,height:i}})});break}case"grid":{let e=null!==(r=t.slots)&&void 0!==r?r:[];if(0===e.length){g.push({id:"main",label:"",rect:m});break}let n=[],i=[];for(let t of e){let[e,a]=null!==(d=t.at)&&void 0!==d?d:["",""];n.includes(e)||n.push(e),i.includes(a)||i.push(a)}let a=m.width/Math.max(1,i.length),l=m.height/Math.max(1,n.length);for(let t of e){let[e,o]=null!==(s=t.at)&&void 0!==s?s:["",""],r=Math.max(0,n.indexOf(e)),d=Math.max(0,i.indexOf(o));g.push({id:t.id,label:t.label,rect:{x:m.x+d*a,y:m.y+r*l,width:a,height:l}})}break}default:{let e=null!==(p=null===(u=t.slots)||void 0===u?void 0:null===(c=u[0])||void 0===c?void 0:c.id)&&void 0!==p?p:"stack"===t.base?"main":"free";g.push({id:e,label:null!==(v=null===(f=t.slots)||void 0===f?void 0:null===(h=f[0])||void 0===h?void 0:h.label)&&void 0!==v?v:"",rect:m})}}let y=new Map;for(let e of g)y.set(e.id,e.rect);return{order:g,byId:y,fallback:m}}(f,p);w.set(e.id,{rect:f,slots:v}),y.push({id:e.id,kind:"zone",x:f.x,y:f.y,width:f.width,height:f.height,text:null!==(n=e.title)&&void 0!==n?n:p.name,meta:{base:p.base,axes:p.axes,slots:v.order.map(e=>({id:e.id,label:e.label,rect:e.rect}))}})}),e.zones)){let n=w.get(t.id);if(!n)continue;let o=e.elements.filter(e=>e.zone===t.id),r=new Map;for(let e of o){let t=e.slot&&n.slots.byId.has(e.slot)?e.slot:s,i=null!==(h=r.get(t))&&void 0!==h?h:[];i.push(e),r.set(t,i)}for(let[e,o]of r){let r=l(e===s?a(n.slots.fallback):a(n.slots.byId.get(e)),o.length);o.forEach((n,a)=>{let l=r[a];l&&y.push({id:n.id,kind:n.type,x:l.x,y:l.y,width:i.noteW,height:i.noteH,parentId:t.id,text:n.text,color:n.color,meta:{slot:e===s?void 0:e,style:n.style,shape:n.shape}})})}}let M=e.elements.filter(e=>!e.zone);if(M.length>0){let e=Math.max(i.canvasPadding,...b.map(e=>e.y+e.height)),t=l({x:i.canvasPadding,y:e+i.zoneGap,width:Math.max(i.zoneW,(null!==(p=null===(f=b[0])||void 0===f?void 0:f.width)&&void 0!==p?p:i.zoneW)*2),height:i.zoneH},M.length);M.forEach((e,n)=>{let a=t[n];a&&y.push({id:e.id,kind:e.type,x:a.x,y:a.y,width:i.noteW,height:i.noteH,text:e.text,color:e.color,meta:{style:e.style,shape:e.shape}})})}for(let t of null!==(v=e.connections)&&void 0!==v?v:[])k.push({id:"".concat(t.from,"__").concat(t.to),from:t.from,to:t.to,label:t.label,style:null!==(m=t.style)&&void 0!==m?m:"arrow"});let S=i.canvasPadding,z=i.canvasPadding;for(let e of y)S=Math.max(S,e.x+e.width),z=Math.max(z,e.y+e.height);return{canvasId:e.id,width:S+i.canvasPadding,height:z+i.canvasPadding,shapes:y,bindings:k}}},17326:function(e,t,n){n.d(t,{YA:function(){return r},nA:function(){return d},x_:function(){return s}});var i=n(39990),a=n(64097),l=n(76782),o=n(58354);function r(e,t){var n,i,a,l;if(0===t.length)return[...e];let o=new Map(t.map(e=>[e.frameId,e])),r=new Set;for(let t of e){if(!t.id||!t.frameId||t.containerId)continue;let e=o.get(t.frameId);!(!e||e.normativeIds.includes(t.id))&&["rectangle","ellipse","diamond","text"].includes(null!==(n=t.type)&&void 0!==n?n:"")&&r.add(t.id)}for(let t of e){if(!t.id||!["arrow","line"].includes(null!==(l=t.type)&&void 0!==l?l:""))continue;let e=null===(i=t.startBinding)||void 0===i?void 0:i.elementId,n=null===(a=t.endBinding)||void 0===a?void 0:a.elementId;(e&&r.has(e)||n&&r.has(n))&&r.add(t.id)}for(let t of e)t.id&&t.containerId&&r.has(t.containerId)&&r.add(t.id);return e.filter(e=>!e.id||!r.has(e.id))}function d(e){var t,n,r,d,s,c,u,h,f,p,v,m;
1let g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},y=(null!==(t=null==e?void 0:e.canvases)&&void 0!==t?t:[]).map((e,t)=>{try{return{canvas:e,index:t,contract:(0,i.I$)(e,g),error:void 0}}catch(n){return{canvas:e,index:t,contract:void 0,error:n instanceof Error?n.message:String(n)}}}),k=Math.max(1600,...y.map(e=>{var t,n;return null!==(n=null===(t=e.contract)||void 0===t?void 0:t.width)&&void 0!==n?n:0})),x=Math.max(900,...y.map(e=>{var t,n;return null!==(n=null===(t=e.contract)||void 0===t?void 0:t.height)&&void 0!==n?n:0})),b=Math.max(1,Math.ceil(Math.sqrt(Math.max(y.length,1)))),w=[],M=[],S=[],z=[],I=[];for(let e of y){let t=e.index%b,i=Math.floor(e.index/b),g=t*(k+160),y=i*(x+160),W=null!==(d=null===(n=e.canvas)||void 0===n?void 0:n.id)&&void 0!==d?d:"c".concat(e.index),E=null!==(s=null===(r=e.canvas)||void 0===r?void 0:r.title)&&void 0!==s?s:"Flate ".concat(e.index+1);if(function(e){var t,n;return!(!e||(0,l.rO)(e))&&0===e.zones.length&&0===e.elements.length&&(null!==(n=null===(t=e.connections)||void 0===t?void 0:t.length)&&void 0!==n?n:0)===0}(e.canvas)){let t=[{type:"frame",id:"".concat(W,":frame"),x:g,y:y,width:k,height:x,name:E,children:[]}];w.push(...t),M.push({canvasId:W,frameIds:["".concat(W,":frame")],skeletons:t}),S.push({canvasId:W,title:E,index:e.index,ok:!0,offsetX:g,offsetY:y});continue}if(e.contract)try{let t=(0,o.I)(function(e,t,n){return 0===t&&0===n?e:{...e,shapes:e.shapes.map(e=>({...e,x:e.x+t,y:e.y+n}))}}(e.contract,g,y));if(!t.some(e=>"frame"===e.type))throw Error("Canvaset produserte ingen synlig frame");if(w.push(...t),(0,l.rO)(e.canvas)&&void 0!==e.canvas.overlay){let n=(0,a.W)(e.canvas),i=new Set([...n.shapes.map(e=>e.id),...n.bindings.map(e=>e.id)]),l=new Set([...(null!==(f=null===(c=e.canvas.overlay)||void 0===c?void 0:c.elements)&&void 0!==f?f:[]).map(e=>e.id),...(null!==(p=null===(u=e.canvas.overlay)||void 0===u?void 0:u.connections)&&void 0!==p?p:[]).map(e=>"".concat(e.from,"__").concat(e.to))]);z.push(...t.filter(e=>e.id&&l.has(e.id))),I.push({frameId:"".concat(e.canvas.id,":frame"),normativeIds:[...i],overlayIds:(null!==(v=null===(h=e.canvas.overlay)||void 0===h?void 0:h.elements)&&void 0!==v?v:[]).map(e=>e.id)})}M.push({canvasId:W,frameIds:t.flatMap(e=>"frame"===e.type&&e.id?[e.id]:[]),skeletons:t}),S.push({canvasId:W,title:E,index:e.index,ok:!0,offsetX:g,offsetY:y});continue}catch(t){e.error=t instanceof Error?t.message:String(t)}let C=null!==(m=e.error)&&void 0!==m?m:"ukjent feil",_=function(e,t,n,i,a,l,o){let r="".concat(e,":unrendered"),d="".concat(r,":msg");return[{type:"frame",id:r,x:n,y:i,width:a,height:900,name:"⚠ ".concat(t," — kunne ikke rendres"),children:[d]},{type:"text",id:d,x:n+64,y:i+64,width:Math.max(1,a-128),height:160,text:"Denne flaten kunne ikke rendres.\n".concat(o),fontSize:18,strokeColor:"#7a2f3d"}]}(W,E,g,y,k,0,C);w.push(..._),M.push({canvasId:W,frameIds:_.flatMap(e=>"frame"===e.type&&e.id?[e.id]:[]),skeletons:_}),S.push({canvasId:W,title:E,index:e.index,ok:!1,offsetX:g,offsetY:y,error:C})}let W=S.filter(e=>!e.ok);return{skeletons:w,canvasSkeletons:M,placements:S,rendered:S.length-W.length,failed:W,overlaySkeletons:z,archetypeOverlayScopes:I}}function s(e,t){var n,i,a,l,o;let r=null!==(n=null==t?void 0:t.skeletons)&&void 0!==n?n:null;return(null==e?void 0:e.length)?{elements:e,compilerSkeletons:r,backfillSkeletons:t?function(e,t){var n;let i=new Set(null!==(n=null==e?void 0:e.flatMap(e=>(null==e?void 0:e.type)==="frame"&&!e.isDeleted&&e.id?[e.id]:[]))&&void 0!==n?n:[]);return t.canvasSkeletons.flatMap(e=>e.frameIds.length>0&&e.frameIds.every(e=>i.has(e))?[]:e.skeletons)}(e,t):null,overlaySkeletons:null!==(i=null==t?void 0:t.overlaySkeletons)&&void 0!==i?i:null,archetypeOverlayScopes:null!==(a=null==t?void 0:t.archetypeOverlayScopes)&&void 0!==a?a:[]}:{elements:null,compilerSkeletons:r,backfillSkeletons:null,overlaySkeletons:null!==(l=null==t?void 0:t.overlaySkeletons)&&void 0!==l?l:null,archetypeOverlayScopes:null!==(o=null==t?void 0:t.archetypeOverlayScopes)&&void 0!==o?o:[]}}},58354:function(e,t,n){n.d(t,{I:function(){return o},S:function(){return r}});var i=n(39990);let a={yellow:"#ffec99",green:"#b2f2bb",blue:"#a5d8ff",pink:"#fcc2d7",gray:"#e9ecef",purple:"#d0bfff",orange:"#ffd8a8"};function l(e){return(null!=e?e:400)>=700?1000003:(null!=e?e:400)>=500?1000002:1000001}function o(e){var t,n,o,r,d,s,c,u,h,f,p,v,m,g,y,k,x,b,w,M,S,z;let I=[],W=new Map;
1for(let t of e.shapes)W.set(t.id,{x:t.x+t.width/2,y:t.y+t.height/2});let E=new Map;for(let n of e.shapes)if("zone"!==n.kind&&n.parentId){let e=null!==(t=E.get(n.parentId))&&void 0!==t?t:[];e.push(n.id),E.set(n.parentId,e)}for(let t of e.shapes){let e=function(e){var t;let n=null===(t=e.meta)||void 0===t?void 0:t.visual;return n&&"object"==typeof n?n:{}}(t);"zone"===t.kind?I.push({type:"frame",id:t.id,x:t.x,y:t.y,width:t.width,height:t.height,...t.text?{name:t.text}:{},children:null!==(n=E.get(t.id))&&void 0!==n?n:[]}):"note"===t.kind?I.push({type:"rectangle",id:t.id,x:t.x,y:t.y,width:t.width,height:t.height,backgroundColor:null!==(r=e.fill)&&void 0!==r?r:t.color?a[t.color]:a.yellow,strokeColor:null!==(d=e.stroke)&&void 0!==d?d:"#868e96",strokeWidth:e.strokeWidth,fillStyle:"solid",strokeStyle:e.strokeStyle,roundness:null===e.roundness?null:{type:3},..."number"==typeof(null===(o=t.meta)||void 0===o?void 0:o.rotation)?{angle:t.meta.rotation}:{},...t.text?{label:{text:t.text,fontSize:null!==(s=e.fontSize)&&void 0!==s?s:16,fontFamily:l(e.fontWeight),lineHeight:i.uH,textAlign:null!==(c=e.textAlign)&&void 0!==c?c:"left",verticalAlign:null!==(u=e.verticalAlign)&&void 0!==u?u:"middle",strokeColor:null!==(h=e.textColor)&&void 0!==h?h:"#212529"}}:{}}):"text"===t.kind?I.push({type:"text",id:t.id,x:t.x,y:t.y,text:null!==(p=t.text)&&void 0!==p?p:"",width:t.width,height:t.height,fontSize:null!==(v=e.fontSize)&&void 0!==v?v:20,fontFamily:l(e.fontWeight),lineHeight:i.uH,textAlign:e.textAlign,verticalAlign:e.verticalAlign,autoResize:!1,strokeColor:null!==(m=e.stroke)&&void 0!==m?m:"#212529",..."number"==typeof(null===(f=t.meta)||void 0===f?void 0:f.rotation)?{angle:t.meta.rotation}:{}}):"shape"===t.kind&&I.push({type:null!==(y=e.shape)&&void 0!==y?y:"rectangle",id:t.id,x:t.x,y:t.y,width:t.width,height:t.height,backgroundColor:null!==(k=e.fill)&&void 0!==k?k:"transparent",strokeColor:null!==(x=e.stroke)&&void 0!==x?x:"#495057",strokeWidth:e.strokeWidth,strokeStyle:e.strokeStyle,fillStyle:"solid",roundness:null===e.roundness?null:{type:3},..."number"==typeof(null===(g=t.meta)||void 0===g?void 0:g.rotation)?{angle:t.meta.rotation}:{},...t.text?{label:{text:t.text,fontSize:e.fontSize,fontFamily:l(e.fontWeight),lineHeight:i.uH,textAlign:null!==(b=e.textAlign)&&void 0!==b?b:"left",verticalAlign:null!==(w=e.verticalAlign)&&void 0!==w?w:"middle",strokeColor:null!==(M=e.textColor)&&void 0!==M?M:"#212529"}}:{}})}for(let t of e.bindings){let e=W.get(t.from);I.push({type:"arrow",id:t.id,x:null!==(S=null==e?void 0:e.x)&&void 0!==S?S:0,y:null!==(z=null==e?void 0:e.y)&&void 0!==z?z:0,start:{id:t.from},end:{id:t.to},strokeColor:"#495057",strokeStyle:"dashed"===t.style?"dashed":"solid",...t.label?{label:{text:t.label}}:{}})}return I}function r(e,t){if(!(null==t?void 0:t.length))return[...e];let n=new Map(t.filter(e=>"text"===e.type&&"string"==typeof e.id&&"number"==typeof e.width).map(e=>[e.id,e.width]));return e.map(e=>{let t="text"===e.type&&e.id?n.get(e.id):void 0;return void 0===t?e:{...e,width:t,autoResize:!1}})}},76782:function(e,t,n){n.d(t,{rO:function(){return i}});function i(e){return"archetype"in e}}}]);

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.