Files
appco_dist/.output/public/_nuxt/DBl6ki6L.js
T

21 lines
83 KiB
JavaScript
Raw Normal View History

2025-07-24 21:23:30 +03:30
import{d as qt,k as yt,aj as de,y as zt,z as w,a7 as ot,A as K,H as q,ak as me,a4 as Ht,dT as fe,F as y,R as Y,g as T,C as R,D,a2 as jt,a3 as Lt,aa as rt,a8 as Zt,du as Gt,S as $t,bY as pe,r as dt}from"./B565zvD7.js";import{i as Pt}from"./DGz2YCiv.js";import{_ as ge}from"./BFaWnc73.js";const ve=["id","value"],be=["for"],ii=qt({__name:"StoriesComponent",props:{story:{},selectedStory:{}},emits:["update:selectedStory"],setup(t,{emit:e}){const i=t,s=e,o=yt(()=>{var h,r;return(r=i.selectedStory)==null?void 0:r.includes((h=i.story)==null?void 0:h.id)}),n=yt({get(){return i.selectedStory},set(h){s("update:selectedStory",h)}});function a(){var r,c,l;const h=(r=n.value)==null?void 0:r.findIndex(u=>u===i.story.id);h===-1?(c=n.value)==null||c.push(i.story.id):(l=n.value)==null||l.splice(h,1)}return(h,r)=>{var l;const c=de("lazy");return w(),zt("div",{class:"w-full h-full aspect-[2/3] relative",onClick:a},[ot(K("img",{class:Ht(["w-full h-full object-cover aspect-[2/3]",o.value&&"bg-gray-500 opacity-50"])},null,2),[[c,{src:q(me)((l=h.story)==null?void 0:l.media_url),loading:q(Pt),error:q(Pt)}]]),ot(K("input",{type:"checkbox",id:`story-${h.story.id}`,value:h.story,"onUpdate:modelValue":r[0]||(r[0]=u=>n.value=u),class:"absolute opacity-0 w-full h-full peer"},null,8,ve),[[fe,n.value]]),K("label",{for:`story-${h.story.id}`,class:"absolute bottom-2 right-2 w-5 h-5 rounded border-1 border-black cursor-pointer transition-all group-hover:ring-2 group-hover:ring-blue-400 peer-checked:bg-black peer-checked:border-black"},[(w(),zt("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",class:Ht(["w-18px h-18px text-white bg-black transition-opacity",o.value?"peer-checked:opacity-100":"opacity-0"])},r[1]||(r[1]=[K("path",{d:"M5 12l5 5L20 7"},null,-1)]),2))],8,be)])}}});function It(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),i.push.apply(i,s)}return i}function v(t){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?It(Object(i),!0).forEach(function(s){E(t,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):It(Object(i)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(i,s))})}return t}function E(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function we(t,e){if(t==null)return{};var i,s,o=function(a,h){if(a==null)return{};var r,c,l={},u=Object.keys(a);for(c=0;c<u.length;c++)r=u[c],h.indexOf(r)>=0||(l[r]=a[r]);return l}(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(s=0;s<n.length;s++)i=n[s],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(o[i]=t[i])}return o}function k(t){return function(e){if(Array.isArray(e))return mt(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,i){if(e){if(typeof e=="string")return mt(e,i);var s=Object.prototype.toString.call(e).slice(8,-1);if(s==="Object"&&e.constructor&&(s=e.constructor.name),s==="Map"||s==="Set")return Array.from(e);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return mt(e,i)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2025-07-22 23:06:16 +03:30
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function mt(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i<e;i++)s[i]=t[i];return s}var Bt,ye,J,z=(Bt=function(t){/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(){var e={}.hasOwnProperty;function i(){for(var s=[],o=0;o<arguments.length;o++){var n=arguments[o];if(n){var a=typeof n;if(a==="string"||a==="number")s.push(n);else if(Array.isArray(n)){if(n.length){var h=i.apply(null,n);h&&s.push(h)}}else if(a==="object")if(n.toString===Object.prototype.toString)for(var r in n)e.call(n,r)&&n[r]&&s.push(r);else s.push(n.toString())}}return s.join(" ")}t.exports?(i.default=i,t.exports=i):window.classNames=i})()},Bt(J={path:ye,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(e==null&&J.path)}},J.exports),J.exports),O=function(t){return function(e,i){if(!e)return t;var s;typeof e=="string"?s=e:i=e;var o=t;return s&&(o+="__"+s),o+(i?Object.keys(i).reduce(function(n,a){var h=i[a];return h&&(n+=" "+(typeof h=="boolean"?o+"--"+a:o+"--"+a+"_"+h)),n},""):"")}};function Rt(t,e,i){var s,o,n,a,h;function r(){var l=Date.now()-a;l<e&&l>=0?s=setTimeout(r,e-l):(s=null,i||(h=t.apply(n,o),n=o=null))}e==null&&(e=100);var c=function(){n=this,o=arguments,a=Date.now();var l=i&&!s;return s||(s=setTimeout(r,e)),l&&(h=t.apply(n,o),n=o=null),h};return c.clear=function(){s&&(clearTimeout(s),s=null)},c.flush=function(){s&&(h=t.apply(n,o),n=o=null,clearTimeout(s),s=null)},c}Rt.debounce=Rt;var At=Rt,f=function(){return f=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},f.apply(this,arguments)};/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
2025-07-24 21:13:13 +03:30
***************************************************************************** */function Qt(t,e){var i,s;return t&&e?(i=""+t+e[0].toUpperCase()+e.slice(1),s=t+"-"+e):(i=t||e,s=t||e),{name:i,classname:s}}function Kt(t){return/^blob:/.test(t)}function kt(t){return Kt(t)||function(e){return/^data:/.test(e)}(t)}function X(t){return!!(t&&t.constructor&&t.call&&t.apply)}function A(t){return t===void 0}function st(t){return typeof t=="object"&&t!==null}function Mt(t,e,i){var s={};return st(t)?(Object.keys(e).forEach(function(o){A(t[o])?s[o]=e[o]:st(e[o])?st(t[o])?s[o]=Mt(t[o],e[o],i[o]):s[o]=t[o]?e[o]:i[o]:e[o]===!0||e[o]===!1?s[o]=!!t[o]:s[o]=t[o]}),s):t?e:i}function tt(t){var e=Number(t);return Number.isNaN(e)?t:e}function Yt(t){return typeof(t=="number"||function(e){return typeof e=="object"&&e!==null}(t)&&toString.call(t)=="[object Number]")&&!Jt(t)}function Jt(t){return t!=t}function te(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}var Z=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),this.type="manipulateImage",this.move=t,this.scale=e},ze=function(t,e){e===void 0&&(e={}),this.type="resize",this.directions=t,this.params=e},Et=function(t){this.type="move",this.directions=t},Re=function(){function t(e,i,s,o,n){this.type="drag",this.nativeEvent=e,this.position=s,this.previousPosition=o,this.element=i,this.anchor=n}return t.prototype.shift=function(){var e=this,i=e.element,s=e.anchor,o=e.position;if(i){var n=i.getBoundingClientRect(),a=n.left,h=n.top;return{left:o.left-a-s.left,top:o.top-h-s.top}}return{left:0,top:0}},t}(),Tt={name:"DraggableElement",props:{classname:{type:String}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error('You should add ref "draggable" to your root element to use draggable mixin');this.touches=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&!this.touches.length&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&!this.disabled&&t.touches.length===1&&(this.touches=k(t.touches),this.hovered||(this.$emit("enter"),this.hovered=!0),t.touches.length&&this.initAnchor(this.touches.reduce(function(e,i){return{clientX:e.clientX+i.clientX/t.touches.length,clientY:e.clientY+i.clientY/t.touches.length}},{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){if(!this.disabled){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.preventDefault())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.draggable.getBoundingClientRect(),i=e.left,s=e.right,o=e.bottom,n=e.top;this.anchor={left:t.clientX-i,top:t.clientY-n,bottom:o-t.clientY,right:s-t.clientX}},processMove:function(t,e){var i=k(e);if(this.touches.length){if(this.touches.length===1&&i.length===1){var s=this.$refs.draggable;this.$emit("drag",new Re(t,s,{left:i[0].clientX,top:i[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=i}},processEnd:function(){this.touches.length&&this.$emit("drag-end"),this.hovered&&(this.$emit("leave"),this.hovered=!1),this.touches=[]}},emits:["drag","
`.concat(-this.coordinates.left/t-a.rotate.left-a.scale.left,"px,").concat(-this.coordinates.top/t-a.rotate.top-a.scale.top,"px) ")+re(e),this.transitions&&this.transitions.enabled&&(n.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),n}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(t){(t.width||t.height)&&this.onChangeImage()}},mounted:function(){var t=this;this.onChangeImage(),this.$refs.image.addEventListener("load",function(){t.refreshImage()}),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var t=this.$refs.image;this.calculatedImageSize.height=t.naturalHeight,this.calculatedImageSize.width=t.naturalWidth},refresh:function(){var t=this.$refs.root;this.width||(this.calculatedSize.width=t.clientWidth),this.height||(this.calculatedSize.height=t.clientHeight)},onChangeImage:function(){var t=this.$refs.image;t&&t.complete&&this.refreshImage(),this.refresh()}}};he.render=function(t,e,i,s,o,n){return w(),y("div",{ref:"root",class:n.classes.root,style:n.style},[R("div",{ref:"wrapper",class:n.classes.wrapper,style:n.wrapperStyle},[ot(R("img",{ref:"image",src:i.image&&i.image.src,class:n.classes.image,style:n.imageStyle},null,14,["src"]),[[Zt,i.image&&i.image.src]])],6)],6)};var Dt={components:{Preview:he},inheritAttrs:!1};Dt.render=function(t,e,i,s,o,n){var a=T("preview");return w(),y(a,Gt(t.$attrs,{fill:!0}),null,16)};var bt=O("vue-rectangle-stencil"),ce={name:"RectangleStencil",components:{StencilPreview:Dt,BoundingBox:Wt,DraggableArea:Ot},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return lt}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return ut}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:z(bt({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:z(bt("preview"),this.previewClass),boundingBox:z(bt("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,i=t.width,s=t.left,o=t.top,n={width:"".concat(i,"px"),height:"".concat(e,"px"),transform:"translate(".concat(s,"px, ").concat(o,"px)")};return this.transitions&&this.transitions.enabled&&(n.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),n}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}},emits:["resize","resize-end","move","move-end"]};ce.render=function(t,e,i,s,o,n){var a=T("stencil-preview"),h=T("draggable-area"),r=T("bounding-box");return w(),y("div",{class:n.classes.stencil,style:n.style},[R(r,{width:i.stencilCoord